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

Function ConfirmFactoryEquivalence

cpp/src/parquet/schema_test.cc:915–932  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

913}
914
915static void ConfirmFactoryEquivalence(
916 ConvertedType::type converted_type,
917 const std::shared_ptr<const LogicalType>& from_make,
918 std::function<bool(const std::shared_ptr<const LogicalType>&)> check_is_type) {
919 std::shared_ptr<const LogicalType> from_converted_type =
920 LogicalType::FromConvertedType(converted_type);
921 ASSERT_EQ(from_converted_type->type(), from_make->type())
922 << from_make->ToString() << " logical types unexpectedly do not match on type";
923 ASSERT_TRUE(from_converted_type->Equals(*from_make))
924 << from_make->ToString() << " logical types unexpectedly not equivalent";
925 ASSERT_TRUE(check_is_type(from_converted_type))
926 << from_converted_type->ToString()
927 << " logical type (from converted type) does not have expected type property";
928 ASSERT_TRUE(check_is_type(from_make))
929 << from_make->ToString()
930 << " logical type (from Make()) does not have expected type property";
931 return;
932}
933
934TEST(TestLogicalTypeConstruction, FactoryEquivalence) {
935 // For each legacy converted type, ensure that the equivalent logical type object

Callers 1

TESTFunction · 0.85

Calls 3

typeMethod · 0.45
ToStringMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected