summaryrefslogtreecommitdiff
path: root/src/testlib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-01-26 15:30:06 +0100
committerThiago Macieira <thiago.macieira@nokia.com>2010-01-27 14:39:37 +0100
commitb88141c7505e10ffaa25cc20b444da8e2cc6d9c7 (patch)
tree93a7e8ba8998ed7f7a32e2445e792aa44636be12 /src/testlib
parent97f7c9afb295140a7d979203f41d91082ee73cd9 (diff)
downloadqt4-tools-b88141c7505e10ffaa25cc20b444da8e2cc6d9c7.tar.gz
BenchLib: update the result format and self-test.
Since BenchLib now uses floating point for its calculations, we should format both the value per-iteration and the total the same way. Otherwise, it would output something like "2e+08" for the total. Reviewed-by: Morten Sørvig
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qplaintestlogger.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index e244690de7..46431a8586 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -362,9 +362,10 @@ namespace QTest {
char buf3[1024];
Q_ASSERT(result.iterations > 0);
+ formatResult(resultBuffer, 100, result.value, countSignificantDigits(result.value));
QTest::qt_snprintf(
buf3, sizeof(buf3), " (total: %s, iterations: %d)",
- QByteArray::number(result.value).constData(), // no 64-bit qt_snprintf support
+ resultBuffer,
result.iterations);
char buf[1024];