| 1331 | #endif |
| 1332 | |
| 1333 | TEST(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 | |
| 1352 | TYPED_TEST(TestStringKernels, Utf8Length) { |
| 1353 | this->CheckUnary("utf8_length", |
nothing calls this directly
no test coverage detected