| 885 | }; |
| 886 | |
| 887 | void PreDecTestUint64() |
| 888 | { |
| 889 | size_t i; |
| 890 | |
| 891 | for( i = 0; i < COUNTOF(dec_uint64); ++i ) |
| 892 | { |
| 893 | bool fSuccess = true; |
| 894 | try |
| 895 | { |
| 896 | SafeInt<std::uint64_t> si(dec_uint64[i].x); |
| 897 | SafeInt<std::uint64_t> vv = --si; |
| 898 | |
| 899 | if(vv != dec_uint64[i].y) |
| 900 | { |
| 901 | fSuccess = false; |
| 902 | } |
| 903 | } |
| 904 | catch(SafeIntException&) |
| 905 | { |
| 906 | fSuccess = false; |
| 907 | } |
| 908 | |
| 909 | if( fSuccess != dec_uint64[i].fExpected ) |
| 910 | { |
| 911 | cerr << "Error in case dec_uint64 throw (1): "; |
| 912 | cerr << HEX(16) << dec_uint64[i].x << ", "; |
| 913 | cerr << "expected = " << dec_uint64[i].fExpected << endl; |
| 914 | } |
| 915 | } |
| 916 | } |
| 917 | |
| 918 | void PostDecTestUint64() |
| 919 | { |