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

Function PreIncTestInt16

Test/IncDecVerify.cpp:421–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419};
420
421void PreIncTestInt16()
422{
423 size_t i;
424
425 for( i = 0; i < COUNTOF(inc_int16); ++i )
426 {
427 bool fSuccess = true;
428 try
429 {
430 SafeInt< std::int16_t > si(inc_int16[i].x);
431 SafeInt< std::int16_t > vv = ++si;
432
433 if(vv != inc_int16[i].y)
434 {
435 fSuccess = false;
436 }
437 }
438 catch(SafeIntException&)
439 {
440 fSuccess = false;
441 }
442
443 if( fSuccess != inc_int16[i].fExpected )
444 {
445 cerr << "Error in case inc_int16 throw (1): ";
446 cerr << HEX(4) << inc_int16[i].x << ", ";
447 cerr << "expected = " << inc_int16[i].fExpected << endl;
448 }
449 }
450}
451
452void PostIncTestInt16()
453{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected