Changeset 846 for trunk/src/testlib/qplaintestlogger.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/testlib/qplaintestlogger.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 #include "QtTest/private/qplaintestlogger_p.h" 46 46 #include "QtTest/private/qbenchmark_p.h" 47 #include "QtTest/private/qbenchmarkmetric_p.h" 47 48 48 49 #include <stdarg.h> … … 326 327 result.context.slotName.toAscii().data()); 327 328 328 329 329 char bufTag[1024]; 330 330 bufTag[0] = 0; … … 342 342 QTest::qt_snprintf(fill, sizeof(fill), fillFormat, ""); 343 343 344 345 QByteArray unitText = QBenchmarkGlobalData::current->measurer->unitText().toAscii(); 344 const char * unitText = QTest::benchmarkMetricUnit(result.metric); 346 345 347 346 qreal valuePerIteration = qreal(result.value) / qreal(result.iterations); … … 349 348 formatResult(resultBuffer, 100, valuePerIteration, countSignificantDigits(result.value)); 350 349 351 QByteArray iterationText = "per iteration";352 353 350 char buf2[1024]; 351 QTest::qt_snprintf( 352 buf2, sizeof(buf2), "%s %s", 353 resultBuffer, 354 unitText); 355 356 char buf2_[1024]; 357 QByteArray iterationText = " per iteration"; 354 358 Q_ASSERT(result.iterations > 0); 355 359 QTest::qt_snprintf( 356 buf2, sizeof(buf2), "%s %s %s", 357 resultBuffer, 358 unitText.data(), 360 buf2_, 361 sizeof(buf2_), "%s", 359 362 iterationText.data()); 360 363 361 364 char buf3[1024]; 362 365 Q_ASSERT(result.iterations > 0); 366 formatResult(resultBuffer, 100, result.value, countSignificantDigits(result.value)); 363 367 QTest::qt_snprintf( 364 buf3, sizeof(buf3), " (total: %s, iterations: %d) \n",365 QByteArray::number(result.value).constData(), // no 64-bit qt_snprintf support368 buf3, sizeof(buf3), " (total: %s, iterations: %d)", 369 resultBuffer, 366 370 result.iterations); 367 371 368 372 char buf[1024]; 369 QTest::qt_snprintf(buf, sizeof(buf), "%s%s%s%s%s", buf1, bufTag, fill, buf2, buf3); 373 374 if (result.setByMacro) { 375 QTest::qt_snprintf( 376 buf, sizeof(buf), "%s%s%s%s%s%s\n", buf1, bufTag, fill, buf2, buf2_, buf3); 377 } else { 378 QTest::qt_snprintf(buf, sizeof(buf), "%s%s%s%s\n", buf1, bufTag, fill, buf2); 379 } 380 370 381 memcpy(buf, bmtag, strlen(bmtag)); 371 382 outputMessage(buf);
Note:
See TracChangeset
for help on using the changeset viewer.