2424#include " arrow/flight/test_flight_server.h"
2525#include " arrow/flight/test_util.h"
2626
27+ #include < gmock/gmock.h>
2728#include < gtest/gtest.h>
2829
2930namespace arrow ::flight::sql::odbc {
@@ -92,17 +93,6 @@ FlightInfo MultipleEndpointsFlightInfo(Location location1, Location location2) {
9293 100000 , false , " " );
9394}
9495
95- void VerifyArraysContainIntsOnly (std::shared_ptr<Array> intArray) {
96- for (int64_t i = 0 ; i < intArray->length (); ++i) {
97- // null values are accepted
98- if (!intArray->IsNull (i)) {
99- auto scalar_data = intArray->GetScalar (i).ValueOrDie ();
100- std::string scalar_str = ConvertToJson (*scalar_data);
101- ASSERT_TRUE (std::all_of (scalar_str.begin (), scalar_str.end (), ::isdigit));
102- }
103- }
104- }
105-
10696TEST_F (FlightStreamChunkBufferTest, TestMultipleEndpointsInt) {
10797 FlightClientOptions client_options = FlightClientOptions::Defaults ();
10898 FlightCallOptions options;
@@ -127,7 +117,10 @@ TEST_F(FlightStreamChunkBufferTest, TestMultipleEndpointsInt) {
127117 // Each array has random length
128118 ASSERT_GT (array->length (), 0 );
129119
130- VerifyArraysContainIntsOnly (array);
120+ std::vector<int > int_types = {
121+ Type::type::INT8, Type::type::UINT8, Type::type::INT16, Type::type::UINT16,
122+ Type::type::INT32, Type::type::UINT32, Type::type::INT64, Type::type::UINT64};
123+ ASSERT_THAT (int_types, testing::Contains (array->type_id ()));
131124 }
132125 }
133126
0 commit comments