MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/gandiva/gdv_function_stubs_test.cc:31–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace gandiva {
30
31TEST(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
45TEST(TestGdvFnStubs, TestCastVarbinaryNumeric) {
46 gandiva::ExecutionContext ctx;

Callers

nothing calls this directly

Calls 15

StringToTimestampFunction · 0.85
gdv_fn_substring_indexFunction · 0.85
gdv_fn_upper_utf8Function · 0.85
gdv_fn_lower_utf8Function · 0.85
gdv_fn_initcap_utf8Function · 0.85
translate_utf8_utf8_utf8Function · 0.85

Tested by

no test coverage detected