4040#include " arrow/type_traits.h"
4141#include " arrow/util/checked_cast.h"
4242#include " arrow/util/key_value_metadata.h"
43- #include " arrow/util/logging.h"
4443
4544namespace arrow {
4645
@@ -55,20 +54,15 @@ TEST(TestTypeId, AllTypeIds) {
5554TEST (TestTypeSingleton, ParameterFreeTypes) {
5655 // Test successful cases - parameter-free types (sample a few)
5756 std::vector<std::pair<Type::type, std::shared_ptr<DataType>>> cases = {
58- {Type::NA , null ()},
59- {Type::BOOL , boolean ()},
60- {Type::INT32 , int32 ()},
61- {Type::STRING , utf8 ()},
62- {Type::DATE32 , date32 ()},
57+ {Type::NA , null ()}, {Type::BOOL , boolean ()}, {Type::INT32 , int32 ()},
58+ {Type::STRING , utf8 ()}, {Type::DATE32 , date32 ()},
6359 };
6460
6561 for (const auto & test_case : cases) {
66- SCOPED_TRACE (" Testing type: " + std::to_string ( static_cast < int >( test_case.first ) ));
62+ ARROW_SCOPED_TRACE (" Testing type: " , internal::ToString ( test_case.first ));
6763 auto result = type_singleton (test_case.first );
6864 ASSERT_OK_AND_ASSIGN (auto type, result);
69- ASSERT_TRUE (type->Equals (*test_case.second ))
70- << " Failed on type " << test_case.first << " . Expected "
71- << test_case.second ->ToString () << " but got " << type->ToString ();
65+ AssertTypeEqual (*type, *test_case.second );
7266 }
7367}
7468
@@ -77,14 +71,7 @@ TEST(TestTypeSingleton, ParameterizedTypes) {
7771 auto result = type_singleton (Type::TIMESTAMP );
7872 ASSERT_RAISES (TypeError, result);
7973 EXPECT_THAT (result.status ().message (),
80- testing::HasSubstr (" is not a parameter-free singleton type" ));
81- }
82-
83- TEST (TestTypeSingleton, InvalidType) {
84- // Test with an invalid type ID
85- auto result = type_singleton (static_cast <Type::type>(9999 ));
86- ASSERT_FALSE (result.ok ());
87- EXPECT_TRUE (result.status ().IsTypeError ());
74+ testing::HasSubstr (" is not a parameter-free type" ));
8875}
8976
9077template <typename ReprFunc>
0 commit comments