summaryrefslogtreecommitdiffstats
path: root/tests/auto/xmlpatternssdk/Worker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/xmlpatternssdk/Worker.cpp')
-rw-r--r--tests/auto/xmlpatternssdk/Worker.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/xmlpatternssdk/Worker.cpp b/tests/auto/xmlpatternssdk/Worker.cpp
index f2051cc..4fb7da7 100644
--- a/tests/auto/xmlpatternssdk/Worker.cpp
+++ b/tests/auto/xmlpatternssdk/Worker.cpp
@@ -183,7 +183,7 @@ void Worker::threadFinished()
const int totPass = count(m_result, TestResult::Pass);
const int total = resultCount;
const int notTested = m_notTested.count();
- const int percentage = int((static_cast<double>(totPass) / total) * 100);
+ const int percentage = total==0 ? 0 : int((static_cast<double>(totPass) / total) * 100);
Q_ASSERT_X(percentage >= 0 && percentage <= 100, Q_FUNC_INFO,
qPrintable(QString(QLatin1String("Percentage was: %1")).arg(percentage)));