mirror of
https://github.com/QuasarApp/CopyrightFixer.git
synced 2025-05-08 15:39:45 +00:00
Update tests/units/signtest.cpp
Co-authored-by: Andrei Yankovich <EndrIIMail@gmail.com>
This commit is contained in:
parent
43c3fd96bc
commit
a8b281e48d
@ -23,21 +23,17 @@ void SignTest::test() {
|
||||
void SignTest::testJsonObj() {
|
||||
QString filename = "signature.json";
|
||||
|
||||
CopyrighFixer::Owner ownerObj;
|
||||
ownerObj.setName("QuasarApp");
|
||||
ownerObj.setTimePoint(QDateTime::currentMSecsSinceEpoch());
|
||||
CopyrighFixer::Sign baseSign = generateRandomSign();
|
||||
|
||||
QVERIFY(baseSign.toJson(filename));
|
||||
|
||||
QVERIFY(baseSign.isValid());
|
||||
|
||||
CopyrighFixer::Sign signFromFile;
|
||||
QVERIFY(signFromFile.fromJson(filename));
|
||||
|
||||
QVERIFY(signFromFile == baseSign);
|
||||
|
||||
QMap<int, CopyrighFixer::Owner> OwnerMap;
|
||||
OwnerMap.insert(ownerObj.getTimePoint(), ownerObj);
|
||||
|
||||
CopyrighFixer::Signature sign_toJson;
|
||||
sign_toJson.setLicenseTitle("Copyright (C) 2020-2021 QuasarApp.");
|
||||
sign_toJson.setMessage("Distributed under the lgplv3 software license, see the accompany.");
|
||||
sign_toJson.setMapOwners(OwnerMap);
|
||||
sign_toJson.toJson(filename);
|
||||
|
||||
CopyrighFixer::Signature sign_fromJson;
|
||||
sign_fromJson.fromJson(filename);
|
||||
|
||||
QVERIFY(sign_fromJson.isValid() == sign_toJson.isValid());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user