| 758 | } |
| 759 | |
| 760 | void PostDecTestUint16() |
| 761 | { |
| 762 | size_t i; |
| 763 | |
| 764 | for( i = 0; i < COUNTOF(dec_uint16); ++i ) |
| 765 | { |
| 766 | bool fSuccess = true; |
| 767 | try |
| 768 | { |
| 769 | SafeInt<std::uint16_t> si(dec_uint16[i].x); |
| 770 | SafeInt<std::uint16_t> vv = si--; |
| 771 | |
| 772 | if(vv != dec_uint16[i].x) |
| 773 | { |
| 774 | fSuccess = false; |
| 775 | } |
| 776 | } |
| 777 | catch(SafeIntException&) |
| 778 | { |
| 779 | fSuccess = false; |
| 780 | } |
| 781 | |
| 782 | if( fSuccess != dec_uint16[i].fExpected ) |
| 783 | { |
| 784 | cerr << "Error in case dec_uint16 throw (2): "; |
| 785 | cerr << HEX(4) << dec_uint16[i].x << ", "; |
| 786 | cerr << "expected = " << dec_uint16[i].fExpected << endl; |
| 787 | } |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | static const DecTest< std::uint32_t > dec_uint32[] = |
| 792 | { |