MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / readMany

Method readMany

lib/QuaZip/qztest/testquaziodevice.cpp:55–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void TestQuaZIODevice::readMany()
56{
57 QByteArray buf(256, 0);
58 z_stream zouts;
59 zouts.zalloc = (alloc_func) NULL;
60 zouts.zfree = (free_func) NULL;
61 zouts.opaque = NULL;
62 deflateInit(&zouts, Z_DEFAULT_COMPRESSION);
63 zouts.next_in = reinterpret_cast<Bytef*>(const_cast<char*>("testtest"));
64 zouts.avail_in = 8;
65 zouts.next_out = reinterpret_cast<Bytef*>(buf.data());
66 zouts.avail_out = buf.size();
67 deflate(&zouts, Z_FINISH);
68 deflateEnd(&zouts);
69 QBuffer testBuffer(&buf);
70 testBuffer.open(QIODevice::ReadOnly);
71 QuaZIODevice testDevice(&testBuffer);
72 QVERIFY(testDevice.open(QIODevice::ReadOnly));
73 char outBuf[4];
74 QCOMPARE(testDevice.read(outBuf, 4), static_cast<qint64>(4));
75 QVERIFY(!testDevice.atEnd());
76 QVERIFY(testDevice.bytesAvailable() > 0);
77 QCOMPARE(testDevice.read(4).size(), 4);
78 QCOMPARE(testDevice.bytesAvailable(), static_cast<qint64>(0));
79 QVERIFY(testDevice.atEnd());
80 testDevice.close();
81 QVERIFY(!testDevice.isOpen());
82}
83
84void TestQuaZIODevice::write()
85{

Callers

nothing calls this directly

Calls 8

dataMethod · 0.45
sizeMethod · 0.45
openMethod · 0.45
readMethod · 0.45
atEndMethod · 0.45
bytesAvailableMethod · 0.45
closeMethod · 0.45
isOpenMethod · 0.45

Tested by

no test coverage detected