| 259 | } |
| 260 | |
| 261 | void testProviderWrite() { |
| 262 | QByteArray data(16, '\0'); |
| 263 | rcx::BufferProvider prov(data); |
| 264 | QVERIFY(prov.isWritable()); |
| 265 | |
| 266 | QByteArray patch; |
| 267 | patch.append((char)0x42); |
| 268 | patch.append((char)0x43); |
| 269 | QVERIFY(prov.writeBytes(0, patch)); |
| 270 | QCOMPARE(prov.readU8(0), (uint8_t)0x42); |
| 271 | QCOMPARE(prov.readU8(1), (uint8_t)0x43); |
| 272 | |
| 273 | // Write past end should fail |
| 274 | QVERIFY(!prov.writeBytes(15, patch)); |
| 275 | |
| 276 | // NullProvider is not writable |
| 277 | rcx::NullProvider np; |
| 278 | QVERIFY(!np.isWritable()); |
| 279 | } |
| 280 | |
| 281 | void testComputeOffsetLarge() { |
| 282 | // Verify computeOffset returns int64_t that doesn't overflow |
nothing calls this directly
no test coverage detected