diff options
author | Dino Radakovic <dinor@google.com> | 2024-04-24 10:58:25 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-04-24 10:59:22 -0700 |
commit | c3b4f2950a803109f52d455bffcef3681dbe522d (patch) | |
tree | dd0cd29512574e9a00d9e181f702357587fffaeb /absl/strings/internal/str_format | |
parent | e022c806b07c661932967a2680e32cafdf572895 (diff) |
`convert_test`: Delete obsolete `skip_verify` parameter in test helper
It is unused.
We already use code within the `TestWithMultipleFormatsHelper` to skip output verification for Apple and MSVC.
PiperOrigin-RevId: 627783586
Change-Id: Ib51374e8571aa5f4b5f1e836815188bd9bdc1536
Diffstat (limited to 'absl/strings/internal/str_format')
-rw-r--r-- | absl/strings/internal/str_format/convert_test.cc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/absl/strings/internal/str_format/convert_test.cc b/absl/strings/internal/str_format/convert_test.cc index 3e761373..17c3607d 100644 --- a/absl/strings/internal/str_format/convert_test.cc +++ b/absl/strings/internal/str_format/convert_test.cc @@ -785,8 +785,7 @@ TEST_F(FormatConvertTest, Uint128) { } template <typename Floating> -void TestWithMultipleFormatsHelper(const std::vector<Floating> &floats, - const std::set<Floating> &skip_verify) { +void TestWithMultipleFormatsHelper(const std::vector<Floating> &floats) { const NativePrintfTraits &native_traits = VerifyNativeImplementation(); // Reserve the space to ensure we don't allocate memory in the output itself. std::string str_format_result; @@ -834,6 +833,9 @@ void TestWithMultipleFormatsHelper(const std::vector<Floating> &floats, AppendPack(&str_format_result, format, absl::MakeSpan(args)); } + // For values that we know won't match the standard library + // implementation we skip verification, but still run the algorithm to + // catch asserts/sanitizer bugs. #ifdef _MSC_VER // MSVC has a different rounding policy than us so we can't test our // implementation against the native one there. @@ -842,8 +844,7 @@ void TestWithMultipleFormatsHelper(const std::vector<Floating> &floats, // Apple formats NaN differently (+nan) vs. (nan) if (std::isnan(d)) continue; #endif - if (string_printf_result != str_format_result && - skip_verify.find(d) == skip_verify.end()) { + if (string_printf_result != str_format_result) { // We use ASSERT_EQ here because failures are usually correlated and a // bug would print way too many failed expectations causing the test // to time out. @@ -904,14 +905,10 @@ TEST_F(FormatConvertTest, Float) { }); floats.erase(std::unique(floats.begin(), floats.end()), floats.end()); - TestWithMultipleFormatsHelper(floats, {}); + TestWithMultipleFormatsHelper(floats); } TEST_F(FormatConvertTest, Double) { - // For values that we know won't match the standard library implementation we - // skip verification, but still run the algorithm to catch asserts/sanitizer - // bugs. - std::set<double> skip_verify; std::vector<double> doubles = {0.0, -0.0, .99999999999999, @@ -959,7 +956,7 @@ TEST_F(FormatConvertTest, Double) { }); doubles.erase(std::unique(doubles.begin(), doubles.end()), doubles.end()); - TestWithMultipleFormatsHelper(doubles, skip_verify); + TestWithMultipleFormatsHelper(doubles); } TEST_F(FormatConvertTest, DoubleRound) { |