diff --git a/native/test.cpp b/native/test.cpp index 826d973..44fad1b 100644 --- a/native/test.cpp +++ b/native/test.cpp @@ -4,7 +4,7 @@ using namespace std; -bool run(int method, char* buffer, size_t buffer_length) { +bool run(compression_codec method, char* buffer, size_t buffer_length) { int32_t len{0}; bool ok = iron_compress(true, method, buffer, buffer_length, nullptr, &len, compression_level::best); @@ -27,31 +27,36 @@ bool run(int method, char* buffer, size_t buffer_length) { TEST(Roundtrip, Snappy_1) { char bytes[] = {'a', 'b', 'c'}; - EXPECT_TRUE(run(1, bytes, 3)); + EXPECT_TRUE(run(compression_codec::snappy, bytes, 3)); } TEST(Roundtrip, Zstd_2) { char bytes[] = {'a', 'b', 'c'}; - EXPECT_TRUE(run(2, bytes, 3)); + EXPECT_TRUE(run(compression_codec::zstd, bytes, 3)); } TEST(Roundtrip, Gzip_3) { EXPECT_FALSE(iron_is_supported(compression_codec::gzip)); + EXPECT_FALSE(iron_compress(true, compression_codec::gzip, + nullptr, 0, + nullptr, nullptr, + compression_level::best)); + //char bytes[] = {'a', 'b', 'c'}; //EXPECT_TRUE(run(3, bytes, 3)); } TEST(Roundtrip, Brotli_4) { char bytes[] = {'a', 'b', 'c'}; - EXPECT_TRUE(run(4, bytes, 3)); + EXPECT_TRUE(run(compression_codec::brotli, bytes, 3)); } TEST(Roundtrip, Lzo_5) { char bytes[] = {'a', 'b', 'c'}; - EXPECT_TRUE(run(5, bytes, 3)); + EXPECT_TRUE(run(compression_codec::lzo, bytes, 3)); } TEST(Roundtrip, LZ4_6) { char bytes[] = {'a', 'b', 'c'}; - EXPECT_TRUE(run(6, bytes, 3)); + EXPECT_TRUE(run(compression_codec::lz4, bytes, 3)); } \ No newline at end of file