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

Function DivVerifyUint64Int16_2

Test/DivVerify.cpp:1213–1238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1211};
1212
1213void DivVerifyUint64Int16_2()
1214{
1215 size_t i;
1216
1217 for( i = 0; i < sizeof(int16_uint64_2)/sizeof(int16_uint64_2[0]); ++i )
1218 {
1219 // Now test throwing version
1220 bool fSuccess = true;
1221 try
1222 {
1223 SafeInt<std::int32_t> si(int16_uint64_2[i].x);
1224 SafeInt<std::int32_t> si2;
1225
1226 si2 = int16_uint64_2[i].y / si;
1227 }
1228 catch(...)
1229 {
1230 fSuccess = false;
1231 }
1232
1233 if( fSuccess != int16_uint64_2[i].fExpected )
1234 {
1235 printf("Error in case int16_uint64_2 throw: %X, %I64X, expected = %s\n", int16_uint64_2[i].x, int16_uint64_2[i].y, int16_uint64_2[i].fExpected ? "true" : "false");
1236 }
1237 }
1238}
1239
1240DivTest< std::uint64_t, std::int8_t > uint64_int8[] =
1241{

Callers 1

DivVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected