| 913 | } |
| 914 | |
| 915 | static 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 | |
| 934 | TEST(TestLogicalTypeConstruction, FactoryEquivalence) { |
| 935 | // For each legacy converted type, ensure that the equivalent logical type object |