MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

libs/coding/coding_tests/simple_dense_coding_test.cpp:31–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29} // namespace
30
31UNIT_TEST(SimpleDenseCoding_Smoke)
32{
33 size_t const kSize = numeric_limits<uint8_t>::max();
34 vector<uint8_t> data(kSize);
35 for (size_t i = 0; i < data.size(); ++i)
36 data[i] = i;
37
38 string const kTestFile = "test.tmp";
39 SCOPE_GUARD(cleanup, bind(&FileWriter::DeleteFileX, kTestFile));
40
41 {
42 SimpleDenseCoding coding(data);
43 TestSDC(data, coding);
44 FileWriter writer(kTestFile);
45 Freeze(coding, writer, "SimpleDenseCoding");
46 }
47
48 {
49 MmapReader reader(kTestFile);
50 SimpleDenseCoding coding;
51 Map(coding, reader.Data(), "SimpleDenseCoding");
52 TestSDC(data, coding);
53 }
54}
55
56UNIT_TEST(SimpleDenseCoding_Ratio)
57{

Callers

nothing calls this directly

Calls 5

TestSDCFunction · 0.85
FreezeFunction · 0.85
MapFunction · 0.50
sizeMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected