| 525 | } |
| 526 | |
| 527 | void PostIncTestInt32() |
| 528 | { |
| 529 | size_t i; |
| 530 | |
| 531 | for( i = 0; i < COUNTOF(inc_int32); ++i ) |
| 532 | { |
| 533 | bool fSuccess = true; |
| 534 | try |
| 535 | { |
| 536 | SafeInt< std::int32_t > si(inc_int32[i].x); |
| 537 | SafeInt< std::int32_t > vv = si++; |
| 538 | |
| 539 | if(vv != inc_int32[i].x) |
| 540 | { |
| 541 | fSuccess = false; |
| 542 | } |
| 543 | } |
| 544 | catch(SafeIntException&) |
| 545 | { |
| 546 | fSuccess = false; |
| 547 | } |
| 548 | |
| 549 | if( fSuccess != inc_int32[i].fExpected ) |
| 550 | { |
| 551 | cerr << "Error in case inc_int32 throw (2): "; |
| 552 | cerr << HEX(8) << inc_int32[i].x << ", "; |
| 553 | cerr << "expected = " << inc_int32[i].fExpected << endl; |
| 554 | } |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | static const IncTest< std::int64_t > inc_int64[] = |
| 559 | { |