summaryrefslogtreecommitdiffstats
path: root/tests/auto/xml/sax
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-11-07 17:26:55 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2020-01-06 18:13:01 +0100
commit82d02b7b95908dec16e41c5af1c63579729c589b (patch)
tree6f78be54709ea918c63e265c61d236be88fbb1f0 /tests/auto/xml/sax
parent844ef184e8021237280a45ead04a3ab39cefa657 (diff)
Deprecate SAX classes in Qt XML
Deprecated the SAX classes and disabled or replaced their uses in tests if applicable. Removed the saxbookmarks example, no point in keeping examples for the deprecated code. [ChangeLog][QtXml] SAX classes are now deprecated. Use QXmlStreamReader, QXmlStreamWriter in QtCore instead. Task-number: QTBUG-76177 Change-Id: Ic171d62fa0527b0f36f94cf09a69586092269957 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'tests/auto/xml/sax')
-rw-r--r--tests/auto/xml/sax/qxml/tst_qxml.cpp7
-rw-r--r--tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp8
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp10
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/parser/parser.h6
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp9
5 files changed, 37 insertions, 3 deletions
diff --git a/tests/auto/xml/sax/qxml/tst_qxml.cpp b/tests/auto/xml/sax/qxml/tst_qxml.cpp
index 1cdb9701fa..db6584edda 100644
--- a/tests/auto/xml/sax/qxml/tst_qxml.cpp
+++ b/tests/auto/xml/sax/qxml/tst_qxml.cpp
@@ -26,7 +26,6 @@
**
****************************************************************************/
-
#include <QtTest/QtTest>
#include <qcoreapplication.h>
@@ -38,13 +37,17 @@ class tst_QXml : public QObject
Q_OBJECT
private slots:
+#if QT_DEPRECATED_SINCE(5, 15)
void getSetCheck();
void interpretedAs0D() const;
#ifndef QT_NO_EXCEPTIONS
void exception();
#endif
+#endif // QT_DEPRECATED_SINCE(5, 15)
};
+#if QT_DEPRECATED_SINCE(5, 15)
+
class MyXmlEntityResolver : public QXmlEntityResolver
{
public:
@@ -225,5 +228,7 @@ void tst_QXml::exception()
}
#endif
+#endif // QT_DEPRECATED_SINCE(5, 15)
+
QTEST_MAIN(tst_QXml)
#include "tst_qxml.moc"
diff --git a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
index d40c8c2fd6..afdcc825d8 100644
--- a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
+++ b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
@@ -45,13 +45,18 @@ class tst_QXmlInputSource : public QObject
{
Q_OBJECT
+#if QT_DEPRECATED_SINCE(5, 15)
private slots:
void reset() const;
void resetSimplified() const;
void waitForReadyIODevice() const;
void inputFromSlowDevice() const;
+#endif // QT_DEPRECATED_SINCE(5, 15)
};
+#if QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
/*!
\internal
\since 4.4
@@ -292,5 +297,8 @@ void tst_QXmlInputSource::inputFromSlowDevice() const
QCOMPARE(data, expectedData);
}
+QT_WARNING_POP
+#endif // QT_DEPRECATED_SINCE(5, 15)
+
QTEST_MAIN(tst_QXmlInputSource)
#include "tst_qxmlinputsource.moc"
diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp
index 556603a681..44f8101955 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp
+++ b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp
@@ -26,12 +26,15 @@
**
****************************************************************************/
+#include "parser.h"
+
+#if QT_DEPRECATED_SINCE(5, 15)
#include <qxml.h>
#include <qregularexpression.h>
-#include "parser.h"
-
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
class ContentHandler : public QXmlDefaultHandler
{
public:
@@ -440,3 +443,6 @@ QString Parser::errorMsg() const
{
return handler->errorMsg();
}
+
+QT_WARNING_POP
+#endif // QT_DEPRECATED_SINCE(5, 15)
diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.h b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.h
index 604678f06b..9c51cdf095 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.h
+++ b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.h
@@ -28,6 +28,10 @@
#ifndef PARSER_H
#define PARSER_H
+#include <qglobal.h>
+
+#if QT_DEPRECATED_SINCE(5, 15)
+
#include <qfile.h>
#include <qstring.h>
#include <qxml.h>
@@ -48,4 +52,6 @@ private:
ContentHandler *handler;
};
+#endif // QT_DEPRECATED_SINCE(5, 15)
+
#endif
diff --git a/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
index 8c4c6c7179..cea4e3c8b8 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
+++ b/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
@@ -127,6 +127,7 @@ class tst_QXmlSimpleReader : public QObject
{
Q_OBJECT
+#if QT_DEPRECATED_SINCE(5, 15)
public:
tst_QXmlSimpleReader();
~tst_QXmlSimpleReader();
@@ -157,8 +158,13 @@ class tst_QXmlSimpleReader : public QObject
static QDomDocument fromByteArray(const QString &title, const QByteArray &ba, bool *ok);
XmlServer *server;
QString prefix;
+#endif // QT_DEPRECATED_SINCE(5, 15)
};
+#if QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+
tst_QXmlSimpleReader::tst_QXmlSimpleReader() : server(new XmlServer(this))
{
server->start();
@@ -820,5 +826,8 @@ void tst_QXmlSimpleReader::dtdRecursionLimit()
}
}
+QT_WARNING_POP
+#endif // QT_DEPRECATED_SINCE(5, 15)
+
QTEST_MAIN(tst_QXmlSimpleReader)
#include "tst_qxmlsimplereader.moc"