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

Function DivVerifyInt64Uint32_2

Test/DivVerify.cpp:2371–2396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2369};
2370
2371void DivVerifyInt64Uint32_2()
2372{
2373 size_t i;
2374
2375 for( i = 0; i < sizeof(int64_uint32_2)/sizeof(int64_uint32_2[0]); ++i )
2376 {
2377 // Now test throwing version
2378 bool fSuccess = true;
2379 try
2380 {
2381 SafeInt<std::uint32_t> si(int64_uint32_2[i].y);
2382 SafeInt<std::uint32_t> si2;
2383
2384 si2 = int64_uint32_2[i].x / si;
2385 }
2386 catch(...)
2387 {
2388 fSuccess = false;
2389 }
2390
2391 if( fSuccess != int64_uint32_2[i].fExpected )
2392 {
2393 printf("Error in case int64_uint32_2 throw: %X, %I64X, expected = %s\n", int64_uint32_2[i].x, int64_uint32_2[i].y, int64_uint32_2[i].fExpected ? "true" : "false");
2394 }
2395 }
2396}
2397
2398void DivVerify()
2399{

Callers 1

DivVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected