MCPcopy Create free account
hub / github.com/dcleblanc/SafeInt / TestFloat

Function TestFloat

Test/CastVerify.cpp:81–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 1

InitializeCastArrayFunction · 0.85

Tested by

no test coverage detected