MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / decompressForTest

Function decompressForTest

Tests/Libraries/Http/HttpAsyncClientTest.cpp:183–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183static SC::Result decompressForTest(SC::ZLibStream::Algorithm algorithm, SC::Span<const char> input,
184 SC::Span<char>& decoded)
185{
186 SC::ZLibStream stream;
187 SC_TRY(stream.init(algorithm));
188
189 static char outputStorage[512];
190 SC::Span<char> remaining = outputStorage;
191 SC_TRY(stream.process(input, remaining));
192 SC_TRY_MSG(input.empty(), "HttpAsyncClientTest compressed fixture output too small");
193
194 bool streamEnded = false;
195 SC_TRY(stream.finalize(remaining, streamEnded));
196 SC_TRY_MSG(streamEnded, "HttpAsyncClientTest compressed fixture did not end");
197 decoded = {outputStorage, sizeof(outputStorage) - remaining.sizeInBytes()};
198 return SC::Result(true);
199}
200
201static bool resultMessageEquals(SC::Result result, SC::StringSpan expected)
202{

Callers 1

onEndMethod · 0.85

Calls 5

ResultClass · 0.50
initMethod · 0.45
processMethod · 0.45
finalizeMethod · 0.45
sizeInBytesMethod · 0.45

Tested by

no test coverage detected