| 111 | }; |
| 112 | |
| 113 | void PreIncTestUint16() |
| 114 | { |
| 115 | size_t i; |
| 116 | |
| 117 | for( i = 0; i < COUNTOF(inc_uint16); ++i ) |
| 118 | { |
| 119 | bool fSuccess = true; |
| 120 | try |
| 121 | { |
| 122 | SafeInt<std::uint16_t> si(inc_uint16[i].x); |
| 123 | SafeInt<std::uint16_t> vv = ++si; |
| 124 | |
| 125 | if(vv != inc_uint16[i].y) |
| 126 | { |
| 127 | fSuccess = false; |
| 128 | } |
| 129 | } |
| 130 | catch(SafeIntException&) |
| 131 | { |
| 132 | fSuccess = false; |
| 133 | } |
| 134 | |
| 135 | if( fSuccess != inc_uint16[i].fExpected ) |
| 136 | { |
| 137 | cerr << "Error in case inc_uint16 throw (1): "; |
| 138 | cerr << HEX(4) << inc_uint16[i].x << ", "; |
| 139 | cerr << "expected = " << inc_uint16[i].fExpected << endl; |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | void PostIncTestUint16() |
| 145 | { |