THRIFT-929. cpp: Add unit test for transport functionality
authorDavid Reiss <dreiss@apache.org>
Wed, 6 Oct 2010 17:10:19 +0000 (17:10 +0000)
committerDavid Reiss <dreiss@apache.org>
Wed, 6 Oct 2010 17:10:19 +0000 (17:10 +0000)
commit35dc7695a95e4e0c3e311faca5341a2e365b9ea0
tree8e2c4355bdc06ae32911705e815d98769accc105
parent105961de04cf064981b70e8ec8458c196e0ee17e
THRIFT-929. cpp: Add unit test for transport functionality

Tests various transport types by writing data, and verifying it can be
read back successfully.  Tests both virtual calls (accessed as
TTransport*) and non-virtual calls (accessed as the appropriate pointer
type, or as TBufferBase* when appropriate).

This is similar to some of the tests already performed in
TMemoryBufferTest and ZlibTest.cpp.  However, this tests a few more
transport types, and it interleaves read and write calls more heavily.
(It currently exposes some bugs in flush() in a couple transports.) It
also exercises both the virtual and non-virtual code paths, now that
read() and write() only result in virtual calls when invoked on a
TTransport*.

TFileTransport currently has several race condition bugs, so most of the
TFileTransport tests ususally fail.  It also has some performance bugs,
causing the TFileTransport tests to take a long time.  Will fix those
issues separately.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005146 13f79535-47bb-0310-9956-ffa450edef68
lib/cpp/test/Makefile.am
lib/cpp/test/TransportTest.cpp [new file with mode: 0644]