MCPcopy Create free account
hub / github.com/dcleblanc/SafeInt / PostDecTestInt16

Function PostDecTestInt16

Archive/releases/2/IncDecVerify.cpp:1109–1138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1107}
1108
1109void PostDecTestInt16()
1110{
1111 size_t i;
1112
1113 for( i = 0; i < COUNTOF(dec_int16); ++i )
1114 {
1115 bool fSuccess = true;
1116 try
1117 {
1118 SafeInt< __int16 > si(dec_int16[i].x);
1119 SafeInt< __int16 > vv = si--;
1120
1121 if(vv != dec_int16[i].x)
1122 {
1123 fSuccess = false;
1124 }
1125 }
1126 catch(SafeIntException&)
1127 {
1128 fSuccess = false;
1129 }
1130
1131 if( fSuccess != dec_int16[i].fExpected )
1132 {
1133 cerr << "Error in case dec_int16 throw (2): ";
1134 cerr << HEX(4) << dec_int16[i].x << ", ";
1135 cerr << "expected = " << dec_int16[i].fExpected << endl;
1136 }
1137 }
1138}
1139
1140static const DecTest< __int32 > dec_int32[] =
1141{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected