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

Function PreIncTestUint16

Test/IncDecVerify.cpp:113–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111};
112
113void PreIncTestUint16()
114{
115 size_t i;
116
117 for( i = 0; i < COUNTOF(inc_uint16); ++i )
118 {
119 bool fSuccess = true;
120 try
121 {
122 SafeInt<std::uint16_t> si(inc_uint16[i].x);
123 SafeInt<std::uint16_t> vv = ++si;
124
125 if(vv != inc_uint16[i].y)
126 {
127 fSuccess = false;
128 }
129 }
130 catch(SafeIntException&)
131 {
132 fSuccess = false;
133 }
134
135 if( fSuccess != inc_uint16[i].fExpected )
136 {
137 cerr << "Error in case inc_uint16 throw (1): ";
138 cerr << HEX(4) << inc_uint16[i].x << ", ";
139 cerr << "expected = " << inc_uint16[i].fExpected << endl;
140 }
141 }
142}
143
144void PostIncTestUint16()
145{

Callers 1

IncDecVerifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected