Skip to content

Commit

Permalink
Updated ceil_test.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Icosa-dev committed Apr 22, 2024
1 parent e4d66cf commit 7ddc4a7
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions test/nearest/ceil_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,44 +50,44 @@ TEST(CcmathNearestTests, Ceil)

// Test with float using std::ceilf and ccm::ceilf
static_assert(ccm::ceilf(1.0f) == ccm::ceilf(1.0f), "ccm::ceilf not static_assertable");
EXPECT_EQ(ccm::ceilf(1.0f), std::ceilf(1.0f));
EXPECT_EQ(ccm::ceilf(1.5f), std::ceilf(1.5f));
EXPECT_EQ(ccm::ceilf(1.9f), std::ceilf(1.9f));
EXPECT_EQ(ccm::ceilf(-1.0f), std::ceilf(-1.0f));
EXPECT_EQ(ccm::ceilf(-1.5f), std::ceilf(-1.5f));
EXPECT_EQ(ccm::ceilf(-1.9f), std::ceilf(-1.9f));
EXPECT_EQ(ccm::ceilf(std::numeric_limits<float>::infinity()), std::ceilf(std::numeric_limits<float>::infinity()));
EXPECT_EQ(ccm::ceilf(-std::numeric_limits<float>::infinity()), std::ceilf(-std::numeric_limits<float>::infinity()));
EXPECT_TRUE(std::isnan(ccm::ceilf(std::nanf(""))));
EXPECT_TRUE(std::isnan(ccm::ceilf(-std::nanf(""))));
EXPECT_EQ(ccm::ceilf(0.0f), std::ceilf(0.0f));
EXPECT_EQ(ccm::ceilf(-0.0f), std::ceilf(-0.0f));
EXPECT_EQ(ccm::ceilf(0.5f), std::ceilf(0.5f));
EXPECT_EQ(ccm::ceilf(-0.5f), std::ceilf(-0.5f));
EXPECT_EQ(ccm::ceilf(0.9f), std::ceilf(0.9f));
EXPECT_EQ(ccm::ceilf(-0.9f), std::ceilf(-0.9f));
EXPECT_EQ(ccm::ceilf(0.9999999999999999f), std::ceilf(0.9999999999999999f));
EXPECT_EQ(ccm::ceilf(-0.9999999999999999f), std::ceilf(-0.9999999999999999f));
EXPECT_EQ(ccm::ceilf(30.508474576271183309f), std::ceilf(30.508474576271183309f));
EXPECT_EQ(ccm::ceilf(1.0f), std::ceil(1.0f));
EXPECT_EQ(ccm::ceilf(1.5f), std::ceil(1.5f));
EXPECT_EQ(ccm::ceilf(1.9f), std::ceil(1.9f));
EXPECT_EQ(ccm::ceilf(-1.0f), std::ceil(-1.0f));
EXPECT_EQ(ccm::ceilf(-1.5f), std::ceil(-1.5f));
EXPECT_EQ(ccm::ceilf(-1.9f), std::ceil(-1.9f));
EXPECT_EQ(ccm::ceilf(std::numeric_limits<float>::infinity()), std::ceil(std::numeric_limits<float>::infinity()));
EXPECT_EQ(ccm::ceilf(-std::numeric_limits<float>::infinity()), std::ceil(-std::numeric_limits<float>::infinity()));
EXPECT_TRUE(std::isnan(ccm::ceil(std::nanf(""))));
EXPECT_TRUE(std::isnan(ccm::ceil(-std::nanf(""))));
EXPECT_EQ(ccm::ceilf(0.0f), std::ceil(0.0f));
EXPECT_EQ(ccm::ceilf(-0.0f), std::ceil(-0.0f));
EXPECT_EQ(ccm::ceilf(0.5f), std::ceil(0.5f));
EXPECT_EQ(ccm::ceilf(-0.5f), std::ceil(-0.5f));
EXPECT_EQ(ccm::ceilf(0.9f), std::ceil(0.9f));
EXPECT_EQ(ccm::ceilf(-0.9f), std::ceil(-0.9f));
EXPECT_EQ(ccm::ceilf(0.9999999999999999f), std::ceil(0.9999999999999999f));
EXPECT_EQ(ccm::ceilf(-0.9999999999999999f), std::ceil(-0.9999999999999999f));
EXPECT_EQ(ccm::ceilf(30.508474576271183309f), std::ceil(30.508474576271183309f));

// Test with long double using std::ceill and ccm::ceill
static_assert(ccm::ceill(1.0) == ccm::ceill(1.0), "ccm::ceill not static_assertable");
EXPECT_EQ(ccm::ceill(1.0), std::ceill(1.0));
EXPECT_EQ(ccm::ceill(1.5), std::ceill(1.5));
EXPECT_EQ(ccm::ceill(1.9), std::ceill(1.9));
EXPECT_EQ(ccm::ceill(-1.0), std::ceill(-1.0));
EXPECT_EQ(ccm::ceill(-1.5), std::ceill(-1.5));
EXPECT_EQ(ccm::ceill(-1.9), std::ceill(-1.9));
EXPECT_EQ(ccm::ceill(std::numeric_limits<long double>::infinity()), std::ceill(std::numeric_limits<long double>::infinity()));
EXPECT_EQ(ccm::ceill(-std::numeric_limits<long double>::infinity()), std::ceill(-std::numeric_limits<long double>::infinity()));
EXPECT_EQ(ccm::ceill(1.0), std::ceil(1.0));
EXPECT_EQ(ccm::ceill(1.5), std::ceil(1.5));
EXPECT_EQ(ccm::ceill(1.9), std::ceil(1.9));
EXPECT_EQ(ccm::ceill(-1.0), std::ceil(-1.0));
EXPECT_EQ(ccm::ceill(-1.5), std::ceil(-1.5));
EXPECT_EQ(ccm::ceill(-1.9), std::ceil(-1.9));
EXPECT_EQ(ccm::ceill(std::numeric_limits<long double>::infinity()), std::ceil(std::numeric_limits<long double>::infinity()));
EXPECT_EQ(ccm::ceill(-std::numeric_limits<long double>::infinity()), std::ceil(-std::numeric_limits<long double>::infinity()));
EXPECT_TRUE(std::isnan(ccm::ceill(std::nanl(""))));
EXPECT_TRUE(std::isnan(ccm::ceill(-std::nanl(""))));
EXPECT_EQ(ccm::ceill(0.0), std::ceill(0.0));
EXPECT_EQ(ccm::ceill(-0.0), std::ceill(-0.0));
EXPECT_EQ(ccm::ceill(0.5), std::ceill(0.5));
EXPECT_EQ(ccm::ceill(-0.5), std::ceill(-0.5));
EXPECT_EQ(ccm::ceill(0.9), std::ceill(0.9));
EXPECT_EQ(ccm::ceill(-0.9), std::ceill(-0.9));
EXPECT_EQ(ccm::ceill(0.9999999999999999), std::ceill(0.9999999999999999));
EXPECT_EQ(ccm::ceill(-0.9999999999999999), std::ceill(-0.9999999999999999));
EXPECT_EQ(ccm::ceill(0.0), std::ceil(0.0));
EXPECT_EQ(ccm::ceill(-0.0), std::ceil(-0.0));
EXPECT_EQ(ccm::ceill(0.5), std::ceil(0.5));
EXPECT_EQ(ccm::ceill(-0.5), std::ceil(-0.5));
EXPECT_EQ(ccm::ceill(0.9), std::ceil(0.9));
EXPECT_EQ(ccm::ceill(-0.9), std::ceil(-0.9));
EXPECT_EQ(ccm::ceill(0.9999999999999999), std::ceil(0.9999999999999999));
EXPECT_EQ(ccm::ceill(-0.9999999999999999), std::ceil(-0.9999999999999999));
}

0 comments on commit 7ddc4a7

Please sign in to comment.