Remove buggy test.

This commit is contained in:
Roman Telezhynskyi 2023-08-22 15:38:53 +03:00
parent 904c18a7f9
commit 84844e257b
5 changed files with 0 additions and 215 deletions

View File

@ -52,7 +52,6 @@ DEFINES += SRCDIR=\\\"$$PWD/\\\"
SOURCES += \ SOURCES += \
qttestmainlambda.cpp \ qttestmainlambda.cpp \
tst_vdomdocument.cpp \
tst_vposter.cpp \ tst_vposter.cpp \
tst_vspline.cpp \ tst_vspline.cpp \
tst_nameregexp.cpp \ tst_nameregexp.cpp \
@ -81,7 +80,6 @@ SOURCES += \
*msvc*:SOURCES += stable.cpp *msvc*:SOURCES += stable.cpp
HEADERS += \ HEADERS += \
tst_vdomdocument.h \
tst_vposter.h \ tst_vposter.h \
tst_vspline.h \ tst_vspline.h \
tst_nameregexp.h \ tst_nameregexp.h \

View File

@ -25,7 +25,6 @@ VTestApp {
files: [ files: [
"qttestmainlambda.cpp", "qttestmainlambda.cpp",
"tst_vdomdocument.cpp",
"tst_vposter.cpp", "tst_vposter.cpp",
"tst_vspline.cpp", "tst_vspline.cpp",
"tst_nameregexp.cpp", "tst_nameregexp.cpp",
@ -50,7 +49,6 @@ VTestApp {
"tst_vtranslatevars.cpp", "tst_vtranslatevars.cpp",
"tst_vabstractpiece.cpp", "tst_vabstractpiece.cpp",
"tst_vtooluniondetails.cpp", "tst_vtooluniondetails.cpp",
"tst_vdomdocument.h",
"tst_vposter.h", "tst_vposter.h",
"tst_vspline.h", "tst_vspline.h",
"tst_nameregexp.h", "tst_nameregexp.h",

View File

@ -43,7 +43,6 @@
#include "tst_varc.h" #include "tst_varc.h"
#include "tst_vcommandline.h" #include "tst_vcommandline.h"
#include "tst_vcubicbezierpath.h" #include "tst_vcubicbezierpath.h"
#include "tst_vdomdocument.h"
#include "tst_vellipticalarc.h" #include "tst_vellipticalarc.h"
#include "tst_vgobject.h" #include "tst_vgobject.h"
#include "tst_vlayoutdetail.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_VToolUnionDetails());
ASSERT_TEST(new TST_XSDShema()); ASSERT_TEST(new TST_XSDShema());
ASSERT_TEST(new TST_VSVGPathTokenizer()); ASSERT_TEST(new TST_VSVGPathTokenizer());
ASSERT_TEST(new TST_VDomDocument());
return status; return status;
} }

View File

@ -1,157 +0,0 @@
/************************************************************************
**
** @file tst_vdomdocument.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @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
** <https://gitlab.com/smart-pattern/valentina> 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 <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "tst_vdomdocument.h"
#include <QtTest>
#include "../ifc/xml/vdomdocument.h"
//---------------------------------------------------------------------------------------------------------------------
TST_VDomDocument::TST_VDomDocument(QObject *parent)
:QObject(parent)
{
}
//---------------------------------------------------------------------------------------------------------------------
void TST_VDomDocument::TestCompareDomElements_data()
{
QTest::addColumn<QString>("element1Content");
QTest::addColumn<QString>("element2Content");
QTest::addColumn<bool>("compare");
QTest::newRow("Base point")
<< "<point type=\"single\" x=\"0.819903\" y=\"23.1895\" id=\"1\" name=\"Т\" mx=\"0.132292\" "
"my=\"0.264583\"/>"
<< "<point type=\"single\" x=\"0.819903\" y=\"23.1895\" id=\"1\" name=\"Т\" mx=\"0.132292\" "
"my=\"0.264583\"/>"
<< true;
QTest::newRow("Base point. Change attribute order")
<< "<point type=\"single\" x=\"0.819903\" y=\"23.1895\" id=\"1\" name=\"Т\" mx=\"0.132292\" "
"my=\"0.264583\"/>"
<< "<point type=\"single\" id=\"1\" name=\"Т\" x=\"0.819903\" y=\"23.1895\" mx=\"0.132292\" "
"my=\"0.264583\"/>"
<< true;
QTest::newRow("Base point. Change attribute value")
<< "<point type=\"single\" x=\"0.819903\" y=\"23.1895\" id=\"1\" name=\"Т\" mx=\"0.132292\" "
"my=\"0.264583\"/>"
<< "<point type=\"single\" x=\"0.819903\" y=\"23.1895\" id=\"2\" name=\"Т\" mx=\"0.132292\" "
"my=\"0.264583\"/>"
<< false;
QTest::newRow("Dirrent types")
<< "<point type=\"single\" x=\"0.819903\" y=\"23.1895\" id=\"1\" name=\"Т\" mx=\"0.132292\" "
"my=\"0.264583\"/>"
<< "<spline angle1=\"229.381\" angle2=\"41.6325\" color=\"black\" id=\"4\" kAsm1=\"0.962941\" "
"kAsm2=\"1.00054\" kCurve=\"1\" point1=\"3\" point4=\"2\" type=\"simple\"/>"
<< false;
QTest::newRow("Equal details")
<< "<detail closed=\"1\" forbidFlipping=\"false\" forceFlipping=\"false\" hideMainPath=\"false\" id=\"24\" "
"mx=\"-11.7117\" my=\"4.05406\" name=\"Case 2\" seamAllowance=\"true\" version=\"2\" width=\"1\">"
"<data annotation=\"\" foldPosition=\"\" fontSize=\"0\" height=\"1\" letter=\"\" mx=\"0\" my=\"0\" "
"onFold=\"false\" orientation=\"\" quantity=\"1\" rotation=\"0\" rotationWay=\"\" tilt=\"\" "
"visible=\"false\" width=\"1\"/>"
"<patternInfo fontSize=\"0\" height=\"1\" mx=\"0\" my=\"0\" rotation=\"0\" visible=\"false\" "
"width=\"1\"/>"
"<grainline arrows=\"0\" length=\"1\" mx=\"0\" my=\"0\" rotation=\"90\" visible=\"false\"/>"
"<nodes>"
"<node idObject=\"19\" type=\"NodePoint\"/>"
"<node idObject=\"20\" type=\"NodePoint\"/>"
"<node idObject=\"21\" reverse=\"0\" type=\"NodeSpline\"/>"
"<node idObject=\"22\" type=\"NodePoint\"/>"
"</nodes>"
"</detail>"
<< "<detail closed=\"1\" forbidFlipping=\"false\" forceFlipping=\"false\" hideMainPath=\"false\" id=\"24\" "
"mx=\"-11.7117\" my=\"4.05406\" name=\"Case 2\" seamAllowance=\"true\" version=\"2\" width=\"1\">"
"<data annotation=\"\" foldPosition=\"\" fontSize=\"0\" height=\"1\" letter=\"\" mx=\"0\" my=\"0\" "
"onFold=\"false\" orientation=\"\" quantity=\"1\" rotation=\"0\" rotationWay=\"\" tilt=\"\" "
"visible=\"false\" width=\"1\"/>"
"<patternInfo fontSize=\"0\" height=\"1\" mx=\"0\" my=\"0\" rotation=\"0\" visible=\"false\" "
"width=\"1\"/>"
"<grainline arrows=\"0\" length=\"1\" mx=\"0\" my=\"0\" rotation=\"90\" visible=\"false\"/>"
"<nodes>"
"<node idObject=\"19\" type=\"NodePoint\"/>"
"<node idObject=\"20\" type=\"NodePoint\"/>"
"<node idObject=\"21\" reverse=\"0\" type=\"NodeSpline\"/>"
"<node idObject=\"22\" type=\"NodePoint\"/>"
"</nodes>"
"</detail>"
<< true;
QTest::newRow("Not equal details")
<< "<detail closed=\"1\" forbidFlipping=\"false\" forceFlipping=\"false\" hideMainPath=\"false\" id=\"24\" "
"mx=\"-11.7117\" my=\"4.05406\" name=\"Case 2\" seamAllowance=\"true\" version=\"2\" width=\"1\">"
"<data annotation=\"\" foldPosition=\"\" fontSize=\"0\" height=\"1\" letter=\"\" mx=\"0\" my=\"0\" "
"onFold=\"false\" orientation=\"\" quantity=\"1\" rotation=\"0\" rotationWay=\"\" tilt=\"\" "
"visible=\"false\" width=\"1\"/>"
"<patternInfo fontSize=\"0\" height=\"1\" mx=\"0\" my=\"0\" rotation=\"0\" visible=\"false\" "
"width=\"1\"/>"
"<grainline arrows=\"0\" length=\"1\" mx=\"0\" my=\"0\" rotation=\"90\" visible=\"false\"/>"
"<nodes>"
"<node idObject=\"19\" type=\"NodePoint\"/>"
"<node idObject=\"20\" type=\"NodePoint\"/>"
"<node idObject=\"21\" reverse=\"0\" type=\"NodeSpline\"/>"
"<node idObject=\"22\" type=\"NodePoint\"/>"
"</nodes>"
"</detail>"
<< "<detail closed=\"1\" forbidFlipping=\"false\" forceFlipping=\"false\" hideMainPath=\"false\" id=\"35\" "
"mx=\"7.71397\" my=\"-3.94145\" name=\"Case 1\" seamAllowance=\"true\" version=\"2\" width=\"2\">"
"<data annotation=\"\" foldPosition=\"\" fontSize=\"0\" height=\"1\" letter=\"\" mx=\"0\" my=\"0\" "
"onFold=\"false\" orientation=\"\" quantity=\"1\" rotation=\"0\" rotationWay=\"\" tilt=\"\" "
"visible=\"false\" width=\"1\"/>"
"<patternInfo fontSize=\"0\" height=\"1\" mx=\"0\" my=\"0\" rotation=\"0\" visible=\"false\" "
"width=\"1\"/>"
"<grainline arrows=\"0\" length=\"1\" mx=\"0\" my=\"0\" rotation=\"0\" visible=\"false\"/>"
"<nodes>"
"<node idObject=\"30\" type=\"NodePoint\"/>"
"<node idObject=\"31\" reverse=\"0\" type=\"NodeSpline\"/>"
"<node idObject=\"32\" type=\"NodePoint\"/>"
"<node idObject=\"33\" type=\"NodePoint\"/>"
"</nodes>"
"</detail>"
<< 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);
}

View File

@ -1,52 +0,0 @@
/************************************************************************
**
** @file tst_vdomdocument.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @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
** <https://gitlab.com/smart-pattern/valentina> 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 <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef TST_VDOMDOCUMENT_H
#define TST_VDOMDOCUMENT_H
#include <QObject>
#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