| 200 | } |
| 201 | |
| 202 | void TestStrings() { |
| 203 | const TString FILENAME = "chunked_helpers_test.bin"; |
| 204 | TTempFileHandle file(FILENAME.c_str()); |
| 205 | |
| 206 | { |
| 207 | TFixedBufferFileOutput fOut(FILENAME); |
| 208 | TStringsVectorWriter stringsWriter; |
| 209 | stringsWriter.PushBack(""); |
| 210 | stringsWriter.PushBack("test"); |
| 211 | TChunkedDataWriter writer(fOut); |
| 212 | WriteBlock(writer, stringsWriter); |
| 213 | writer.WriteFooter(); |
| 214 | } |
| 215 | |
| 216 | { |
| 217 | TBlob fIn = TBlob::FromFileSingleThreaded(FILENAME); |
| 218 | TStringsVector vct(GetBlock(fIn, 0)); |
| 219 | UNIT_ASSERT_EQUAL(vct.Get(0), ""); |
| 220 | UNIT_ASSERT_EQUAL(vct.Get(1), "test"); |
| 221 | |
| 222 | bool wasException = false; |
| 223 | try { |
| 224 | vct.Get(2); |
| 225 | } catch (...) { |
| 226 | wasException = true; |
| 227 | } |
| 228 | UNIT_ASSERT(wasException); |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | void TestNamedChunkedData() { |
| 233 | const TString filename = MakeTempName(nullptr, "named_chunked_data_test"); |
nothing calls this directly
no test coverage detected