37 lines
799 B
C++
Executable File
37 lines
799 B
C++
Executable File
|
|
|
|
#pragma once
|
|
|
|
#include <QByteArray>
|
|
#include <QHash>
|
|
#include <QObject>
|
|
#include <QTemporaryDir>
|
|
#include <QTemporaryFile>
|
|
|
|
class nglcomp_test : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
nglcomp_test() = default;
|
|
|
|
private Q_SLOTS:
|
|
void initTestCase();
|
|
void testCompressFile();
|
|
void testCompressMemory();
|
|
void testUncompressFile();
|
|
void testUncompressMemory();
|
|
void cleanupTestCase();
|
|
private:
|
|
void writeTestFile(const QString &fn, const QByteArray &content) const;
|
|
void checkContent(const QString &fn, const QByteArray &content) const;
|
|
QString subPathIn(const QString &p) const;
|
|
QString subPathOut(const QString &p) const;
|
|
private:
|
|
QHash<QString, QByteArray> m_fileContent;
|
|
QByteArray m_ba;
|
|
QTemporaryFile m_tf;
|
|
QTemporaryDir m_tempDirIn;
|
|
QTemporaryDir m_tempDirOut;
|
|
};
|