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

Method testInt32Overflow

tests/test_validation.cpp:244–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242 }
243
244 void testInt32Overflow() {
245 bool ok;
246 // 2147483647 is INT32_MAX
247 fmt::parseValue(NodeKind::Int32, "2147483647", &ok);
248 QVERIFY(ok);
249
250 // 2147483648 overflows signed int32 in decimal
251 // Note: toInt returns false for overflow
252 fmt::parseValue(NodeKind::Int32, "2147483648", &ok);
253 QVERIFY2(!ok, "2147483648 overflows int32 decimal");
254
255 fmt::parseValue(NodeKind::Int32, "0xFFFFFFFF", &ok);
256 QVERIFY(ok); // hex path allows up to 0xFFFFFFFF
257
258 fmt::parseValue(NodeKind::Int32, "0x100000000", &ok);
259 QVERIFY2(!ok, "0x100000000 overflows int32 hex");
260 }
261
262 void testUInt32Overflow() {
263 bool ok;

Callers

nothing calls this directly

Calls 1

parseValueFunction · 0.85

Tested by

no test coverage detected