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

Function PostIncTestInt32

Test/IncDecVerify.cpp:527–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525}
526
527void PostIncTestInt32()
528{
529 size_t i;
530
531 for( i = 0; i < COUNTOF(inc_int32); ++i )
532 {
533 bool fSuccess = true;
534 try
535 {
536 SafeInt< std::int32_t > si(inc_int32[i].x);
537 SafeInt< std::int32_t > vv = si++;
538
539 if(vv != inc_int32[i].x)
540 {
541 fSuccess = false;
542 }
543 }
544 catch(SafeIntException&)
545 {
546 fSuccess = false;
547 }
548
549 if( fSuccess != inc_int32[i].fExpected )
550 {
551 cerr << "Error in case inc_int32 throw (2): ";
552 cerr << HEX(8) << inc_int32[i].x << ", ";
553 cerr << "expected = " << inc_int32[i].fExpected << endl;
554 }
555 }
556}
557
558static const IncTest< std::int64_t > inc_int64[] =
559{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected