From ad148587dcf5244c2d2011dba339786c765c54c4 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 4 Nov 2020 16:19:54 +0100 Subject: Make Lint Happy --- src/unittest/test_compression.cpp | 67 +++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 34 deletions(-) (limited to 'src/unittest/test_compression.cpp') diff --git a/src/unittest/test_compression.cpp b/src/unittest/test_compression.cpp index dfcadd4b2..a572d7437 100644 --- a/src/unittest/test_compression.cpp +++ b/src/unittest/test_compression.cpp @@ -27,7 +27,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "nodedef.h" #include "noise.h" -class TestCompression : public TestBase { +class TestCompression : public TestBase +{ public: TestCompression() { TestManager::registerTestModule(this); } const char *getName() { return "TestCompression"; } @@ -56,20 +57,20 @@ void TestCompression::runTests(IGameDef *gamedef) void TestCompression::testRLECompression() { SharedBuffer fromdata(4); - fromdata[0]=1; - fromdata[1]=5; - fromdata[2]=5; - fromdata[3]=1; + fromdata[0] = 1; + fromdata[1] = 5; + fromdata[2] = 5; + fromdata[3] = 1; std::ostringstream os(std::ios_base::binary); compress(fromdata, os, 0); std::string str_out = os.str(); - infostream << "str_out.size()="< "; for (char i : str_out) - infostream << (u32) i << ","; + infostream << (u32)i << ","; infostream << std::endl; UASSERT(str_out.size() == 10); @@ -93,7 +94,7 @@ void TestCompression::testRLECompression() infostream << "decompress: "; for (char i : str_out2) - infostream << (u32) i << ","; + infostream << (u32)i << ","; infostream << std::endl; UASSERTEQ(size_t, str_out2.size(), fromdata.getSize()); @@ -105,20 +106,20 @@ void TestCompression::testRLECompression() void TestCompression::testZlibCompression() { SharedBuffer fromdata(4); - fromdata[0]=1; - fromdata[1]=5; - fromdata[2]=5; - fromdata[3]=1; + fromdata[0] = 1; + fromdata[1] = 5; + fromdata[2] = 5; + fromdata[3] = 1; std::ostringstream os(std::ios_base::binary); compress(fromdata, os, SER_FMT_VER_HIGHEST_READ); std::string str_out = os.str(); - infostream << "str_out.size()=" << str_out.size() < "; for (char i : str_out) - infostream << (u32) i << ","; + infostream << (u32)i << ","; infostream << std::endl; std::istringstream is(str_out, std::ios_base::binary); @@ -129,7 +130,7 @@ void TestCompression::testZlibCompression() infostream << "decompress: "; for (char i : str_out2) - infostream << (u32) i << ","; + infostream << (u32)i << ","; infostream << std::endl; UASSERTEQ(size_t, str_out2.size(), fromdata.getSize()); @@ -141,11 +142,11 @@ void TestCompression::testZlibCompression() void TestCompression::testZlibLargeData() { infostream << "Test: Testing zlib wrappers with a large amount " - "of pseudorandom data" << std::endl; + "of pseudorandom data" + << std::endl; u32 size = 50000; - infostream << "Test: Input size of large compressZlib is " - << size << std::endl; + infostream << "Test: Input size of large compressZlib is " << size << std::endl; std::string data_in; data_in.resize(size); @@ -156,21 +157,21 @@ void TestCompression::testZlibLargeData() std::ostringstream os_compressed(std::ios::binary); compressZlib(data_in, os_compressed); infostream << "Test: Output size of large compressZlib is " - << os_compressed.str().size()<