MCPcopy Create free account
hub / github.com/MikeLankamp/fpm / TEST

Function TEST

tests/nearest.cpp:4–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <fpm/math.hpp>
3
4TEST(nearest, round)
5{
6 using P = fpm::fixed_24_8;
7
8 EXPECT_EQ(P( 2), round(P( 2.3)));
9 EXPECT_EQ(P( 3), round(P( 2.5)));
10 EXPECT_EQ(P( 3), round(P( 2.7)));
11 EXPECT_EQ(P(-2), round(P(-2.3)));
12 EXPECT_EQ(P(-3), round(P(-2.5)));
13 EXPECT_EQ(P(-3), round(P(-2.7)));
14 EXPECT_EQ(P( 0), round(P( 0)));
15}
16
17TEST(nearest, ceil)
18{

Callers

nothing calls this directly

Calls 6

roundFunction · 0.85
ceilFunction · 0.85
floorFunction · 0.85
truncFunction · 0.85
nearbyintFunction · 0.85
rintFunction · 0.85

Tested by

no test coverage detected