const char *bmtag = QTest::benchmarkResult2String();
char buf1[1024];
- QTest::qt_snprintf(
+ qsnprintf(
buf1, sizeof(buf1), "%s: %s::%s",
bmtag,
QTestResult::currentTestObjectName(),
bufTag[0] = 0;
QByteArray tag = result.context.tag.toAscii();
if (tag.isEmpty() == false) {
- QTest::qt_snprintf(bufTag, sizeof(bufTag), ":\"%s\"", tag.data());
+ qsnprintf(bufTag, sizeof(bufTag), ":\"%s\"", tag.data());
}
char fillFormat[8];
int fillLength = 5;
- QTest::qt_snprintf(
- fillFormat, sizeof(fillFormat), ":\n%%%ds", fillLength);
+ qsnprintf(fillFormat, sizeof(fillFormat), ":\n%%%ds", fillLength);
char fill[1024];
- QTest::qt_snprintf(fill, sizeof(fill), fillFormat, "");
+ qsnprintf(fill, sizeof(fill), fillFormat, "");
const char * unitText = QTest::benchmarkMetricUnit(result.metric);
QTest::formatResult(resultBuffer, 100, valuePerIteration, QTest::countSignificantDigits(result.value));
char buf2[1024];
- QTest::qt_snprintf(
- buf2, sizeof(buf2), "%s %s",
- resultBuffer,
- unitText);
+ qsnprintf(buf2, sizeof(buf2), "%s %s", resultBuffer, unitText);
char buf2_[1024];
QByteArray iterationText = " per iteration";
Q_ASSERT(result.iterations > 0);
- QTest::qt_snprintf(
- buf2_,
- sizeof(buf2_), "%s",
- iterationText.data());
+ qsnprintf(buf2_, sizeof(buf2_), "%s", iterationText.data());
char buf3[1024];
Q_ASSERT(result.iterations > 0);
QTest::formatResult(resultBuffer, 100, result.value, QTest::countSignificantDigits(result.value));
- QTest::qt_snprintf(
- buf3, sizeof(buf3), " (total: %s, iterations: %d)",
- resultBuffer,
- result.iterations);
+ qsnprintf(buf3, sizeof(buf3), " (total: %s, iterations: %d)", resultBuffer, result.iterations);
char buf[1024];
if (result.setByMacro) {
- QTest::qt_snprintf(
- buf, sizeof(buf), "%s%s%s%s%s%s\n", buf1, bufTag, fill, buf2, buf2_, buf3);
+ qsnprintf(buf, sizeof(buf), "%s%s%s%s%s%s\n", buf1, bufTag, fill, buf2, buf2_, buf3);
} else {
- QTest::qt_snprintf(buf, sizeof(buf), "%s%s%s%s\n", buf1, bufTag, fill, buf2);
+ qsnprintf(buf, sizeof(buf), "%s%s%s%s\n", buf1, bufTag, fill, buf2);
}
memcpy(buf, bmtag, strlen(bmtag));
char buf[1024];
if (QTestLog::verboseLevel() < 0) {
- QTest::qt_snprintf(buf, sizeof(buf), "Testing %s\n",
- QTestResult::currentTestObjectName());
+ qsnprintf(buf, sizeof(buf), "Testing %s\n", QTestResult::currentTestObjectName());
} else {
- QTest::qt_snprintf(buf, sizeof(buf),
- "********* Start testing of %s *********\n"
- "Config: Using QTest library " QTEST_VERSION_STR
- ", Qt %s\n", QTestResult::currentTestObjectName(), qVersion());
+ qsnprintf(buf, sizeof(buf),
+ "********* Start testing of %s *********\n"
+ "Config: Using QTest library " QTEST_VERSION_STR
+ ", Qt %s\n", QTestResult::currentTestObjectName(), qVersion());
}
outputMessage(buf);
}
{
char buf[1024];
if (QTestLog::verboseLevel() < 0) {
- QTest::qt_snprintf(buf, sizeof(buf), "Totals: %d passed, %d failed, %d skipped\n",
- QTestResult::passCount(), QTestResult::failCount(),
- QTestResult::skipCount());
+ qsnprintf(buf, sizeof(buf), "Totals: %d passed, %d failed, %d skipped\n",
+ QTestResult::passCount(), QTestResult::failCount(),
+ QTestResult::skipCount());
} else {
- QTest::qt_snprintf(buf, sizeof(buf),
- "Totals: %d passed, %d failed, %d skipped\n"
- "********* Finished testing of %s *********\n",
- QTestResult::passCount(), QTestResult::failCount(),
- QTestResult::skipCount(), QTestResult::currentTestObjectName());
+ qsnprintf(buf, sizeof(buf),
+ "Totals: %d passed, %d failed, %d skipped\n"
+ "********* Finished testing of %s *********\n",
+ QTestResult::passCount(), QTestResult::failCount(),
+ QTestResult::skipCount(), QTestResult::currentTestObjectName());
}
outputMessage(buf);
msg[0] = '\0';
bool isOk = true;
if (t1.count() != t2.count()) {
- qt_snprintf(msg, 1024, "Compared QStringLists have different sizes.\n"
- " Actual (%s) size : '%d'\n"
- " Expected (%s) size: '%d'", actual, t1.count(), expected, t2.count());
+ qsnprintf(msg, 1024, "Compared QStringLists have different sizes.\n"
+ " Actual (%s) size : '%d'\n"
+ " Expected (%s) size: '%d'", actual, t1.count(), expected, t2.count());
isOk = false;
}
const int min = qMin(t1.count(), t2.count());
for (int i = 0; isOk && i < min; ++i) {
if (t1.at(i) != t2.at(i)) {
- qt_snprintf(msg, 1024, "Compared QStringLists differ at index %d.\n"
- " Actual (%s) : '%s'\n"
- " Expected (%s) : '%s'", i, actual, t1.at(i).toLatin1().constData(),
- expected, t2.at(i).toLatin1().constData());
+ qsnprintf(msg, 1024, "Compared QStringLists differ at index %d.\n"
+ " Actual (%s) : '%s'\n"
+ " Expected (%s) : '%s'", i, actual, t1.at(i).toLatin1().constData(),
+ expected, t2.at(i).toLatin1().constData());
isOk = false;
}
}
slot[strlen(slot) - 2] = '\0';
QByteArray member;
member.resize(qstrlen(slot) + qstrlen("_data()") + 1);
- QTest::qt_snprintf(member.data(), member.size(), "%s_data()", slot);
+ qsnprintf(member.data(), member.size(), "%s_data()", slot);
invokeMethod(QTest::currentTestObject, member.constData());
for (int j = 0; j < table.dataCount(); ++j)
localTags << QLatin1String(table.testData(j)->dataTag());
if (colon != -1) {
data = qstrdup(argv[i]+colon+1);
}
- QTest::qt_snprintf(buf, qMin(512, off + 1), "%s", argv[i]); // copy text before the ':' into buf
- QTest::qt_snprintf(buf + off, qMin(512 - off, 3), "()"); // append "()"
+ qsnprintf(buf, qMin(512, off + 1), "%s", argv[i]); // copy text before the ':' into buf
+ qsnprintf(buf + off, qMin(512 - off, 3), "()"); // append "()"
int idx = QTest::currentTestObject->metaObject()->indexOfMethod(buf);
if (idx < 0 || !isValidSlot(QTest::currentTestObject->metaObject()->method(idx))) {
fprintf(stderr, "Unknown testfunction: '%s'\n", buf);
if (curGlobalDataIndex == 0) {
QTestResult::setCurrentTestLocation(QTestResult::DataFunc);
- QTest::qt_snprintf(member, 512, "%s_data()", slot);
+ qsnprintf(member, 512, "%s_data()", slot);
invokeMethod(QTest::currentTestObject, member);
}
template <> Q_TESTLIB_EXPORT char *QTest::toString<TYPE >(const TYPE &t) \
{ \
char *msg = new char[128]; \
- qt_snprintf(msg, 128, #FORMAT, t); \
+ qsnprintf(msg, 128, #FORMAT, t); \
return msg; \
}
char *QTest::toString(const void *p)
{
char *msg = new char[128];
- qt_snprintf(msg, 128, "%p", p);
+ qsnprintf(msg, 128, "%p", p);
return msg;
}
char msg[1024];
QTest::IgnoreResultList *list = QTest::ignoreResultList;
while (list) {
- QTest::qt_snprintf(msg, 1024, "Did not receive message: \"%s\"", list->msg);
+ qsnprintf(msg, 1024, "Did not receive message: \"%s\"", list->msg);
QTest::TestLoggers::addMessage(QAbstractTestLogger::Info, msg);
list = list->next;
char msg[1024];
if (QTestLog::verboseLevel() >= 2) {
- QTest::qt_snprintf(msg, 1024, "QVERIFY(%s)", statementStr);
+ qsnprintf(msg, 1024, "QVERIFY(%s)", statementStr);
QTestLog::info(msg, file, line);
}
- QTest::qt_snprintf(msg, 1024, "'%s' returned FALSE. (%s)", statementStr, description);
+ qsnprintf(msg, 1024, "'%s' returned FALSE. (%s)", statementStr, description);
return checkStatement(statement, msg, file, line);
}
return compare(success, msg, file, line);
char buf[1024];
- QTest::qt_snprintf(buf, 1024, "%s\n Actual (%s): %s\n Expected (%s): %s", msg,
- actual, val1 ? val1 : "<null>",
- expected, val2 ? val2 : "<null>");
+ qsnprintf(buf, 1024, "%s\n Actual (%s): %s\n Expected (%s): %s", msg,
+ actual, val1 ? val1 : "<null>",
+ expected, val2 ? val2 : "<null>");
delete [] val1;
delete [] val2;
return compare(success, buf, file, line);
QTest::benchmarkResultFormatString(),
quotedMetric.constData(),
quotedTag.constData(),
- QByteArray::number(result.value).constData(), //no 64-bit qt_snprintf support
+ QByteArray::number(result.value).constData(), //no 64-bit qsnprintf support
result.iterations);
outputString(buf.constData());
}
currentLogElement = new QTestElement(QTest::LET_TestSuite);
currentLogElement->addAttribute(QTest::AI_Name, QTestResult::currentTestObjectName());
- QTest::qt_snprintf(buf, sizeof(buf), "%i", testCounter);
+ qsnprintf(buf, sizeof(buf), "%i", testCounter);
currentLogElement->addAttribute(QTest::AI_Tests, buf);
- QTest::qt_snprintf(buf, sizeof(buf), "%i", failureCounter);
+ qsnprintf(buf, sizeof(buf), "%i", failureCounter);
currentLogElement->addAttribute(QTest::AI_Failures, buf);
- QTest::qt_snprintf(buf, sizeof(buf), "%i", errorCounter);
+ qsnprintf(buf, sizeof(buf), "%i", errorCounter);
currentLogElement->addAttribute(QTest::AI_Errors, buf);
QTestElement *property;
failureElement->addAttribute(QTest::AI_File, file);
else
failureElement->addAttribute(QTest::AI_File, "");
- QTest::qt_snprintf(buf, sizeof(buf), "%i", line);
+ qsnprintf(buf, sizeof(buf), "%i", line);
failureElement->addAttribute(QTest::AI_Line, buf);
failureElement->addAttribute(QTest::AI_Description, description);
addTag(failureElement);
else
currentLogElement->addAttribute(QTest::AI_File, "");
- QTest::qt_snprintf(buf, sizeof(buf), "%i", line);
+ qsnprintf(buf, sizeof(buf), "%i", line);
currentLogElement->addAttribute(QTest::AI_Line, buf);
/*
benchmarkElement->addAttribute(QTest::AI_Value, QByteArray::number(result.value).constData());
char buf[100];
- QTest::qt_snprintf(buf, sizeof(buf), "%i", result.iterations);
+ qsnprintf(buf, sizeof(buf), "%i", result.iterations);
benchmarkElement->addAttribute(QTest::AI_Iterations, buf);
currentLogElement->addLogElement(benchmarkElement);
}
errorElement->addAttribute(QTest::AI_File, "");
char buf[100];
- QTest::qt_snprintf(buf, sizeof(buf), "%i", line);
+ qsnprintf(buf, sizeof(buf), "%i", line);
errorElement->addAttribute(QTest::AI_Line, buf);
currentLogElement->addLogElement(errorElement);