MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / testInt8Overflow

Method testInt8Overflow

tests/test_validation.cpp:178–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176 // ── Integer overflow: values that exceed type max ──
177
178 void testInt8Overflow() {
179 bool ok;
180 // Max int8 = 127, min = -128
181 fmt::parseValue(NodeKind::Int8, "128", &ok);
182 QVERIFY2(!ok, "128 overflows int8");
183
184 fmt::parseValue(NodeKind::Int8, "-129", &ok);
185 QVERIFY2(!ok, "-129 underflows int8");
186
187 fmt::parseValue(NodeKind::Int8, "127", &ok);
188 QVERIFY(ok);
189
190 fmt::parseValue(NodeKind::Int8, "-128", &ok);
191 QVERIFY(ok);
192
193 // Hex overflow: 0x100 > 0xFF
194 fmt::parseValue(NodeKind::Int8, "0x100", &ok);
195 QVERIFY2(!ok, "0x100 overflows int8 hex");
196
197 fmt::parseValue(NodeKind::Int8, "0xFF", &ok);
198 QVERIFY(ok);
199 }
200
201 void testUInt8Overflow() {
202 bool ok;

Callers

nothing calls this directly

Calls 1

parseValueFunction · 0.85

Tested by

no test coverage detected