diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-09-30 20:25:27 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-09-30 20:25:27 (GMT) |
commit | 6c8f9f9619f464d21c81f850f7a73498568af5c4 (patch) | |
tree | 17013a2a5e904b45bb69cc3f0df3715c76921aa9 /Swiften/Base/UnitTest | |
parent | d8397995e67661c8ed6b6abddd2deb2e70ea15e6 (diff) | |
download | swift-contrib-6c8f9f9619f464d21c81f850f7a73498568af5c4.zip swift-contrib-6c8f9f9619f464d21c81f850f7a73498568af5c4.tar.bz2 |
Fix ByteArray::getData() when bytearray is empty.
Also did similar fix for ByteArray constructor.
Diffstat (limited to 'Swiften/Base/UnitTest')
-rw-r--r-- | Swiften/Base/UnitTest/ByteArrayTest.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Swiften/Base/UnitTest/ByteArrayTest.cpp b/Swiften/Base/UnitTest/ByteArrayTest.cpp new file mode 100644 index 0000000..bf893bd --- /dev/null +++ b/Swiften/Base/UnitTest/ByteArrayTest.cpp @@ -0,0 +1,21 @@ +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/extensions/TestFactoryRegistry.h> + +#include "Swiften/Base/ByteArray.h" + +using namespace Swift; + +class ByteArrayTest : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(ByteArrayTest); + CPPUNIT_TEST(testGetData_NoData); + CPPUNIT_TEST_SUITE_END(); + + public: + void testGetData_NoData() { + ByteArray testling; + + CPPUNIT_ASSERT_EQUAL(static_cast<const char*>(NULL), static_cast<const char*>(testling.getData())); + } +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(ByteArrayTest); |