| 802 | }; |
| 803 | |
| 804 | void PreDecTestUint32() |
| 805 | { |
| 806 | size_t i; |
| 807 | |
| 808 | for( i = 0; i < COUNTOF(dec_uint32); ++i ) |
| 809 | { |
| 810 | bool fSuccess = true; |
| 811 | try |
| 812 | { |
| 813 | SafeInt<std::uint32_t> si(dec_uint32[i].x); |
| 814 | SafeInt<std::uint32_t> vv = --si; |
| 815 | |
| 816 | if(vv != dec_uint32[i].y) |
| 817 | { |
| 818 | fSuccess = false; |
| 819 | } |
| 820 | } |
| 821 | catch(SafeIntException&) |
| 822 | { |
| 823 | fSuccess = false; |
| 824 | } |
| 825 | |
| 826 | if( fSuccess != dec_uint32[i].fExpected ) |
| 827 | { |
| 828 | cerr << "Error in case dec_uint32 throw (1): "; |
| 829 | cerr << HEX(8) << dec_uint32[i].x << ", "; |
| 830 | cerr << "expected = " << dec_uint32[i].fExpected << endl; |
| 831 | } |
| 832 | } |
| 833 | } |
| 834 | |
| 835 | void PostDecTestUint32() |
| 836 | { |