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

Function PostIncTestUint64

Test/IncDecVerify.cpp:302–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void PostIncTestUint64()
303{
304 size_t i;
305
306 for( i = 0; i < COUNTOF(inc_uint64); ++i )
307 {
308 bool fSuccess = true;
309 try
310 {
311 SafeInt<std::uint64_t> si(inc_uint64[i].x);
312 SafeInt<std::uint64_t> vv = si++;
313
314 if(vv != inc_uint64[i].x)
315 {
316 fSuccess = false;
317 }
318 }
319 catch(SafeIntException&)
320 {
321 fSuccess = false;
322 }
323
324 if( fSuccess != inc_uint64[i].fExpected )
325 {
326 cerr << "Error in case inc_uint64 throw (2): ";
327 cerr << HEX(16) << inc_uint64[i].x << ", ";
328 cerr << "expected = " << inc_uint64[i].fExpected << endl;
329 }
330 }
331}
332
333static const IncTest< std::int8_t > inc_int8[] =
334{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected