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

Method TestValidateData

cpp/src/arrow/array/array_binary_test.cc:302–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300 }
301
302 void TestValidateData() {
303 // Valid UTF8
304 ASSERT_OK(ValidateFull(R"(["Voix", "ambiguë", "d’un", "cœur"])"));
305 ASSERT_OK(ValidateFull(R"(["いろはにほへと", "ちりぬるを", "わかよたれそ"])"));
306 ASSERT_OK(ValidateFull(R"(["😀", "😄"])"));
307 ASSERT_OK(ValidateFull(1, {0, 4}, "\xf4\x8f\xbf\xbf")); // \U0010ffff
308
309 // Invalid UTF8
310 auto ty = TypeTraits<T>::type_singleton();
311 auto st1 = ValidateFull(3, {0, 4, 6, 9}, "abc \xff def");
312 // Hypothetical \U00110000
313 auto st2 = ValidateFull(1, {0, 4}, "\xf4\x90\x80\x80");
314 // Single UTF8 character straddles two entries
315 auto st3 = ValidateFull(2, {0, 1, 2}, "\xc3\xa9");
316 if (T::is_utf8) {
317 ASSERT_RAISES(Invalid, st1);
318 ASSERT_RAISES(Invalid, st2);
319 ASSERT_RAISES(Invalid, st3);
320 } else {
321 ASSERT_OK(st1);
322 ASSERT_OK(st2);
323 ASSERT_OK(st3);
324 }
325 }
326
327 protected:
328 std::vector<offset_type> offsets_;

Callers 1

TYPED_TESTFunction · 0.80

Calls 2

ValidateFullFunction · 0.85
type_singletonFunction · 0.50

Tested by

no test coverage detected