| 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; |
nothing calls this directly
no test coverage detected