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

Function DivVerifyUint64Int64_2

Test/DivVerify.cpp:801–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

799};
800
801void DivVerifyUint64Int64_2()
802{
803 size_t i;
804
805 for( i = 0; i < sizeof(int64_uint64_2)/sizeof(int64_uint64_2[0]); ++i )
806 {
807 // Now test throwing version
808 bool fSuccess = true;
809 try
810 {
811 SafeInt<std::int64_t> si(int64_uint64_2[i].x);
812 SafeInt<std::int64_t> si2;
813
814 si2 = int64_uint64_2[i].y / si;
815 }
816 catch(...)
817 {
818 fSuccess = false;
819 }
820
821 if( fSuccess != int64_uint64_2[i].fExpected )
822 {
823 printf("Error in case int64_uint64_2 throw: %I64X, %I64X, expected = %s\n", int64_uint64_2[i].x, int64_uint64_2[i].y, int64_uint64_2[i].fExpected ? "true" : "false");
824 }
825 }
826}
827
828DivTest< std::uint64_t, std::int32_t > uint64_int32[] =
829{

Callers 1

DivVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected