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

Function TEST

cpp/src/arrow/compute/kernels/scalar_string_test.cc:1333–1350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1331#endif
1332
1333TEST(TestStringKernels, LARGE_MEMORY_TEST(Utf8Upper32bitGrowth)) {
1334 // 0x7fff * 0xffff is the max a 32 bit string array can hold
1335 // since the utf8_upper kernel can grow it by 3/2, the max we should accept is is
1336 // 0x7fff * 0xffff * 2/3 = 0x5555 * 0xffff, so this should give us a CapacityError
1337 std::string str(0x5556 * 0xffff, 'a');
1338 arrow::StringBuilder builder;
1339 ASSERT_OK(builder.Append(str));
1340 std::shared_ptr<arrow::Array> array;
1341 arrow::Status st = builder.Finish(&array);
1342 const FunctionOptions* options = nullptr;
1343 EXPECT_RAISES_WITH_MESSAGE_THAT(CapacityError,
1344 testing::HasSubstr("Result might not fit"),
1345 CallFunction("utf8_upper", {array}, options));
1346 ASSERT_OK_AND_ASSIGN(auto scalar, array->GetScalar(0));
1347 EXPECT_RAISES_WITH_MESSAGE_THAT(CapacityError,
1348 testing::HasSubstr("Result might not fit"),
1349 CallFunction("utf8_upper", {scalar}, options));
1350}
1351
1352TYPED_TEST(TestStringKernels, Utf8Length) {
1353 this->CheckUnary("utf8_length",

Callers

nothing calls this directly

Calls 3

CallFunctionFunction · 0.85
AppendMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected