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

Function PreDecTestInt32

Test/IncDecVerify.cpp:1112–1141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1110};
1111
1112void PreDecTestInt32()
1113{
1114 size_t i;
1115
1116 for( i = 0; i < COUNTOF(dec_int32); ++i )
1117 {
1118 bool fSuccess = true;
1119 try
1120 {
1121 SafeInt< std::int32_t > si(dec_int32[i].x);
1122 SafeInt< std::int32_t > vv = --si;
1123
1124 if(vv != dec_int32[i].y)
1125 {
1126 fSuccess = false;
1127 }
1128 }
1129 catch(SafeIntException&)
1130 {
1131 fSuccess = false;
1132 }
1133
1134 if( fSuccess != dec_int32[i].fExpected )
1135 {
1136 cerr << "Error in case dec_int32 throw (1): ";
1137 cerr << HEX(8) << dec_int32[i].x << ", ";
1138 cerr << "expected = " << dec_int32[i].fExpected << endl;
1139 }
1140 }
1141}
1142
1143void PostDecTestInt32()
1144{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected