File indexing completed on 2024-04-21 08:22:57

0001 /* This file is part of the TikZKit project.
0002  *
0003  * Copyright (C) 2013 Dominik Haumann <dhaumann@kde.org>
0004  *
0005  * This library is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU Library General Public License as published
0007  * by the Free Software Foundation, either version 2 of the License, or
0008  * (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  * GNU Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, see
0017  * <http://www.gnu.org/licenses/>.
0018  */
0019 #include "TestNode.h"
0020 
0021 #include <QtTest/QTest>
0022 
0023 #include <tikz/core/Document.h>
0024 #include <tikz/core/Node.h>
0025 
0026 QTEST_MAIN(NodeTest)
0027 
0028 void NodeTest::initTestCase()
0029 {
0030 }
0031 
0032 void NodeTest::cleanupTestCase()
0033 {
0034 }
0035 
0036 void NodeTest::testPos()
0037 {
0038     tikz::core::Document doc;
0039     auto n = doc.createEntity<tikz::core::Node>(tikz::EntityType::Node);
0040 
0041     // initially (0, 0)
0042     QCOMPARE(n->pos(), tikz::Pos(0, 0));
0043 
0044     n->setPos(tikz::Pos(1, 1));
0045     QCOMPARE(n->pos(), tikz::Pos(1, 1));
0046 }
0047 
0048 // kate: indent-width 4; replace-tabs on;