diff options
| author | lntue <35648136+lntue@users.noreply.github.com> | 2023-10-19 10:30:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-19 10:30:11 -0400 |
| commit | 3fd5113cbac9ccb68ca52115f23074f2feb22ac4 (patch) | |
| tree | 74fa066a20f63271139e691fd7b6c739ec7d8a26 /libc/test/src/math/tanf_test.cpp | |
| parent | 6959332804579b0e9273c89ecb2d2cdbaa73d04d (diff) | |
[libc][math][NFC] Remove global scope constants declaration in math tests (#69558)
Clean up usage of `DECLARE_SPECIAL_CONSTANTS` in global scope.
Diffstat (limited to 'libc/test/src/math/tanf_test.cpp')
| -rw-r--r-- | libc/test/src/math/tanf_test.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libc/test/src/math/tanf_test.cpp b/libc/test/src/math/tanf_test.cpp index 3c3694a5eb68..6005202e754b 100644 --- a/libc/test/src/math/tanf_test.cpp +++ b/libc/test/src/math/tanf_test.cpp @@ -18,14 +18,13 @@ #include <errno.h> #include <stdint.h> +using LlvmLibcTanfTest = LIBC_NAMESPACE::testing::FPTest<float>; + using LIBC_NAMESPACE::testing::SDCOMP26094_VALUES; -using FPBits = LIBC_NAMESPACE::fputil::FPBits<float>; namespace mpfr = LIBC_NAMESPACE::testing::mpfr; -DECLARE_SPECIAL_CONSTANTS(float) - -TEST(LlvmLibcTanfTest, SpecialNumbers) { +TEST_F(LlvmLibcTanfTest, SpecialNumbers) { libc_errno = 0; EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::tanf(aNaN)); @@ -44,7 +43,7 @@ TEST(LlvmLibcTanfTest, SpecialNumbers) { EXPECT_MATH_ERRNO(EDOM); } -TEST(LlvmLibcTanfTest, InFloatRange) { +TEST_F(LlvmLibcTanfTest, InFloatRange) { constexpr uint32_t COUNT = 100'000; constexpr uint32_t STEP = UINT32_MAX / COUNT; for (uint32_t i = 0, v = 0; i <= COUNT; ++i, v += STEP) { @@ -56,7 +55,7 @@ TEST(LlvmLibcTanfTest, InFloatRange) { } } -TEST(LlvmLibcTanfTest, SpecificBitPatterns) { +TEST_F(LlvmLibcTanfTest, SpecificBitPatterns) { constexpr int N = 54; constexpr uint32_t INPUTS[N] = { 0x3a7a'8d2fU, // x = 0x1.f51a5ep-11f @@ -126,7 +125,7 @@ TEST(LlvmLibcTanfTest, SpecificBitPatterns) { // SDCOMP-26094: check tanf in the cases for which the range reducer // returns values furthest beyond its nominal upper bound of pi/4. -TEST(LlvmLibcTanfTest, SDCOMP_26094) { +TEST_F(LlvmLibcTanfTest, SDCOMP_26094) { for (uint32_t v : SDCOMP26094_VALUES) { float x = float(FPBits(v)); ASSERT_MPFR_MATCH(mpfr::Operation::Tan, x, LIBC_NAMESPACE::tanf(x), 0.5); |
