diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
commit | 72231250ed81e10d66bfe70701e64fa5fe50f712 (patch) | |
tree | 2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /document/src/tests/testbytebuffer.h |
Publish
Diffstat (limited to 'document/src/tests/testbytebuffer.h')
-rw-r--r-- | document/src/tests/testbytebuffer.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/document/src/tests/testbytebuffer.h b/document/src/tests/testbytebuffer.h new file mode 100644 index 00000000000..58962d73449 --- /dev/null +++ b/document/src/tests/testbytebuffer.h @@ -0,0 +1,73 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +/* $Id$*/ + +#pragma once + +#include <cppunit/extensions/HelperMacros.h> + +/** + CPPUnit test case for ByteBuffer class. +*/ +class ByteBuffer_Test : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE( ByteBuffer_Test); + CPPUNIT_TEST(test_constructors); + CPPUNIT_TEST(test_copy_constructor); + CPPUNIT_TEST(test_assignment_operator); + CPPUNIT_TEST(test_slice); + CPPUNIT_TEST(test_slice2); + CPPUNIT_TEST(test_putGetFlip); + CPPUNIT_TEST(test_NumberEncodings); + CPPUNIT_TEST(test_NumberLengths); + CPPUNIT_TEST(test_SerializableArray); + CPPUNIT_TEST_SUITE_END(); + +public: + /** + Initialization. + */ + void setUp(); + +protected: + /** + Test construction and deletion. + */ + void test_constructors(); + void test_SerializableArray(); + + /** + Test copy constructor + */ + void test_copy_constructor(); + /** + Test construction and deletion. + */ + void test_assignment_operator(); + + /** + Test the slice() method + */ + void test_slice(); + + /** + Test the slice2() method + */ + void test_slice2(); + + /** + Test put(), get() and flip() methods. + */ + void test_putGetFlip(); + + /** + Test writing integers with funny encodings. + */ + void test_NumberEncodings(); + + /** + Tests lengths of those encodings. + */ + void test_NumberLengths(); + +}; + + |