summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/text/qbytearray
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2024-05-08 08:17:16 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2024-05-08 08:17:16 +0300
commit86c62c8f6088ec148512457cb7e964661ba643b0 (patch)
tree15f82dc1436a5dd229fed729e15afb18bfafde62 /tests/auto/corelib/text/qbytearray
parent4e158f6bfa7d0747d8da70b3b15a44b52e35bb8a (diff)
parent5ca8cfaa56043163997be2a6188812a8cd1c289c (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.14' into tqtc/lts-5.15-opensourcev5.15.14-lts-lgpl5.15
Diffstat (limited to 'tests/auto/corelib/text/qbytearray')
-rw-r--r--tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
index ba1c77231f..d8aa17d9ef 100644
--- a/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
@@ -914,7 +914,10 @@ void tst_QByteArray::qstrncpy()
// src == nullptr
QCOMPARE(::qstrncpy(dst.data(), 0, 0), (char*)0);
+ QCOMPARE(*dst.data(), 'b'); // must not have written to dst
QCOMPARE(::qstrncpy(dst.data(), 0, 10), (char*)0);
+ QCOMPARE(*dst.data(), '\0'); // must have written to dst
+ *dst.data() = 'b'; // restore
// valid pointers, but len == 0
QCOMPARE(::qstrncpy(dst.data(), src.data(), 0), dst.data());