File indexing completed on 2024-04-21 03:52:29

0001 /* This file is part of the KDE project
0002    SPDX-FileCopyrightText: 2009 Pino Toscano <pino@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KLIMITEDIODEVICETEST_H
0008 #define KLIMITEDIODEVICETEST_H
0009 
0010 #include <QBuffer>
0011 #include <QByteArray>
0012 #include <QList>
0013 #include <QObject>
0014 
0015 struct ChunkData {
0016     QByteArray data;
0017     int offset;
0018 };
0019 
0020 class KLimitedIODeviceTest : public QObject
0021 {
0022     Q_OBJECT
0023 private Q_SLOTS:
0024     void initTestCase();
0025 
0026     void testReadChunks_data();
0027     void testReadChunks();
0028     void testSeeking();
0029 
0030 private:
0031     void addChunk(const QByteArray &chunk);
0032 
0033     QByteArray m_data;
0034     QBuffer m_buffer;
0035     QList<ChunkData> m_chunks;
0036 };
0037 
0038 #endif