| 371 | }; |
| 372 | |
| 373 | TEST_P(InputByteStreamTest, inputStream) { |
| 374 | uint8_t kFakeBuffer[8192]; |
| 375 | std::vector<ByteRange> byteRanges; |
| 376 | size_t totalBytes{0}; |
| 377 | for (int32_t i = 0; i < 32; ++i) { |
| 378 | byteRanges.push_back(ByteRange{kFakeBuffer, 4096 + i, 0}); |
| 379 | totalBytes += 4096 + i; |
| 380 | } |
| 381 | auto byteStream = createStream(byteRanges); |
| 382 | ASSERT_EQ(byteStream->size(), totalBytes); |
| 383 | ASSERT_FALSE(byteStream->atEnd()); |
| 384 | byteStream->skip(totalBytes); |
| 385 | ASSERT_TRUE(byteStream->atEnd()); |
| 386 | if (GetParam()) { |
| 387 | BOLT_ASSERT_THROW( |
| 388 | byteStream->skip(1), "Reading past end of ByteInputStream"); |
| 389 | } else { |
| 390 | BOLT_ASSERT_THROW( |
| 391 | byteStream->skip(1), |
| 392 | "(1 vs. 0) Skip past the end of FileInputStream: 131568"); |
| 393 | } |
| 394 | ASSERT_TRUE(byteStream->atEnd()); |
| 395 | } |
| 396 | |
| 397 | TEST_P(InputByteStreamTest, remainingSize) { |
| 398 | const int32_t kSize = 100; |
nothing calls this directly
no test coverage detected