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

Function DivVerifyInt64Uint64_2

Test/DivVerify.cpp:2154–2179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2152};
2153
2154void DivVerifyInt64Uint64_2()
2155{
2156 size_t i;
2157
2158 for( i = 0; i < sizeof(int64_uint64_3)/sizeof(int64_uint64_3[0]); ++i )
2159 {
2160 // Now test throwing version
2161 bool fSuccess = true;
2162 try
2163 {
2164 SafeInt<std::uint64_t> si(int64_uint64_3[i].y);
2165 SafeInt<std::uint64_t> si2;
2166
2167 si2 = int64_uint64_3[i].x / si;
2168 }
2169 catch(...)
2170 {
2171 fSuccess = false;
2172 }
2173
2174 if( fSuccess != int64_uint64_3[i].fExpected )
2175 {
2176 printf("Error in case int64_uint64_3 throw: %X, %I64X, expected = %s\n", int64_uint64_3[i].x, int64_uint64_3[i].y, int64_uint64_3[i].fExpected ? "true" : "false");
2177 }
2178 }
2179}
2180
2181DivTest< std::int64_t, std::uint32_t > int64_uint32[] =
2182{

Callers 1

DivVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected