| 1141 | } |
| 1142 | |
| 1143 | void PostDecTestInt32() |
| 1144 | { |
| 1145 | size_t i; |
| 1146 | |
| 1147 | for( i = 0; i < COUNTOF(dec_int32); ++i ) |
| 1148 | { |
| 1149 | bool fSuccess = true; |
| 1150 | try |
| 1151 | { |
| 1152 | SafeInt< std::int32_t > si(dec_int32[i].x); |
| 1153 | SafeInt< std::int32_t > vv = si--; |
| 1154 | |
| 1155 | if(vv != dec_int32[i].x) |
| 1156 | { |
| 1157 | fSuccess = false; |
| 1158 | } |
| 1159 | } |
| 1160 | catch(SafeIntException&) |
| 1161 | { |
| 1162 | fSuccess = false; |
| 1163 | } |
| 1164 | |
| 1165 | if( fSuccess != dec_int32[i].fExpected ) |
| 1166 | { |
| 1167 | cerr << "Error in case dec_int32 throw (2): "; |
| 1168 | cerr << HEX(8) << dec_int32[i].x << ", "; |
| 1169 | cerr << "expected = " << dec_int32[i].fExpected << endl; |
| 1170 | } |
| 1171 | } |
| 1172 | } |
| 1173 | |
| 1174 | static const DecTest< std::int64_t > dec_int64[] = |
| 1175 | { |