diff options
author | Jake Petroules <jake.petroules@qt.io> | 2016-09-15 18:22:50 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-09-15 18:22:50 +0000 |
commit | eecc5fc52c919d6607e610d858c2749977a1ef75 (patch) | |
tree | dc8c5f6621d6fbaa76bd28c1c127905444ccf50e /tests/auto/corelib/tools | |
parent | 6b3845320a9242481842243f2c019aa11ce396df (diff) | |
parent | 40a1f69e8663fb79560c26cfad5ead45b1b3ee5f (diff) |
Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/dev
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r-- | tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp | 14 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qcollator/qcollator.pro | 2 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qstring/qstring.pro | 2 |
3 files changed, 13 insertions, 5 deletions
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp index 88c505601a..310c5f6fd3 100644 --- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp @@ -778,9 +778,17 @@ void tst_QByteArray::qstrncpy() { QByteArray src(1024, 'a'), dst(1024, 'b'); - // singularities - QCOMPARE(::qstrncpy(0, 0,0), (char*)0); - QCOMPARE(::qstrncpy(dst.data(), 0, 0), (char*)0); + // dst == nullptr + QCOMPARE(::qstrncpy(0, src.data(), 0), (char*)0); + QCOMPARE(::qstrncpy(0, src.data(), 10), (char*)0); + + // src == nullptr + QCOMPARE(::qstrncpy(dst.data(), 0, 0), (char*)0); + QCOMPARE(::qstrncpy(dst.data(), 0, 10), (char*)0); + + // valid pointers, but len == 0 + QCOMPARE(::qstrncpy(dst.data(), src.data(), 0), dst.data()); + QCOMPARE(*dst.data(), 'b'); // must not have written to dst // normal copy QCOMPARE(::qstrncpy(dst.data(), src.data(), src.size()), dst.data()); diff --git a/tests/auto/corelib/tools/qcollator/qcollator.pro b/tests/auto/corelib/tools/qcollator/qcollator.pro index 7725194e3d..2f3995a75f 100644 --- a/tests/auto/corelib/tools/qcollator/qcollator.pro +++ b/tests/auto/corelib/tools/qcollator/qcollator.pro @@ -1,6 +1,6 @@ CONFIG += testcase TARGET = tst_qcollator -QT = core testlib +QT = core-private testlib SOURCES = tst_qcollator.cpp DEFINES += QT_NO_CAST_TO_ASCII qtConfig(icu): DEFINES += QT_USE_ICU diff --git a/tests/auto/corelib/tools/qstring/qstring.pro b/tests/auto/corelib/tools/qstring/qstring.pro index a94ad3405a..ec8a9b5df5 100644 --- a/tests/auto/corelib/tools/qstring/qstring.pro +++ b/tests/auto/corelib/tools/qstring/qstring.pro @@ -1,6 +1,6 @@ CONFIG += testcase TARGET = tst_qstring -QT = core testlib +QT = core-private testlib SOURCES = tst_qstring.cpp DEFINES += QT_NO_CAST_TO_ASCII qtConfig(icu): DEFINES += QT_USE_ICU |