| 53 | } |
| 54 | |
| 55 | void TestDouble() |
| 56 | { |
| 57 | CastTest<double> tests[5]; |
| 58 | |
| 59 | InitializeCastArray(tests, _countof(tests)); |
| 60 | |
| 61 | for (unsigned i = 0; i < _countof(tests); ++i) |
| 62 | { |
| 63 | SafeInt<std::uint64_t> test; |
| 64 | bool fSuccess; |
| 65 | |
| 66 | try |
| 67 | { |
| 68 | test = tests[i].x; |
| 69 | fSuccess = true; |
| 70 | } |
| 71 | catch (...) |
| 72 | { |
| 73 | fSuccess = false; |
| 74 | } |
| 75 | |
| 76 | if(fSuccess != tests[i].fExpected) |
| 77 | cerr << "Error in cast double to std::uint64_t case " << i << endl; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | void TestFloat() |
| 82 | { |
no test coverage detected