| 217 | } |
| 218 | |
| 219 | void 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 | |
| 250 | static const IncTest< std::uint64_t > inc_uint64[] = |
| 251 | { |