From 7b2a1aec03aff54143e74c347f1891a94f2c97c0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 2 Mar 2015 15:29:13 -0800 Subject: tst_QDnsLookup: Use a different character from space in TXT multi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é Reviewed-by: Richard J. Moore --- tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') 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; -- cgit v1.2.3