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

Function TestDouble

Test/CastVerify.cpp:55–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

CastVerifyFunction · 0.85

Calls 1

InitializeCastArrayFunction · 0.85

Tested by

no test coverage detected