| 419 | }; |
| 420 | |
| 421 | void PreIncTestInt16() |
| 422 | { |
| 423 | size_t i; |
| 424 | |
| 425 | for( i = 0; i < COUNTOF(inc_int16); ++i ) |
| 426 | { |
| 427 | bool fSuccess = true; |
| 428 | try |
| 429 | { |
| 430 | SafeInt< std::int16_t > si(inc_int16[i].x); |
| 431 | SafeInt< std::int16_t > vv = ++si; |
| 432 | |
| 433 | if(vv != inc_int16[i].y) |
| 434 | { |
| 435 | fSuccess = false; |
| 436 | } |
| 437 | } |
| 438 | catch(SafeIntException&) |
| 439 | { |
| 440 | fSuccess = false; |
| 441 | } |
| 442 | |
| 443 | if( fSuccess != inc_int16[i].fExpected ) |
| 444 | { |
| 445 | cerr << "Error in case inc_int16 throw (1): "; |
| 446 | cerr << HEX(4) << inc_int16[i].x << ", "; |
| 447 | cerr << "expected = " << inc_int16[i].fExpected << endl; |
| 448 | } |
| 449 | } |
| 450 | } |
| 451 | |
| 452 | void PostIncTestInt16() |
| 453 | { |