| 79 | } |
| 80 | |
| 81 | void TestFloat() |
| 82 | { |
| 83 | CastTest<float> tests[5]; |
| 84 | |
| 85 | InitializeCastArray(tests, _countof(tests)); |
| 86 | |
| 87 | for (unsigned i = 0; i < _countof(tests); ++i) |
| 88 | { |
| 89 | SafeInt<std::uint64_t> test; |
| 90 | bool fSuccess; |
| 91 | |
| 92 | try |
| 93 | { |
| 94 | test = tests[i].x; |
| 95 | fSuccess = true; |
| 96 | } |
| 97 | catch (...) |
| 98 | { |
| 99 | fSuccess = false; |
| 100 | } |
| 101 | |
| 102 | if (fSuccess != tests[i].fExpected) |
| 103 | cerr << "Error in cast float to std::uint64_t case " << i << endl; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | void CastVerify() |
| 108 | { |
nothing calls this directly
no test coverage detected