| 608 | } |
| 609 | |
| 610 | void PostIncTestInt64() |
| 611 | { |
| 612 | size_t i; |
| 613 | |
| 614 | for( i = 0; i < COUNTOF(inc_int64); ++i ) |
| 615 | { |
| 616 | bool fSuccess = true; |
| 617 | try |
| 618 | { |
| 619 | SafeInt< std::int64_t > si(inc_int64[i].x); |
| 620 | SafeInt< std::int64_t > vv = si++; |
| 621 | |
| 622 | if(vv != inc_int64[i].x) |
| 623 | { |
| 624 | fSuccess = false; |
| 625 | } |
| 626 | } |
| 627 | catch(SafeIntException&) |
| 628 | { |
| 629 | fSuccess = false; |
| 630 | } |
| 631 | |
| 632 | if( fSuccess != inc_int64[i].fExpected ) |
| 633 | { |
| 634 | cerr << "Error in case inc_int64 throw (2): "; |
| 635 | cerr << HEX(8) << inc_int64[i].x << ", "; |
| 636 | cerr << "expected = " << inc_int64[i].fExpected << endl; |
| 637 | } |
| 638 | } |
| 639 | } |
| 640 | |
| 641 | static const DecTest< std::uint8_t > dec_uint8[] = |
| 642 | { |