2021-04-27 23:47:50 +03:00
|
|
|
//#
|
|
|
|
//# Copyright (C) 2020-2021 QuasarApp.
|
|
|
|
//# Distributed under the lgplv3 software license, see the accompanying
|
|
|
|
//# Everyone is permitted to copy and distribute verbatim copies
|
|
|
|
//# of this license document, but changing it is not allowed.
|
|
|
|
//#
|
|
|
|
|
|
|
|
#include "CopyrighFixer/sign.h"
|
|
|
|
#include "signtest.h"
|
|
|
|
|
|
|
|
SignTest::SignTest() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
SignTest::~SignTest() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignTest::test() {
|
|
|
|
testJsonObj();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignTest::testJsonObj() {
|
2021-04-30 00:46:42 +03:00
|
|
|
QString filename = "signature.json";
|
|
|
|
|
2021-05-03 20:36:46 +03:00
|
|
|
CopyrighFixer::Sign baseSign = generateRandomSign();
|
|
|
|
|
|
|
|
QVERIFY(baseSign.toJson(filename));
|
|
|
|
|
|
|
|
QVERIFY(baseSign.isValid());
|
|
|
|
|
|
|
|
CopyrighFixer::Sign signFromFile;
|
|
|
|
QVERIFY(signFromFile.fromJson(filename));
|
|
|
|
|
|
|
|
QVERIFY(signFromFile == baseSign);
|
2021-04-30 00:46:42 +03:00
|
|
|
|
2021-04-27 23:47:50 +03:00
|
|
|
|
|
|
|
}
|