| 727 | }; |
| 728 | |
| 729 | void PreDecTestUint16() |
| 730 | { |
| 731 | size_t i; |
| 732 | |
| 733 | for( i = 0; i < COUNTOF(dec_uint16); ++i ) |
| 734 | { |
| 735 | bool fSuccess = true; |
| 736 | try |
| 737 | { |
| 738 | SafeInt<std::uint16_t> si(dec_uint16[i].x); |
| 739 | SafeInt<std::uint16_t> vv = --si; |
| 740 | |
| 741 | if(vv != dec_uint16[i].y) |
| 742 | { |
| 743 | fSuccess = false; |
| 744 | } |
| 745 | } |
| 746 | catch(SafeIntException&) |
| 747 | { |
| 748 | fSuccess = false; |
| 749 | } |
| 750 | |
| 751 | if( fSuccess != dec_uint16[i].fExpected ) |
| 752 | { |
| 753 | cerr << "Error in case dec_uint16 throw (1): "; |
| 754 | cerr << HEX(4) << dec_uint16[i].x << ", "; |
| 755 | cerr << "expected = " << dec_uint16[i].fExpected << endl; |
| 756 | } |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | void PostDecTestUint16() |
| 761 | { |