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

Function PreIncTestInt32

Test/IncDecVerify.cpp:496–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494};
495
496void PreIncTestInt32()
497{
498 size_t i;
499
500 for( i = 0; i < COUNTOF(inc_int32); ++i )
501 {
502 bool fSuccess = true;
503 try
504 {
505 SafeInt< std::int32_t > si(inc_int32[i].x);
506 SafeInt< std::int32_t > vv = ++si;
507
508 if(vv != inc_int32[i].y)
509 {
510 fSuccess = false;
511 }
512 }
513 catch(SafeIntException&)
514 {
515 fSuccess = false;
516 }
517
518 if( fSuccess != inc_int32[i].fExpected )
519 {
520 cerr << "Error in case inc_int32 throw (1): ";
521 cerr << HEX(8) << inc_int32[i].x << ", ";
522 cerr << "expected = " << inc_int32[i].fExpected << endl;
523 }
524 }
525}
526
527void PostIncTestInt32()
528{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected