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

Function PostIncTestInt64

Test/IncDecVerify.cpp:610–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

608}
609
610void PostIncTestInt64()
611{
612 size_t i;
613
614 for( i = 0; i < COUNTOF(inc_int64); ++i )
615 {
616 bool fSuccess = true;
617 try
618 {
619 SafeInt< std::int64_t > si(inc_int64[i].x);
620 SafeInt< std::int64_t > vv = si++;
621
622 if(vv != inc_int64[i].x)
623 {
624 fSuccess = false;
625 }
626 }
627 catch(SafeIntException&)
628 {
629 fSuccess = false;
630 }
631
632 if( fSuccess != inc_int64[i].fExpected )
633 {
634 cerr << "Error in case inc_int64 throw (2): ";
635 cerr << HEX(8) << inc_int64[i].x << ", ";
636 cerr << "expected = " << inc_int64[i].fExpected << endl;
637 }
638 }
639}
640
641static const DecTest< std::uint8_t > dec_uint8[] =
642{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected