diff --git a/cpp/src/arrow/ipc/json_simple_test.cc b/cpp/src/arrow/ipc/json_simple_test.cc index b3f7fc5b3458b..c6f14b1e1d50e 100644 --- a/cpp/src/arrow/ipc/json_simple_test.cc +++ b/cpp/src/arrow/ipc/json_simple_test.cc @@ -189,21 +189,6 @@ class TestIntegers : public ::testing::Test { TYPED_TEST_SUITE_P(TestIntegers); -template -std::vector TestIntegersMutateIfNeeded( - std::vector data) { - return data; -} - -// TODO: This works, but is it the right way to do this? -template <> -std::vector TestIntegersMutateIfNeeded( - std::vector data) { - std::for_each(data.begin(), data.end(), - [](HalfFloatType::c_type& value) { value = Float16(value).bits(); }); - return data; -} - TYPED_TEST_P(TestIntegers, Basics) { using T = TypeParam; using c_type = typename T::c_type; @@ -212,17 +197,16 @@ TYPED_TEST_P(TestIntegers, Basics) { auto type = this->type(); AssertJSONArray(type, "[]", {}); - AssertJSONArray(type, "[4, 0, 5]", TestIntegersMutateIfNeeded({4, 0, 5})); - AssertJSONArray(type, "[4, null, 5]", {true, false, true}, - TestIntegersMutateIfNeeded({4, 0, 5})); + AssertJSONArray(type, "[4, 0, 5]", {4, 0, 5}); + AssertJSONArray(type, "[4, null, 5]", {true, false, true}, {4, 0, 5}); // Test limits const auto min_val = std::numeric_limits::min(); const auto max_val = std::numeric_limits::max(); std::string json_string = JSONArray(0, 1, min_val); - AssertJSONArray(type, json_string, TestIntegersMutateIfNeeded({0, 1, min_val})); + AssertJSONArray(type, json_string, {0, 1, min_val}); json_string = JSONArray(0, 1, max_val); - AssertJSONArray(type, json_string, TestIntegersMutateIfNeeded({0, 1, max_val})); + AssertJSONArray(type, json_string, {0, 1, max_val}); } TYPED_TEST_P(TestIntegers, Errors) { @@ -289,12 +273,6 @@ INSTANTIATE_TYPED_TEST_SUITE_P(TestUInt8, TestIntegers, UInt8Type); INSTANTIATE_TYPED_TEST_SUITE_P(TestUInt16, TestIntegers, UInt16Type); INSTANTIATE_TYPED_TEST_SUITE_P(TestUInt32, TestIntegers, UInt32Type); INSTANTIATE_TYPED_TEST_SUITE_P(TestUInt64, TestIntegers, UInt64Type); -// FIXME: I understand that HalfFloatType is backed by a uint16_t, but does it -// make sense to run this test over it? -// The way ConvertNumber for HalfFloatType is currently written, it allows the -// conversion of floating point notation to a half float, which causes failures -// in this test, one example is asserting 0.0 cannot be parsed as a half float. -// INSTANTIATE_TYPED_TEST_SUITE_P(TestHalfFloat, TestIntegers, HalfFloatType); template class TestStrings : public ::testing::Test {