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

Function PreIncTestUint64

Test/IncDecVerify.cpp:271–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269};
270
271void PreIncTestUint64()
272{
273 size_t i;
274
275 for( i = 0; i < COUNTOF(inc_uint64); ++i )
276 {
277 bool fSuccess = true;
278 try
279 {
280 SafeInt<std::uint64_t> si(inc_uint64[i].x);
281 SafeInt<std::uint64_t> vv = ++si;
282
283 if(vv != inc_uint64[i].y)
284 {
285 fSuccess = false;
286 }
287 }
288 catch(SafeIntException&)
289 {
290 fSuccess = false;
291 }
292
293 if( fSuccess != inc_uint64[i].fExpected )
294 {
295 cerr << "Error in case inc_uint64 throw (1): ";
296 cerr << HEX(16) << inc_uint64[i].x << ", ";
297 cerr << "expected = " << inc_uint64[i].fExpected << endl;
298 }
299 }
300}
301
302void PostIncTestUint64()
303{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected