summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/kernel/qdnslookup
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-03-02 15:29:13 -0800
committerThiago Macieira <thiago.macieira@intel.com>2015-03-26 06:11:17 +0000
commit7b2a1aec03aff54143e74c347f1891a94f2c97c0 (patch)
tree6bb37b7d654f882355971589256e6723966c392f /tests/auto/network/kernel/qdnslookup
parente1c99e15b6bc3363b748e3845cfb0c5f96f8fe90 (diff)
tst_QDnsLookup: Use a different character from space in TXT multi
When in commit db15341d273730298ab5af03b59e9ea1cca782be I added support for testing TXT, I used the space character to make it easy to concatenate the records. Unfortunately, that means it's easy to false- positive the test by creating one record with a single entry containing a space instead of two entries. So use the NULL character instead. Change-Id: Ia0aac2f09e9245339951ffff13c7d239ea83583d Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org> Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'tests/auto/network/kernel/qdnslookup')
-rw-r--r--tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp b/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp
index e13c80c719..42e1bf93b5 100644
--- a/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp
+++ b/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp
@@ -166,7 +166,8 @@ void tst_QDnsLookup::lookup_data()
QTest::newRow("txt-empty") << int(QDnsLookup::TXT) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << "" << "" << "";
QTest::newRow("txt-notfound") << int(QDnsLookup::TXT) << "invalid.invalid" << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << "";
QTest::newRow("txt-single") << int(QDnsLookup::TXT) << "txt-single" << int(QDnsLookup::NoError) << "" << "" << "" << "" << "" << "" << "Hello";
- QTest::newRow("txt-multi-onerr") << int(QDnsLookup::TXT) << "txt-multi-onerr" << int(QDnsLookup::NoError) << "" << "" << "" << "" << "" << "" << "Hello World";
+ QTest::newRow("txt-multi-onerr") << int(QDnsLookup::TXT) << "txt-multi-onerr" << int(QDnsLookup::NoError) << "" << "" << "" << "" << "" << ""
+ << QString::fromLatin1("Hello\0World", sizeof("Hello\0World") - 1);
QTest::newRow("txt-multi-multirr") << int(QDnsLookup::TXT) << "txt-multi-multirr" << int(QDnsLookup::NoError) << "" << "" << "" << "" << "" << "" << "Hello;World";
}
@@ -315,7 +316,7 @@ void tst_QDnsLookup::lookup()
QString text;
foreach (const QByteArray &ba, record.values()) {
if (!text.isEmpty())
- text += ' ';
+ text += '\0';
text += QString::fromLatin1(ba);
}
texts << text;