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

Function PreIncTestInt8

Test/IncDecVerify.cpp:346–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344};
345
346void PreIncTestInt8()
347{
348 size_t i;
349
350 for( i = 0; i < COUNTOF(inc_int8); ++i )
351 {
352 bool fSuccess = true;
353 try
354 {
355 SafeInt< std::int8_t > si(inc_int8[i].x);
356 SafeInt< std::int8_t > vv = ++si;
357
358 if(vv != inc_int8[i].y)
359 {
360 fSuccess = false;
361 }
362 }
363 catch(SafeIntException&)
364 {
365 fSuccess = false;
366 }
367
368 if( fSuccess != inc_int8[i].fExpected )
369 {
370 cerr << "Error in case inc_int8 throw (1): ";
371 cerr << HEX(2) << (0xFF & (int)inc_int8[i].x) << ", ";
372 cerr << "expected = " << inc_int8[i].fExpected << endl;
373 }
374 }
375}
376
377void PostIncTestInt8()
378{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected