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

Method DoTest

cpp/src/arrow/compute/exec_test.cc:1185–1203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1183};
1184
1185void TestCallScalarFunctionArgumentValidation::DoTest(FunctionCallerMaker caller_maker) {
1186 ASSERT_OK_AND_ASSIGN(auto test_copy, caller_maker("test_copy", {int32()}));
1187
1188 // Copy accepts only a single array argument
1189 Datum d1(GetInt32Array(10));
1190
1191 // Too many args
1192 std::vector<Datum> args = {d1, d1};
1193 ASSERT_RAISES(Invalid, test_copy->Call(args));
1194
1195 // Too few
1196 args = {};
1197 ASSERT_RAISES(Invalid, test_copy->Call(args));
1198
1199 // Cannot do scalar
1200 Datum d1_scalar(std::make_shared<Int32Scalar>(5));
1201 ASSERT_OK_AND_ASSIGN(auto result, test_copy->Call({d1}));
1202 ASSERT_OK_AND_ASSIGN(result, test_copy->Call({d1_scalar}));
1203}
1204
1205TEST_F(TestCallScalarFunctionArgumentValidation, SimpleCall) {
1206 TestCallScalarFunctionArgumentValidation::DoTest(SimpleFunctionCaller::Maker);

Callers

nothing calls this directly

Calls 10

AssertArraysEqualFunction · 0.85
AssertChunkedEquivalentFunction · 0.85
make_arrayMethod · 0.80
chunked_arrayMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70
DatumClass · 0.70
CallMethod · 0.45
kindMethod · 0.45
SliceMethod · 0.45
num_chunksMethod · 0.45

Tested by

no test coverage detected