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

Function PreDecTestUint64

Test/IncDecVerify.cpp:887–916  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885};
886
887void PreDecTestUint64()
888{
889 size_t i;
890
891 for( i = 0; i < COUNTOF(dec_uint64); ++i )
892 {
893 bool fSuccess = true;
894 try
895 {
896 SafeInt<std::uint64_t> si(dec_uint64[i].x);
897 SafeInt<std::uint64_t> vv = --si;
898
899 if(vv != dec_uint64[i].y)
900 {
901 fSuccess = false;
902 }
903 }
904 catch(SafeIntException&)
905 {
906 fSuccess = false;
907 }
908
909 if( fSuccess != dec_uint64[i].fExpected )
910 {
911 cerr << "Error in case dec_uint64 throw (1): ";
912 cerr << HEX(16) << dec_uint64[i].x << ", ";
913 cerr << "expected = " << dec_uint64[i].fExpected << endl;
914 }
915 }
916}
917
918void PostDecTestUint64()
919{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected