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

Function PreIncTestUint32

Test/IncDecVerify.cpp:188–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186};
187
188void PreIncTestUint32()
189{
190 size_t i;
191
192 for( i = 0; i < COUNTOF(inc_uint32); ++i )
193 {
194 bool fSuccess = true;
195 try
196 {
197 SafeInt<std::uint32_t> si(inc_uint32[i].x);
198 SafeInt<std::uint32_t> vv = ++si;
199
200 if(vv != inc_uint32[i].y)
201 {
202 fSuccess = false;
203 }
204 }
205 catch(SafeIntException&)
206 {
207 fSuccess = false;
208 }
209
210 if( fSuccess != inc_uint32[i].fExpected )
211 {
212 cerr << "Error in case inc_uint32 throw (1): ";
213 cerr << HEX(8) << inc_uint32[i].x << ", ";
214 cerr << "expected = " << inc_uint32[i].fExpected << endl;
215 }
216 }
217}
218
219void PostIncTestUint32()
220{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected