| 450 | } |
| 451 | |
| 452 | void PostIncTestInt16() |
| 453 | { |
| 454 | size_t i; |
| 455 | |
| 456 | for( i = 0; i < COUNTOF(inc_int16); ++i ) |
| 457 | { |
| 458 | bool fSuccess = true; |
| 459 | try |
| 460 | { |
| 461 | SafeInt< std::int16_t > si(inc_int16[i].x); |
| 462 | SafeInt< std::int16_t > vv = si++; |
| 463 | |
| 464 | if(vv != inc_int16[i].x) |
| 465 | { |
| 466 | fSuccess = false; |
| 467 | } |
| 468 | } |
| 469 | catch(SafeIntException&) |
| 470 | { |
| 471 | fSuccess = false; |
| 472 | } |
| 473 | |
| 474 | if( fSuccess != inc_int16[i].fExpected ) |
| 475 | { |
| 476 | cerr << "Error in case inc_int16 throw (2): "; |
| 477 | cerr << HEX(4) << inc_int16[i].x << ", "; |
| 478 | cerr << "expected = " << inc_int16[i].fExpected << endl; |
| 479 | } |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | static const IncTest< std::int32_t > inc_int32[] = |
| 484 | { |