mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 06:10:12 +00:00
[libc][NFC] Use ASSERT_FP_EQ to comapre NaN values in tests.
This commit is contained in:
parent
eb66bf0802
commit
0524da67b4
@ -44,7 +44,7 @@ public:
|
||||
ASSERT_FP_EQ(negZero, func(negZero, exp));
|
||||
ASSERT_FP_EQ(inf, func(inf, exp));
|
||||
ASSERT_FP_EQ(negInf, func(negInf, exp));
|
||||
ASSERT_NE(isnan(func(nan, exp)), 0);
|
||||
ASSERT_FP_EQ(nan, func(nan, exp));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,8 +26,7 @@ TEST(CeilTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::ceil(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::ceil(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::ceil(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::ceil(aNaN));
|
||||
}
|
||||
|
||||
TEST(CeilTest, RoundedNumbers) {
|
||||
|
@ -26,8 +26,7 @@ TEST(CeilfTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::ceilf(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::ceilf(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::ceilf(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::ceilf(aNaN));
|
||||
}
|
||||
|
||||
TEST(CeilfTest, RoundedNumbers) {
|
||||
|
@ -26,8 +26,7 @@ TEST(CeillTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::ceill(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::ceill(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::ceill(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::ceill(aNaN));
|
||||
}
|
||||
|
||||
TEST(CeillTest, RoundedNumbers) {
|
||||
|
@ -26,8 +26,7 @@ TEST(FloorTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::floor(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::floor(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::floor(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::floor(aNaN));
|
||||
}
|
||||
|
||||
TEST(FloorTest, RoundedNumbers) {
|
||||
|
@ -26,8 +26,7 @@ TEST(FloorfTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::floorf(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::floorf(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::floorf(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::floorf(aNaN));
|
||||
}
|
||||
|
||||
TEST(FloorfTest, RoundedNumbers) {
|
||||
|
@ -26,8 +26,7 @@ TEST(FloorlTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::floorl(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::floorl(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::floorl(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::floorl(aNaN));
|
||||
}
|
||||
|
||||
TEST(FloorlTest, RoundedNumbers) {
|
||||
|
@ -26,8 +26,7 @@ TEST(RoundTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::round(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::round(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::round(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::round(aNaN));
|
||||
}
|
||||
|
||||
TEST(RoundTest, RoundedNumbers) {
|
||||
|
@ -26,8 +26,7 @@ TEST(RoundfTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::roundf(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::roundf(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::roundf(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::roundf(aNaN));
|
||||
}
|
||||
|
||||
TEST(RoundfTest, RoundedNumbers) {
|
||||
|
@ -26,8 +26,7 @@ TEST(RoundlTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::roundl(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::roundl(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::roundl(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::roundl(aNaN));
|
||||
}
|
||||
|
||||
TEST(RoundlTest, RoundedNumbers) {
|
||||
|
@ -26,8 +26,7 @@ TEST(TruncTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::trunc(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::trunc(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::trunc(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::trunc(aNaN));
|
||||
}
|
||||
|
||||
TEST(TruncTest, RoundedNumbers) {
|
||||
|
@ -26,8 +26,7 @@ TEST(TruncfTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::truncf(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::truncf(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::truncf(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::truncf(aNaN));
|
||||
}
|
||||
|
||||
TEST(TruncfTest, RoundedNumbers) {
|
||||
|
@ -26,8 +26,7 @@ TEST(TrunclTest, SpecialNumbers) {
|
||||
EXPECT_FP_EQ(inf, __llvm_libc::truncl(inf));
|
||||
EXPECT_FP_EQ(negInf, __llvm_libc::truncl(negInf));
|
||||
|
||||
ASSERT_NE(isnan(aNaN), 0);
|
||||
ASSERT_NE(isnan(__llvm_libc::truncl(aNaN)), 0);
|
||||
EXPECT_FP_EQ(aNaN, __llvm_libc::truncl(aNaN));
|
||||
}
|
||||
|
||||
TEST(TrunclTest, RoundedNumbers) {
|
||||
|
Loading…
Reference in New Issue
Block a user