| 1001 | }; |
| 1002 | |
| 1003 | void PreDecTestInt8() |
| 1004 | { |
| 1005 | size_t i; |
| 1006 | |
| 1007 | for( i = 0; i < COUNTOF(dec_int8); ++i ) |
| 1008 | { |
| 1009 | bool fSuccess = true; |
| 1010 | try |
| 1011 | { |
| 1012 | SafeInt< __int8 > si(dec_int8[i].x); |
| 1013 | SafeInt< __int8 > vv = --si; |
| 1014 | |
| 1015 | if(vv != dec_int8[i].y) |
| 1016 | { |
| 1017 | fSuccess = false; |
| 1018 | } |
| 1019 | } |
| 1020 | catch(SafeIntException&) |
| 1021 | { |
| 1022 | fSuccess = false; |
| 1023 | } |
| 1024 | |
| 1025 | if( fSuccess != dec_int8[i].fExpected ) |
| 1026 | { |
| 1027 | cerr << "Error in case dec_int8 throw (1): "; |
| 1028 | cerr << HEX(2) << (0xFF & (int)dec_int8[i].x) << ", "; |
| 1029 | cerr << "expected = " << dec_int8[i].fExpected << endl; |
| 1030 | } |
| 1031 | } |
| 1032 | } |
| 1033 | |
| 1034 | void PostDecTestInt8() |
| 1035 | { |