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

Function PreDecTestUint16

Test/IncDecVerify.cpp:729–758  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727};
728
729void PreDecTestUint16()
730{
731 size_t i;
732
733 for( i = 0; i < COUNTOF(dec_uint16); ++i )
734 {
735 bool fSuccess = true;
736 try
737 {
738 SafeInt<std::uint16_t> si(dec_uint16[i].x);
739 SafeInt<std::uint16_t> vv = --si;
740
741 if(vv != dec_uint16[i].y)
742 {
743 fSuccess = false;
744 }
745 }
746 catch(SafeIntException&)
747 {
748 fSuccess = false;
749 }
750
751 if( fSuccess != dec_uint16[i].fExpected )
752 {
753 cerr << "Error in case dec_uint16 throw (1): ";
754 cerr << HEX(4) << dec_uint16[i].x << ", ";
755 cerr << "expected = " << dec_uint16[i].fExpected << endl;
756 }
757 }
758}
759
760void PostDecTestUint16()
761{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected