Skip to content

Commit 3dda87f

Browse files
committed
additional tests have been added
1 parent 0373b81 commit 3dda87f

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

ydb/library/yql/providers/s3/compressors/ut/decompressor_ut.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ Y_UNIT_TEST_SUITE(TCompressorTests) {
2828
}
2929
])"));
3030
}
31+
32+
Y_UNIT_TEST(WrongMagicLz4) {
33+
NDB::ReadBufferFromFile buffer(GetResourcePath("test.json"));
34+
UNIT_ASSERT_EXCEPTION_CONTAINS(std::make_unique<NLz4::TReadBuffer>(buffer), yexception, "TReadBuffer(): requirement StreamType != EStreamType::Unknown failed, message: Wrong magic.");
35+
}
36+
37+
Y_UNIT_TEST(ErrorLz4) {
38+
NDB::ReadBufferFromFile buffer(GetResourcePath("test.broken.lz4"));
39+
auto decompressorBuffer = std::make_unique<NLz4::TReadBuffer>(buffer);
40+
char str[256] = {};
41+
UNIT_ASSERT_EXCEPTION_CONTAINS(decompressorBuffer->read(str, 256), yexception, "DecompressFrame(): requirement !LZ4F_isError(NextToLoad) failed, message: Decompression error: ERROR_reservedFlag_set");
42+
}
3143
}
3244

3345
}
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"id": 0,
4+
"description": "yq",
5+
"info": "abc"
6+
}
7+
]
8+

0 commit comments

Comments
 (0)