diff --git a/src/test/ValentinaTest/ValentinaTest.pro b/src/test/ValentinaTest/ValentinaTest.pro index 97561dc74..bc9f4a99e 100644 --- a/src/test/ValentinaTest/ValentinaTest.pro +++ b/src/test/ValentinaTest/ValentinaTest.pro @@ -52,7 +52,6 @@ DEFINES += SRCDIR=\\\"$$PWD/\\\" SOURCES += \ qttestmainlambda.cpp \ - tst_vdomdocument.cpp \ tst_vposter.cpp \ tst_vspline.cpp \ tst_nameregexp.cpp \ @@ -81,7 +80,6 @@ SOURCES += \ *msvc*:SOURCES += stable.cpp HEADERS += \ - tst_vdomdocument.h \ tst_vposter.h \ tst_vspline.h \ tst_nameregexp.h \ diff --git a/src/test/ValentinaTest/ValentinaTest.qbs b/src/test/ValentinaTest/ValentinaTest.qbs index 8d0d5d455..728cc818b 100644 --- a/src/test/ValentinaTest/ValentinaTest.qbs +++ b/src/test/ValentinaTest/ValentinaTest.qbs @@ -25,7 +25,6 @@ VTestApp { files: [ "qttestmainlambda.cpp", - "tst_vdomdocument.cpp", "tst_vposter.cpp", "tst_vspline.cpp", "tst_nameregexp.cpp", @@ -50,7 +49,6 @@ VTestApp { "tst_vtranslatevars.cpp", "tst_vabstractpiece.cpp", "tst_vtooluniondetails.cpp", - "tst_vdomdocument.h", "tst_vposter.h", "tst_vspline.h", "tst_nameregexp.h", diff --git a/src/test/ValentinaTest/qttestmainlambda.cpp b/src/test/ValentinaTest/qttestmainlambda.cpp index 3415992a3..28ade2488 100644 --- a/src/test/ValentinaTest/qttestmainlambda.cpp +++ b/src/test/ValentinaTest/qttestmainlambda.cpp @@ -43,7 +43,6 @@ #include "tst_varc.h" #include "tst_vcommandline.h" #include "tst_vcubicbezierpath.h" -#include "tst_vdomdocument.h" #include "tst_vellipticalarc.h" #include "tst_vgobject.h" #include "tst_vlayoutdetail.h" @@ -105,7 +104,6 @@ auto main(int argc, char **argv) -> int ASSERT_TEST(new TST_VToolUnionDetails()); ASSERT_TEST(new TST_XSDShema()); ASSERT_TEST(new TST_VSVGPathTokenizer()); - ASSERT_TEST(new TST_VDomDocument()); return status; } diff --git a/src/test/ValentinaTest/tst_vdomdocument.cpp b/src/test/ValentinaTest/tst_vdomdocument.cpp deleted file mode 100644 index e8a3bd99f..000000000 --- a/src/test/ValentinaTest/tst_vdomdocument.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/************************************************************************ - ** - ** @file tst_vdomdocument.cpp - ** @author Roman Telezhynskyi - ** @date 9 1, 2020 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2020 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ -#include "tst_vdomdocument.h" - -#include -#include "../ifc/xml/vdomdocument.h" - -//--------------------------------------------------------------------------------------------------------------------- -TST_VDomDocument::TST_VDomDocument(QObject *parent) - :QObject(parent) -{ -} - -//--------------------------------------------------------------------------------------------------------------------- -void TST_VDomDocument::TestCompareDomElements_data() -{ - QTest::addColumn("element1Content"); - QTest::addColumn("element2Content"); - QTest::addColumn("compare"); - - QTest::newRow("Base point") - << "" - << "" - << true; - - QTest::newRow("Base point. Change attribute order") - << "" - << "" - << true; - - QTest::newRow("Base point. Change attribute value") - << "" - << "" - << false; - - QTest::newRow("Dirrent types") - << "" - << "" - << false; - - QTest::newRow("Equal details") - << "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - << "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - << true; - QTest::newRow("Not equal details") - << "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - << "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - << false; -} - -//--------------------------------------------------------------------------------------------------------------------- -void TST_VDomDocument::TestCompareDomElements() -{ - QFETCH(QString, element1Content); - QFETCH(QString, element2Content); - QFETCH(bool, compare); - - QDomDocument xmlDoc; - - QVERIFY(xmlDoc.setContent(element1Content)); - QDomElement element1 = xmlDoc.firstChild().toElement(); - - QVERIFY(xmlDoc.setContent(element2Content)); - QDomElement element2 = xmlDoc.firstChild().toElement(); - - const bool result = VDomDocument::Compare(element1, element2); - QCOMPARE(compare, result); -} diff --git a/src/test/ValentinaTest/tst_vdomdocument.h b/src/test/ValentinaTest/tst_vdomdocument.h deleted file mode 100644 index 36fa99bca..000000000 --- a/src/test/ValentinaTest/tst_vdomdocument.h +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************ - ** - ** @file tst_vdomdocument.h - ** @author Roman Telezhynskyi - ** @date 9 1, 2020 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentina project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2020 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ -#ifndef TST_VDOMDOCUMENT_H -#define TST_VDOMDOCUMENT_H - -#include - -#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) -#include "../vmisc/defglobal.h" -#endif - -class TST_VDomDocument : public QObject -{ - Q_OBJECT // NOLINT - -public: - explicit TST_VDomDocument(QObject *parent = nullptr); - -private slots: - void TestCompareDomElements_data(); - void TestCompareDomElements(); - -private: - Q_DISABLE_COPY_MOVE(TST_VDomDocument) // NOLINT -}; - -#endif // TST_VDOMDOCUMENT_H