Output the structure data as a CSV Line
Get the names of the CSV fields from the structure
Check empty values and zero devision handling
CompressionTestData tv; const auto hdr = tv.getCsvHeader; assert( hdr == "pattern;unpacked_size;packed_size;pack_duration;unpack_duration;pack_ratio;pack_mbs;unpack_mbs"); const auto line = tv.getCsvLine; assert(line == "(Unknown:00000:00000:00);0;0;0.000000;0.000000;nan;nan;nan");
Check example values
auto tp = TestPattern(PatterMode.RepeatN, 0x00100, 0x00200, 8); CompressionTestData tv = CompressionTestData(tp, 2 ^^ 20, 2 ^^ 10, dur!"seconds"(1), dur!"seconds"( 1)); auto line = tv.getCsvLine; assert( line == "(RepeatN:00100:00200:08);1048576;1024;1.000000;1.000000;0.000977;1.000000;1.000000"); tv = CompressionTestData(tp, 10 ^^ 6, 10 ^^ 3, dur!"seconds"(1), dur!"seconds"(1)); line = tv.getCsvLine; assert( line == "(RepeatN:00100:00200:08);1000000;1000;1.000000;1.000000;0.001000;0.953674;0.953674");
Container struct for compression benchmarking in CSV file