| 29 | namespace gandiva { |
| 30 | |
| 31 | TEST(TestGdvFnStubs, TestCrc32) { |
| 32 | gandiva::ExecutionContext ctx; |
| 33 | auto ctx_ptr = reinterpret_cast<int64_t>(&ctx); |
| 34 | EXPECT_EQ(gdv_fn_crc_32_utf8(ctx_ptr, "ABC", 3), 2743272264); |
| 35 | EXPECT_EQ(gdv_fn_crc_32_utf8(ctx_ptr, "Hello", 5), 4157704578); |
| 36 | EXPECT_EQ(gdv_fn_crc_32_utf8(ctx_ptr, "hive", 4), 3698179064); |
| 37 | EXPECT_EQ(gdv_fn_crc_32_utf8(ctx_ptr, "372189372123", 12), 2607335846); |
| 38 | EXPECT_EQ(gdv_fn_crc_32_utf8(ctx_ptr, "", 0), 0); |
| 39 | |
| 40 | EXPECT_EQ(gdv_fn_crc_32_utf8(ctx_ptr, "-5", -5), 0); |
| 41 | EXPECT_THAT(ctx.get_error(), ::testing::HasSubstr("Input length can't be negative")); |
| 42 | ctx.Reset(); |
| 43 | } |
| 44 | |
| 45 | TEST(TestGdvFnStubs, TestCastVarbinaryNumeric) { |
| 46 | gandiva::ExecutionContext ctx; |
nothing calls this directly
no test coverage detected