| 93 | |
| 94 | template <class T, class U> |
| 95 | static 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 | |
| 127 | TEST_CASE_REGISTER(test_limits<double, float>); |
| 128 | TEST_CASE_REGISTER(test_limits<double, int>); |
nothing calls this directly
no test coverage detected