| 186 | }; |
| 187 | |
| 188 | void PreIncTestUint32() |
| 189 | { |
| 190 | size_t i; |
| 191 | |
| 192 | for( i = 0; i < COUNTOF(inc_uint32); ++i ) |
| 193 | { |
| 194 | bool fSuccess = true; |
| 195 | try |
| 196 | { |
| 197 | SafeInt<std::uint32_t> si(inc_uint32[i].x); |
| 198 | SafeInt<std::uint32_t> vv = ++si; |
| 199 | |
| 200 | if(vv != inc_uint32[i].y) |
| 201 | { |
| 202 | fSuccess = false; |
| 203 | } |
| 204 | } |
| 205 | catch(SafeIntException&) |
| 206 | { |
| 207 | fSuccess = false; |
| 208 | } |
| 209 | |
| 210 | if( fSuccess != inc_uint32[i].fExpected ) |
| 211 | { |
| 212 | cerr << "Error in case inc_uint32 throw (1): "; |
| 213 | cerr << HEX(8) << inc_uint32[i].x << ", "; |
| 214 | cerr << "expected = " << inc_uint32[i].fExpected << endl; |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | void PostIncTestUint32() |
| 220 | { |