| 67 | } |
| 68 | |
| 69 | void PostIncTestUint8() |
| 70 | { |
| 71 | size_t i; |
| 72 | |
| 73 | for( i = 0; i < COUNTOF(inc_uint8); ++i ) |
| 74 | { |
| 75 | bool fSuccess = true; |
| 76 | try |
| 77 | { |
| 78 | SafeInt<std::uint8_t> si(inc_uint8[i].x); |
| 79 | SafeInt<std::uint8_t> vv = si++; |
| 80 | |
| 81 | if(vv != inc_uint8[i].x) |
| 82 | { |
| 83 | fSuccess = false; |
| 84 | } |
| 85 | } |
| 86 | catch(SafeIntException&) |
| 87 | { |
| 88 | fSuccess = false; |
| 89 | } |
| 90 | |
| 91 | if( fSuccess != inc_uint8[i].fExpected ) |
| 92 | { |
| 93 | cerr << "Error in case inc_uint8 throw (2): "; |
| 94 | cerr << HEX(2) << (0xFF & (int)inc_uint8[i].x) << ", "; |
| 95 | cerr << "expected = " << inc_uint8[i].fExpected << endl; |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | static const IncTest< std::uint16_t > inc_uint16[] = |
| 101 | { |