diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-26 14:30:06 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-27 13:39:37 (GMT) |
commit | b88141c7505e10ffaa25cc20b444da8e2cc6d9c7 (patch) | |
tree | 93a7e8ba8998ed7f7a32e2445e792aa44636be12 /src/testlib/qplaintestlogger.cpp | |
parent | 97f7c9afb295140a7d979203f41d91082ee73cd9 (diff) | |
download | Qt-b88141c7505e10ffaa25cc20b444da8e2cc6d9c7.zip Qt-b88141c7505e10ffaa25cc20b444da8e2cc6d9c7.tar.gz Qt-b88141c7505e10ffaa25cc20b444da8e2cc6d9c7.tar.bz2 |
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/qplaintestlogger.cpp')
-rw-r--r-- | src/testlib/qplaintestlogger.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index e244690..46431a8 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]; |