summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-09-30 20:25:27 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-09-30 20:25:27 (GMT)
commit6c8f9f9619f464d21c81f850f7a73498568af5c4 (patch)
tree17013a2a5e904b45bb69cc3f0df3715c76921aa9 /Swiften/Base/UnitTest
parentd8397995e67661c8ed6b6abddd2deb2e70ea15e6 (diff)
downloadswift-6c8f9f9619f464d21c81f850f7a73498568af5c4.zip
swift-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.cpp21
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);