Skip to content

Commit

Permalink
increase code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
squinky86 committed Mar 22, 2021
1 parent cc1e3ab commit ffc29fe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
26 changes: 13 additions & 13 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int main(int argc, char *argv[])
}

std::cout << "Test " << ++onTest << ": Include STIG Supplements" << std::endl;
QMetaObject::invokeMethod(&w, "SupplementsChanged", Qt::DirectConnection, Q_ARG(Qt::CheckState, Qt::Checked));
QMetaObject::invokeMethod(&w, "SupplementsChanged", Qt::DirectConnection, Q_ARG(int, Qt::Checked));
while (!w.isProcessingEnabled())
{
QThread::sleep(1);
Expand Down Expand Up @@ -147,6 +147,18 @@ int main(int argc, char *argv[])
a.processEvents();
}

{
std::cout << "Test " << ++onTest << ": Delete STIGs" << std::endl;
WorkerSTIGDelete wd;
DbManager db;
Q_FOREACH (auto stig, db.GetSTIGs())
{
wd.AddId(stig.id);
}
wd.process();
a.processEvents();
}

{
QDirIterator it(QStringLiteral("tests"));
WorkerCKLImport wc;
Expand Down Expand Up @@ -178,18 +190,6 @@ int main(int argc, char *argv[])
a.processEvents();
}

{
std::cout << "Test " << ++onTest << ": Delete STIGs" << std::endl;
WorkerSTIGDelete wd;
DbManager db;
Q_FOREACH (auto stig, db.GetSTIGs())
{
wd.AddId(stig.id);
}
wd.process();
a.processEvents();
}

std::cout << "Test " << ++onTest << ": Delete CCIs" << std::endl;
QMetaObject::invokeMethod(&w, "DeleteCCIs", Qt::DirectConnection);
while (!w.isProcessingEnabled())
Expand Down
9 changes: 9 additions & 0 deletions src/stigqter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,15 @@ void STIGQter::RunTests()
ProcEvents();
}

// build monolithic CKL files
std::cout << "\tTest " << step++ << ": Exporting Monolithic CKL files" << std::endl;
ExportCKLsMonolithic(QStringLiteral("tests"));
while (!isProcessingEnabled())
{
QThread::sleep(1);
ProcEvents();
}

// save .stigqter file
std::cout << "\tTest " << step++ << ": Saving .stigqter file" << std::endl;
SaveAs(QStringLiteral("tests/test.stigqter"));
Expand Down
2 changes: 1 addition & 1 deletion src/workercklexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void WorkerCKLExport::process()
if (_monolithic)
{
WorkerCKL wc;
wc.AddFilename(QDir(_dirName).filePath(PrintAsset(a) + ".ckl"));
wc.AddFilename(QDir(_dirName).filePath(PrintAsset(a) + "-monolithic.ckl"));
wc.AddAsset(a);
wc.process();
}
Expand Down

0 comments on commit ffc29fe

Please sign in to comment.