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

Function DivVerifyUint64Int32_2

Test/DivVerify.cpp:1018–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1016};
1017
1018void DivVerifyUint64Int32_2()
1019{
1020 size_t i;
1021
1022 for( i = 0; i < sizeof(int32_uint64_2)/sizeof(int32_uint64_2[0]); ++i )
1023 {
1024 // Now test throwing version
1025 bool fSuccess = true;
1026 try
1027 {
1028 SafeInt<std::int32_t> si(int32_uint64_2[i].x);
1029 SafeInt<std::int32_t> si2;
1030
1031 si2 = int32_uint64_2[i].y / si;
1032 }
1033 catch(...)
1034 {
1035 fSuccess = false;
1036 }
1037
1038 if( fSuccess != int32_uint64_2[i].fExpected )
1039 {
1040 printf("Error in case int32_uint64_2 throw: %X, %I64X, expected = %s\n", int32_uint64_2[i].x, int32_uint64_2[i].y, int32_uint64_2[i].fExpected ? "true" : "false");
1041 }
1042 }
1043}
1044
1045DivTest< std::uint64_t, std::int16_t > uint64_int16[] =
1046{

Callers 1

DivVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected