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

Method testProviderWrite

tests/test_core.cpp:261–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

writeBytesMethod · 0.80
readU8Method · 0.80
isWritableMethod · 0.45

Tested by

no test coverage detected