| 577 | }; |
| 578 | |
| 579 | void PreIncTestInt64() |
| 580 | { |
| 581 | size_t i; |
| 582 | |
| 583 | for( i = 0; i < COUNTOF(inc_int64); ++i ) |
| 584 | { |
| 585 | bool fSuccess = true; |
| 586 | try |
| 587 | { |
| 588 | SafeInt< std::int64_t > si(inc_int64[i].x); |
| 589 | SafeInt< std::int64_t > vv = ++si; |
| 590 | |
| 591 | if(vv != inc_int64[i].y) |
| 592 | { |
| 593 | fSuccess = false; |
| 594 | } |
| 595 | } |
| 596 | catch(SafeIntException&) |
| 597 | { |
| 598 | fSuccess = false; |
| 599 | } |
| 600 | |
| 601 | if( fSuccess != inc_int64[i].fExpected ) |
| 602 | { |
| 603 | cerr << "Error in case inc_int64 throw (1): "; |
| 604 | cerr << HEX(8) << inc_int64[i].x << ", "; |
| 605 | cerr << "expected = " << inc_int64[i].fExpected << endl; |
| 606 | } |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | void PostIncTestInt64() |
| 611 | { |