Commit 224b22e8 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Remove macro DEBUG_CODE from Test SDK.


It was used to disable code/variables referenced in Q_ASSERT_X.
Since the macro is now expanded in release mode as well, this
causes compilation errors.

Change-Id: I5b90515c042f9d3e76be84cd5385eae081a037c8
Reviewed-by: default avatarLouai Al-Khanji <louai.al-khanji@theqtcompany.com>
Showing with 5 additions and 11 deletions
...@@ -76,12 +76,6 @@ using namespace QPatternistSDK; ...@@ -76,12 +76,6 @@ using namespace QPatternistSDK;
typedef QPair<QString, QString> NSBinding; typedef QPair<QString, QString> NSBinding;
typedef QList<NSBinding> NSBindingList; typedef QList<NSBinding> NSBindingList;
#ifdef QT_NO_DEBUG
# define DEBUG_CODE(code)
#else
# define DEBUG_CODE(code) code
#endif
class XMLWriter::Private class XMLWriter::Private
{ {
public: public:
...@@ -290,8 +284,8 @@ public: ...@@ -290,8 +284,8 @@ public:
QIODevice *dev; QIODevice *dev;
QStack<bool> hasContentStack; QStack<bool> hasContentStack;
QString errorString; QString errorString;
DEBUG_CODE(QStack<QString> tags;) QStack<QString> tags;
DEBUG_CODE(QStack<NSBindingList> namespaceTracker;) QStack<NSBindingList> namespaceTracker;
}; };
/** /**
...@@ -364,8 +358,8 @@ bool XMLWriter::startElement(const QString &qName, ...@@ -364,8 +358,8 @@ bool XMLWriter::startElement(const QString &qName,
serialize('<'); serialize('<');
serialize(qName); serialize(qName);
DEBUG_CODE(d->tags.push(qName)); d->tags.push(qName);
DEBUG_CODE(d->namespaceTracker.push(d->namespaces)); d->namespaceTracker.push(d->namespaces);
/* Add namespace declarations. */ /* Add namespace declarations. */
const NSBindingList::const_iterator end(d->namespaces.constEnd()); const NSBindingList::const_iterator end(d->namespaces.constEnd());
...@@ -421,7 +415,7 @@ bool XMLWriter::endElement(const QString &qName) ...@@ -421,7 +415,7 @@ bool XMLWriter::endElement(const QString &qName)
Q_ASSERT_X(d->tags.pop() == qName, Q_FUNC_INFO, Q_ASSERT_X(d->tags.pop() == qName, Q_FUNC_INFO,
"The element tags are not balanced, the produced XML is invalid."); "The element tags are not balanced, the produced XML is invalid.");
DEBUG_CODE(d->namespaceTracker.pop()); d->namespaceTracker.pop();
/* "this" element is content for our parent, so ensure hasElementContent is true. */ /* "this" element is content for our parent, so ensure hasElementContent is true. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment