@@ -45,9 +45,9 @@ struct BranchBuilder {
4545 branch.entries = branch.totBytes = branch.zipBytes = 0 ;
4646 }
4747
48- void add (Algo algo, std::vector<uint8_t > const & values, int32_t nEntries, size_t tail = 0 , size_t chunkSize = 0xffffff )
48+ void add (Algo algo, std::vector<uint8_t > const & values, int32_t nEntries, size_t tail = 0 , size_t chunkSize = 0xffffff , bool ioBits = false )
4949 {
50- auto basket = makeBasket (algo, values, nEntries, tail, chunkSize);
50+ auto basket = makeBasket (algo, values, nEntries, tail, chunkSize, ioBits );
5151 branch.baskets .push_back (BasketRef{file.size (), (uint32_t )basket.size (), branch.entries , nEntries, false , {}});
5252 file.insert (file.end (), basket.begin (), basket.end ());
5353 branch.entries += nEntries;
@@ -103,6 +103,25 @@ TEST_CASE("float values across codecs, uncompressed and embedded baskets")
103103 }
104104}
105105
106+ TEST_CASE (" baskets with fIOBits in their header decode like the others" )
107+ {
108+ BranchBuilder b{' F' };
109+ std::vector<float > expected;
110+ for (auto [algo, ioBits] : {std::pair{Algo::ZSTD , true }, std::pair{Algo::None, false }, std::pair{Algo::LZ4 , true }}) {
111+ std::vector<float > values;
112+ for (int i = 0 ; i < 100 ; ++i) {
113+ values.push_back (expected.size () + i);
114+ }
115+ b.add (algo, bigEndian (values), values.size (), 404 , 0xffffff , ioBits);
116+ expected.insert (expected.end (), values.begin (), values.end ());
117+ }
118+ MemoryByteSource source{b.file };
119+ BranchDecoder decoder{source, Options{}};
120+ std::vector<float > out (expected.size (), 42 .f );
121+ decoder.decodeValues (b.branch , (uint8_t *)out.data (), out.size () * sizeof (float ));
122+ CHECK (out == expected);
123+ }
124+
106125TEST_CASE (" decoding stops exactly at the value region for every codec" )
107126{
108127 // A poisoned entry-offset tail after the values: nothing past fLast - fKeylen
0 commit comments