MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / test_limits

Function test_limits

test/float_equal.cpp:95–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94template <class T, class U>
95static void test_limits()
96{
97 auto max1 = std::numeric_limits<T>::max();
98 auto max2 = std::numeric_limits<U>::max();
99
100 auto min1 = std::numeric_limits<T>::lowest();
101 auto min2 = std::numeric_limits<U>::lowest();
102
103 EXPECT(test_float_equal(max1, max1));
104 EXPECT(test_float_equal(max2, max2));
105
106 EXPECT(not test_float_equal(max1, max2));
107 EXPECT(not test_float_equal(max2, max1));
108
109 EXPECT(test_float_equal(min1, min1));
110 EXPECT(test_float_equal(min2, min2));
111
112 EXPECT(not test_float_equal(min1, min2));
113 EXPECT(not test_float_equal(min2, min1));
114
115 EXPECT(not test_float_equal(max1, min1));
116 EXPECT(not test_float_equal(min1, max1));
117 EXPECT(not test_float_equal(max2, min2));
118 EXPECT(not test_float_equal(min2, max2));
119
120 EXPECT(not test_float_equal(max1, min2));
121 EXPECT(not test_float_equal(min2, max1));
122
123 EXPECT(not test_float_equal(max2, min1));
124 EXPECT(not test_float_equal(min1, max2));
125}
126
127TEST_CASE_REGISTER(test_limits<double, float>);
128TEST_CASE_REGISTER(test_limits<double, int>);

Callers

nothing calls this directly

Calls 3

test_float_equalFunction · 0.85
maxClass · 0.50
lowestClass · 0.50

Tested by

no test coverage detected