Skip to content

Commit

Permalink
Test data-buffer with initial content
Browse files Browse the repository at this point in the history
  • Loading branch information
ropez committed Mar 2, 2010
1 parent 57f248b commit afde5e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/test_data_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class TestDataBuffer : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestDataBuffer);
CPPUNIT_TEST(testEmpty);
CPPUNIT_TEST(testWithInitialContent);
CPPUNIT_TEST(testSingleWriteMultiRead);
CPPUNIT_TEST(testMultiWriteSingleRead);
CPPUNIT_TEST(testReadMoreThanAvailable);
Expand All @@ -22,6 +23,11 @@ class TestDataBuffer : public CppUnit::TestFixture
CPPUNIT_ASSERT_THROW(db.read(3), pcs::Exception);
}

void testWithInitialContent() {
DataBuffer db(ByteArray("foobar", 6));
CPPUNIT_ASSERT_EQUAL(ByteArray("foobar", 6), db.read(6));
}

void testSingleWriteMultiRead() {
DataBuffer db;
CPPUNIT_ASSERT_NO_THROW(db.write(ByteArray("foobar", 6)));
Expand Down

0 comments on commit afde5e6

Please sign in to comment.