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

Function PreDecTestUint32

Test/IncDecVerify.cpp:804–833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802};
803
804void PreDecTestUint32()
805{
806 size_t i;
807
808 for( i = 0; i < COUNTOF(dec_uint32); ++i )
809 {
810 bool fSuccess = true;
811 try
812 {
813 SafeInt<std::uint32_t> si(dec_uint32[i].x);
814 SafeInt<std::uint32_t> vv = --si;
815
816 if(vv != dec_uint32[i].y)
817 {
818 fSuccess = false;
819 }
820 }
821 catch(SafeIntException&)
822 {
823 fSuccess = false;
824 }
825
826 if( fSuccess != dec_uint32[i].fExpected )
827 {
828 cerr << "Error in case dec_uint32 throw (1): ";
829 cerr << HEX(8) << dec_uint32[i].x << ", ";
830 cerr << "expected = " << dec_uint32[i].fExpected << endl;
831 }
832 }
833}
834
835void PostDecTestUint32()
836{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected