diff options
| author | Remko Tronçon <git@el-tramo.be> | 2011-05-18 16:22:06 (GMT) | 
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2011-05-18 16:50:18 (GMT) | 
| commit | 8472194d716e0e3b95a66bf5be45c246ee79d0af (patch) | |
| tree | b9f473e0e606b012ee5013e85d2cf5e7523b7029 /Swiften/Compress/UnitTest/ZLibDecompressorTest.cpp | |
| parent | b1b3b8f88517ad8b14795cc8a6265962d2935be3 (diff) | |
| download | swift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.zip swift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.tar.bz2  | |
Propagate use of SafeByteArray down to the connection.
Diffstat (limited to 'Swiften/Compress/UnitTest/ZLibDecompressorTest.cpp')
| -rw-r--r-- | Swiften/Compress/UnitTest/ZLibDecompressorTest.cpp | 24 | 
1 files changed, 12 insertions, 12 deletions
diff --git a/Swiften/Compress/UnitTest/ZLibDecompressorTest.cpp b/Swiften/Compress/UnitTest/ZLibDecompressorTest.cpp index 00aae6e..5dd8630 100644 --- a/Swiften/Compress/UnitTest/ZLibDecompressorTest.cpp +++ b/Swiften/Compress/UnitTest/ZLibDecompressorTest.cpp @@ -32,22 +32,22 @@ class ZLibDecompressorTest : public CppUnit::TestFixture  		void testProcess() {  			ZLibDecompressor testling; -			ByteArray result = testling.process(createByteArray("\x78\xda\x4a\xcb\xcf\x07\x00\x00\x00\xff\xff", 11)); +			SafeByteArray result = testling.process(createSafeByteArray("\x78\xda\x4a\xcb\xcf\x07\x00\x00\x00\xff\xff", 11)); -			CPPUNIT_ASSERT_EQUAL(createByteArray("foo"), result); +			CPPUNIT_ASSERT_EQUAL(createSafeByteArray("foo"), result);  		}  		void testProcess_Twice() {  			ZLibDecompressor testling; -			testling.process(createByteArray("\x78\xda\x4a\xcb\xcf\x07\x00\x00\x00\xff\xff", 11)); -			ByteArray result = testling.process(createByteArray("\x4a\x4a\x2c\x02\x00\x00\x00\xff\xff", 9));  +			testling.process(createSafeByteArray("\x78\xda\x4a\xcb\xcf\x07\x00\x00\x00\xff\xff", 11)); +			SafeByteArray result = testling.process(createSafeByteArray("\x4a\x4a\x2c\x02\x00\x00\x00\xff\xff", 9)); -			CPPUNIT_ASSERT_EQUAL(createByteArray("bar"), result); +			CPPUNIT_ASSERT_EQUAL(createSafeByteArray("bar"), result);  		}  		void testProcess_Invalid() {  			ZLibDecompressor testling; -			CPPUNIT_ASSERT_THROW(testling.process(createByteArray("invalid")), ZLibException); +			CPPUNIT_ASSERT_THROW(testling.process(createSafeByteArray("invalid")), ZLibException);  		}  		void testProcess_Huge() { @@ -56,9 +56,9 @@ class ZLibDecompressorTest : public CppUnit::TestFixture  			for (unsigned int i = 0; i < 2048; ++i) {  				data.push_back(static_cast<char>(i));  			} -			ByteArray original(createByteArray(&data[0], data.size())); -			ByteArray compressed = ZLibCompressor().process(original); -			ByteArray decompressed = ZLibDecompressor().process(compressed); +			SafeByteArray original(createSafeByteArray(&data[0], data.size())); +			SafeByteArray compressed = ZLibCompressor().process(original); +			SafeByteArray decompressed = ZLibDecompressor().process(compressed);  			CPPUNIT_ASSERT_EQUAL(original, decompressed);  		} @@ -69,9 +69,9 @@ class ZLibDecompressorTest : public CppUnit::TestFixture  			for (unsigned int i = 0; i < 1024; ++i) {  				data.push_back(static_cast<char>(i));  			} -			ByteArray original(createByteArray(&data[0], data.size())); -			ByteArray compressed = ZLibCompressor().process(original); -			ByteArray decompressed = ZLibDecompressor().process(compressed); +			SafeByteArray original(createSafeByteArray(&data[0], data.size())); +			SafeByteArray compressed = ZLibCompressor().process(original); +			SafeByteArray decompressed = ZLibDecompressor().process(compressed);  			CPPUNIT_ASSERT_EQUAL(original, decompressed);  		}  | 
 Swift