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

Function PostIncTestUint32

Test/IncDecVerify.cpp:219–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219void PostIncTestUint32()
220{
221 size_t i;
222
223 for( i = 0; i < COUNTOF(inc_uint32); ++i )
224 {
225 bool fSuccess = true;
226 try
227 {
228 SafeInt<std::uint32_t> si(inc_uint32[i].x);
229 SafeInt<std::uint32_t> vv = si++;
230
231 if(vv != inc_uint32[i].x)
232 {
233 fSuccess = false;
234 }
235 }
236 catch(SafeIntException&)
237 {
238 fSuccess = false;
239 }
240
241 if( fSuccess != inc_uint32[i].fExpected )
242 {
243 cerr << "Error in case inc_uint32 throw (2): ";
244 cerr << HEX(8) << inc_uint32[i].x << ", ";
245 cerr << "expected = " << inc_uint32[i].fExpected << endl;
246 }
247 }
248}
249
250static const IncTest< std::uint64_t > inc_uint64[] =
251{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected