diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-11-22 17:41:08 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-12-18 17:22:11 +0100 |
commit | 3839255e1c11c78046896a37948cda849b0c5bc8 (patch) | |
tree | ba56e4d0074536b356b03b28c2289cd1bc87d6c7 /tests/auto/xmlpatternssdk/TestCase.cpp | |
parent | 0e44a69b3546f259cd01bac1a5d10e86b287eb45 (diff) | |
download | qtxmlpatterns-3839255e1c11c78046896a37948cda849b0c5bc8.tar.gz |
Stop using SAX classes for writing XML in tests
Removed the dependency of XMLWriter from QXmlContentHandler and
QXmlLexicalHandler which are about to be deprecated. There's no need
in inheriting from these interfaces, the tests call the methods of
XMLWriter directly via XMLWriter instance.
Task-number: QTBUG-76177
Change-Id: I2fe237b962774a004a9014f3dab1b5de5072f180
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/xmlpatternssdk/TestCase.cpp')
-rw-r--r-- | tests/auto/xmlpatternssdk/TestCase.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/auto/xmlpatternssdk/TestCase.cpp b/tests/auto/xmlpatternssdk/TestCase.cpp index bf9241c..6827f36 100644 --- a/tests/auto/xmlpatternssdk/TestCase.cpp +++ b/tests/auto/xmlpatternssdk/TestCase.cpp @@ -336,12 +336,11 @@ TestCase::Scenario TestCase::scenarioFromString(const QString &string) void TestCase::toXML(XMLWriter &receiver) const { /* <test-case> */ - QXmlAttributes test_caseAtts; - test_caseAtts.append(QLatin1String("is-XPath2"), QString(), - QLatin1String("is-XPath2"), isXPath() ? QLatin1String("true") + QXmlStreamAttributes test_caseAtts; + test_caseAtts.append(QLatin1String("is-XPath2"), isXPath() ? QLatin1String("true") : QLatin1String("false")); - test_caseAtts.append(QLatin1String("name"), QString(), QLatin1String("name"), name()); - test_caseAtts.append(QLatin1String("creator"), QString(), QLatin1String("creator"), creator()); + test_caseAtts.append(QLatin1String("name"), name()); + test_caseAtts.append(QLatin1String("creator"), creator()); QString scen; switch(scenario()) { @@ -368,9 +367,8 @@ void TestCase::toXML(XMLWriter &receiver) const default: /* includes 'AnyError' */ Q_ASSERT(false); } - test_caseAtts.append(QLatin1String("scenario"), QString(), QLatin1String("scenario"), scen); - test_caseAtts.append(QLatin1String(QLatin1String("FilePath")), QString(), - QLatin1String("FilePath"), QString()); + test_caseAtts.append(QLatin1String("scenario"), scen); + test_caseAtts.append(QLatin1String("FilePath"), QString()); receiver.startElement(QLatin1String("test-case"), test_caseAtts); /* <description> */ @@ -381,10 +379,10 @@ void TestCase::toXML(XMLWriter &receiver) const receiver.endElement(QLatin1String("description")); /* <query> */ - QXmlAttributes queryAtts; - queryAtts.append(QLatin1String("date"), QString(), QLatin1String("date"), /* This date is a dummy. */ + QXmlStreamAttributes queryAtts; + queryAtts.append(QLatin1String("date"), /* This date is a dummy. */ QDate::currentDate().toString(Qt::ISODate)); - queryAtts.append(QLatin1String("name"), QString(), QLatin1String("name"), testCasePath().toString()); + queryAtts.append(QLatin1String("name"), testCasePath().toString()); receiver.startElement(QLatin1String("query"), queryAtts); /* </query> */ |