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>
This commit is contained in:
parent
e1c99e15b6
commit
7b2a1aec03
@ -166,7 +166,8 @@ void tst_QDnsLookup::lookup_data()
|
|||||||
QTest::newRow("txt-empty") << int(QDnsLookup::TXT) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << "" << "" << "";
|
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-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-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";
|
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;
|
QString text;
|
||||||
foreach (const QByteArray &ba, record.values()) {
|
foreach (const QByteArray &ba, record.values()) {
|
||||||
if (!text.isEmpty())
|
if (!text.isEmpty())
|
||||||
text += ' ';
|
text += '\0';
|
||||||
text += QString::fromLatin1(ba);
|
text += QString::fromLatin1(ba);
|
||||||
}
|
}
|
||||||
texts << text;
|
texts << text;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user