MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / TEST_P

Function TEST_P

source/MRTest/MRZlibTests.cpp:82–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80class ZlibCompressTestFixture : public testing::TestWithParam<ZlibCompressParameters> {};
81
82TEST_P( ZlibCompressTestFixture, ZlibCompress )
83{
84 const auto& [input, inputSize, output, outputSize, level, rawDeflate] = GetParam();
85
86 const std::string inputStr( reinterpret_cast<const char*>( input ), inputSize );
87 std::istringstream in( inputStr );
88
89 const std::string outputStr( reinterpret_cast<const char*>( output ), outputSize );
90 std::ostringstream out( outputStr );
91
92 auto res = MR::zlibCompressStream( in, out, MR::ZlibCompressParams{ { .rawDeflate = rawDeflate }, level } );
93 EXPECT_TRUE( res.has_value() );
94 // FIXME: Python and MeshLib output data mismatch; note that MeshLib output is still valid
95 //EXPECT_STREQ( out.str().c_str(), outputStr.c_str() );
96
97 std::istringstream in2( out.str() );
98 std::ostringstream out2;
99 res = MR::zlibDecompressStream( in2, out2, MR::ZlibParams{ .rawDeflate = rawDeflate } );
100 EXPECT_TRUE( res.has_value() );
101 EXPECT_STREQ( out2.str().c_str(), inputStr.c_str() );
102}
103
104INSTANTIATE_TEST_SUITE_P( MRMesh, ZlibCompressTestFixture, testing::Values(
105 ZlibCompressParameters { cInput, sizeof( cInput ), cWrappedLevel1, sizeof( cWrappedLevel1 ), 1, false },

Callers

nothing calls this directly

Calls 2

zlibCompressStreamFunction · 0.85
zlibDecompressStreamFunction · 0.85

Tested by

no test coverage detected