Remove QTest::qt_snprintf() from testlib API.
This was an internal function that used to act like qsnprintf() but also filtered unprintable characters out of the test output. The filtering has been moved somewhere more appropriate and this function is no longer used by testlib. Unfortunately, the function was exposed in the public API due to its former use in the implementation of a public macro. In the unlikely event that any code outside testlib calls this function, the call should be replaced by calling qsnprintf(), which comes from the QtCore/QByteArray header. Change-Id: Iddc17b4361d16ebddd19346ae7d1064951dd7738 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
parent
be6b29f001
commit
a3109c8b0b
4
dist/changes-5.0.0
vendored
4
dist/changes-5.0.0
vendored
@ -53,6 +53,10 @@ information about a particular change.
|
||||
* The DEPENDS_ON macro has been removed from the API. This macro did nothing
|
||||
and misled some users to believe that they could make test functions depend
|
||||
on each other or impose an execution order on test functions.
|
||||
* The QTest::qt_snprintf function has been removed from the API. This was an
|
||||
internal testlib function that was exposed in the public API due to its use
|
||||
in a public macro. Any calls to this function should be replaced by a call
|
||||
to qsnprintf(), which comes from the <QtCore/QByteArray> header.
|
||||
* The QSKIP macro no longer has the "mode" parameter, which caused problems
|
||||
for calculating test metrics, as the SkipAll mode hid information about
|
||||
what test data was skipped. Calling QSKIP in a test function now behaves
|
||||
|
@ -78,8 +78,6 @@ QT_MODULE(Test)
|
||||
namespace QTest
|
||||
{
|
||||
enum TestFailMode { Abort = 1, Continue = 2 };
|
||||
|
||||
int Q_TESTLIB_EXPORT qt_snprintf(char *str, int size, const char *format, ...);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -986,21 +986,6 @@ namespace QTest
|
||||
static bool noCrashHandler = false;
|
||||
#endif
|
||||
|
||||
/*! \internal
|
||||
*/
|
||||
int qt_snprintf(char *str, int size, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int res = 0;
|
||||
|
||||
va_start(ap, format);
|
||||
qvsnprintf(str, size, format, ap);
|
||||
va_end(ap);
|
||||
str[size - 1] = '\0';
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/*! \internal
|
||||
Invoke a method of the object without generating warning if the method does not exist
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user