| 1032 | } |
| 1033 | |
| 1034 | void PostDecTestInt8() |
| 1035 | { |
| 1036 | size_t i; |
| 1037 | |
| 1038 | for( i = 0; i < COUNTOF(dec_int8); ++i ) |
| 1039 | { |
| 1040 | bool fSuccess = true; |
| 1041 | try |
| 1042 | { |
| 1043 | SafeInt< __int8 > si(dec_int8[i].x); |
| 1044 | SafeInt< __int8 > vv = si--; |
| 1045 | |
| 1046 | if(vv != dec_int8[i].x) |
| 1047 | { |
| 1048 | fSuccess = false; |
| 1049 | } |
| 1050 | } |
| 1051 | catch(SafeIntException&) |
| 1052 | { |
| 1053 | fSuccess = false; |
| 1054 | } |
| 1055 | |
| 1056 | if( fSuccess != dec_int8[i].fExpected ) |
| 1057 | { |
| 1058 | cerr << "Error in case dec_int8 throw (2): "; |
| 1059 | cerr << HEX(2) << (0xFF & (int)dec_int8[i].x) << ", "; |
| 1060 | cerr << "expected = " << dec_int8[i].fExpected << endl; |
| 1061 | } |
| 1062 | } |
| 1063 | } |
| 1064 | |
| 1065 | static const DecTest< __int16 > dec_int16[] = |
| 1066 | { |