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

Function PostDecTestInt32

Test/IncDecVerify.cpp:1143–1172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1141}
1142
1143void PostDecTestInt32()
1144{
1145 size_t i;
1146
1147 for( i = 0; i < COUNTOF(dec_int32); ++i )
1148 {
1149 bool fSuccess = true;
1150 try
1151 {
1152 SafeInt< std::int32_t > si(dec_int32[i].x);
1153 SafeInt< std::int32_t > vv = si--;
1154
1155 if(vv != dec_int32[i].x)
1156 {
1157 fSuccess = false;
1158 }
1159 }
1160 catch(SafeIntException&)
1161 {
1162 fSuccess = false;
1163 }
1164
1165 if( fSuccess != dec_int32[i].fExpected )
1166 {
1167 cerr << "Error in case dec_int32 throw (2): ";
1168 cerr << HEX(8) << dec_int32[i].x << ", ";
1169 cerr << "expected = " << dec_int32[i].fExpected << endl;
1170 }
1171 }
1172}
1173
1174static const DecTest< std::int64_t > dec_int64[] =
1175{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected