| 1066 | } |
| 1067 | |
| 1068 | void PostDecTestInt16() |
| 1069 | { |
| 1070 | size_t i; |
| 1071 | |
| 1072 | for( i = 0; i < COUNTOF(dec_int16); ++i ) |
| 1073 | { |
| 1074 | bool fSuccess = true; |
| 1075 | try |
| 1076 | { |
| 1077 | SafeInt< std::int16_t > si(dec_int16[i].x); |
| 1078 | SafeInt< std::int16_t > vv = si--; |
| 1079 | |
| 1080 | if(vv != dec_int16[i].x) |
| 1081 | { |
| 1082 | fSuccess = false; |
| 1083 | } |
| 1084 | } |
| 1085 | catch(SafeIntException&) |
| 1086 | { |
| 1087 | fSuccess = false; |
| 1088 | } |
| 1089 | |
| 1090 | if( fSuccess != dec_int16[i].fExpected ) |
| 1091 | { |
| 1092 | cerr << "Error in case dec_int16 throw (2): "; |
| 1093 | cerr << HEX(4) << dec_int16[i].x << ", "; |
| 1094 | cerr << "expected = " << dec_int16[i].fExpected << endl; |
| 1095 | } |
| 1096 | } |
| 1097 | } |
| 1098 | |
| 1099 | static const DecTest< std::int32_t > dec_int32[] = |
| 1100 | { |