Skip to content

Commit b7fc373

Browse files
committed
Fixed PR comments
1 parent 393a3d1 commit b7fc373

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cpp/src/gandiva/tests/decimal_test.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include <sstream>
1919

20+
#include <gmock/gmock-matchers.h>
2021
#include <gtest/gtest.h>
2122
#include "arrow/memory_pool.h"
2223
#include "arrow/status.h"
@@ -1247,8 +1248,8 @@ TEST_F(TestDecimal, TestCastDecimalVarCharInvalidInputInvalidOutput) {
12471248
auto schema = arrow::schema({field_str});
12481249
auto res_bool = field("res_bool", arrow::boolean());
12491250

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));
12521253
auto string_literal = TreeExprBuilder::MakeStringLiteral("foo");
12531254
auto cast_multiply_literal =
12541255
TreeExprBuilder::MakeFunction("castDECIMAL", {int_literal_multiply}, decimal_type_10_0);
@@ -1268,11 +1269,11 @@ TEST_F(TestDecimal, TestCastDecimalVarCharInvalidInputInvalidOutput) {
12681269

12691270
int num_records = 1;
12701271
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});
12721273

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"));
12771278
}
12781279
} // namespace gandiva

0 commit comments

Comments
 (0)