| 1035 | }; |
| 1036 | |
| 1037 | void PreDecTestInt16() |
| 1038 | { |
| 1039 | size_t i; |
| 1040 | |
| 1041 | for( i = 0; i < COUNTOF(dec_int16); ++i ) |
| 1042 | { |
| 1043 | bool fSuccess = true; |
| 1044 | try |
| 1045 | { |
| 1046 | SafeInt< std::int16_t > si(dec_int16[i].x); |
| 1047 | SafeInt< std::int16_t > vv = --si; |
| 1048 | |
| 1049 | if(vv != dec_int16[i].y) |
| 1050 | { |
| 1051 | fSuccess = false; |
| 1052 | } |
| 1053 | } |
| 1054 | catch(SafeIntException&) |
| 1055 | { |
| 1056 | fSuccess = false; |
| 1057 | } |
| 1058 | |
| 1059 | if( fSuccess != dec_int16[i].fExpected ) |
| 1060 | { |
| 1061 | cerr << "Error in case dec_int16 throw (1): "; |
| 1062 | cerr << HEX(4) << dec_int16[i].x << ", "; |
| 1063 | cerr << "expected = " << dec_int16[i].fExpected << endl; |
| 1064 | } |
| 1065 | } |
| 1066 | } |
| 1067 | |
| 1068 | void PostDecTestInt16() |
| 1069 | { |