17
17
18
18
#include < sstream>
19
19
20
+ #include < gmock/gmock-matchers.h>
20
21
#include < gtest/gtest.h>
21
22
#include " arrow/memory_pool.h"
22
23
#include " arrow/status.h"
@@ -1247,8 +1248,8 @@ TEST_F(TestDecimal, TestCastDecimalVarCharInvalidInputInvalidOutput) {
1247
1248
auto schema = arrow::schema ({field_str});
1248
1249
auto res_bool = field (" res_bool" , arrow::boolean ());
1249
1250
1250
- auto int_literal = TreeExprBuilder::MakeLiteral (( int32_t ) 100 );
1251
- auto int_literal_multiply = TreeExprBuilder::MakeLiteral (( int32_t ) 10 );
1251
+ auto int_literal = TreeExprBuilder::MakeLiteral (static_cast < int32_t >( 100 ) );
1252
+ auto int_literal_multiply = TreeExprBuilder::MakeLiteral (static_cast < int32_t >( 10 ) );
1252
1253
auto string_literal = TreeExprBuilder::MakeStringLiteral (" foo" );
1253
1254
auto cast_multiply_literal =
1254
1255
TreeExprBuilder::MakeFunction (" castDECIMAL" , {int_literal_multiply}, decimal_type_10_0);
@@ -1268,11 +1269,11 @@ TEST_F(TestDecimal, TestCastDecimalVarCharInvalidInputInvalidOutput) {
1268
1269
1269
1270
int num_records = 1 ;
1270
1271
auto invalid_in = MakeArrowArrayUtf8 ({" 1.345" }, {true });
1271
- auto in_batch_1 = arrow::RecordBatch::Make (schema, num_records, {invalid_in});
1272
+ auto in_batch = arrow::RecordBatch::Make (schema, num_records, {invalid_in});
1272
1273
1273
- arrow::ArrayVector outputs_1 ;
1274
- status = projector->Evaluate (*in_batch_1 , pool_, &outputs_1 );
1275
- EXPECT_FALSE (status. ok ()) << status. message ( );
1276
- EXPECT_NE (status.message (). find (" not a valid decimal128 number" ), std::string::npos );
1274
+ arrow::ArrayVector outputs ;
1275
+ status = projector->Evaluate (*in_batch , pool_, &outputs );
1276
+ ASSERT_OK (status);
1277
+ ASSERT_THAT (status.message (), :: testing::HasSubstr (" not a valid decimal128 number" ));
1277
1278
}
1278
1279
} // namespace gandiva
0 commit comments