Convert qDebug() to report_info() in testing code

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-03-26 14:05:35 +01:00 committed by bstoeger
parent 4de109bbf1
commit 6dd5ec296d
3 changed files with 14 additions and 14 deletions

View file

@ -6,6 +6,7 @@
#include "core/dive.h"
#include "core/divelist.h"
#include "core/divelog.h"
#include "core/errorhelper.h"
#include "core/file.h"
#include "core/subsurface-string.h"
#include "core/format.h"
@ -19,7 +20,6 @@
#include <QTextStream>
#include <QNetworkProxy>
#include <QTextCodec>
#include <QDebug>
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
#include <QRandomGenerator>
#endif
@ -132,8 +132,8 @@ void TestGitStorage::initTestCase()
cloudTestRepo = gitUrl + "[" + randomBranch + ']';
localCacheDir = get_local_dir(gitUrl.c_str(), randomBranch.c_str());
localCacheRepo = localCacheDir + "[" + randomBranch + "]";
qDebug() << "repo used:" << cloudTestRepo.c_str();
qDebug() << "local cache:" << localCacheRepo.c_str();
report_info("repo used: %s", cloudTestRepo.c_str());
report_info("local cache: %s", localCacheRepo.c_str());
// make sure we deal with any proxy settings that are needed
QNetworkProxy proxy;

View file

@ -3,13 +3,13 @@
#include "core/device.h"
#include "core/divelog.h"
#include "core/divesite.h"
#include "core/errorhelper.h"
#include "core/trip.h"
#include "core/file.h"
#include "core/git-access.h"
#include "core/settings/qPrefProxy.h"
#include "core/settings/qPrefCloudStorage.h"
#include <QFile>
#include <QDebug>
#include <QNetworkProxy>
#include "QTextCodec"
@ -61,8 +61,8 @@ void TestParsePerformance::parseSsrf()
// parsing of a V2 file should work
QFile largeSsrfFile(SUBSURFACE_TEST_DATA "/dives/large-anon.ssrf");
if (!largeSsrfFile.exists()) {
qDebug() << "missing large sample data file - available at " LARGE_TEST_REPO;
qDebug() << "clone the repo, uncompress the file and copy it to " SUBSURFACE_TEST_DATA "/dives/large-anon.ssrf";
report_info("missing large sample data file - available at " LARGE_TEST_REPO);
report_info("clone the repo, uncompress the file and copy it to " SUBSURFACE_TEST_DATA "/dives/large-anon.ssrf");
return;
}
QBENCHMARK {

View file

@ -3,11 +3,11 @@
#include "core/deco.h"
#include "core/dive.h"
#include "core/event.h"
#include "core/errorhelper.h"
#include "core/planner.h"
#include "core/qthelper.h"
#include "core/subsurfacestartup.h"
#include "core/units.h"
#include <QDebug>
#define DEBUG 1
@ -425,18 +425,18 @@ bool compareDecoTime(int actualRunTimeSeconds, int benchmarkRunTimeSeconds, int
int totalDifferenceAllowed = lrint(0.001 * permilDifferenceAllowed * benchmarkRunTimeSeconds + absoluteDifferenceAllowedSeconds);
int totalDifference = abs(actualRunTimeSeconds - benchmarkRunTimeSeconds);
qDebug("Calculated run time = %d seconds", actualRunTimeSeconds);
qDebug("Expected run time = %d seconds", benchmarkRunTimeSeconds);
qDebug("Allowed time difference is %g percent plus %d seconds = %d seconds",
report_info("Calculated run time = %d seconds", actualRunTimeSeconds);
report_info("Expected run time = %d seconds", benchmarkRunTimeSeconds);
report_info("Allowed time difference is %g percent plus %d seconds = %d seconds",
permilDifferenceAllowed * 0.1, absoluteDifferenceAllowedSeconds, totalDifferenceAllowed);
qDebug("total difference = %d seconds", totalDifference);
report_info("total difference = %d seconds", totalDifference);
result = (totalDifference <= totalDifferenceAllowed);
}
if ((knownSsrfRunTimeSeconds > 0) && (actualRunTimeSeconds != knownSsrfRunTimeSeconds)) {
QWARN("Calculated run time does not match known Subsurface runtime");
qWarning("Calculated runtime: %d", actualRunTimeSeconds);
qWarning("Known Subsurface runtime: %d", knownSsrfRunTimeSeconds);
report_error("Calculated run time does not match known Subsurface runtime");
report_error("Calculated runtime: %d", actualRunTimeSeconds);
report_error("Known Subsurface runtime: %d", knownSsrfRunTimeSeconds);
}
return result;
}