Skip to content

"Fix" kisNodeModelTest

Halla Rempt requested to merge rempt/fix-node-model-test into master

The KisNodeModelTest didn't set the image it was testing with on the document. This broke in KisShapeController::setImage(KisImageWSP image), which cleared all connections, then didn't use the image parameter but the local doc's image object (which is 0) to reconnect the signals/slots, and which then crashed in KisShapeController::slotUpdateDocumentResolution(), where the image would still be 0.

Howewever, the question is: should this function even have this parameter? If so, should the image then be set on the doc? Should this function even exist since it makes it possible to have a local m_doc->image() that is different from the image parameter?

If KisShapeController has a pointer to the KisDocument it should work with, shouldn't it always get the image from that KisDocument?

There are still a bunch of warnings, too.

boud@boud-ThinkPad-T470p:~/dev/b-krita/libs/ui/tests$ ./kis_node_model_test
********* Start testing of KisNodeModelTest *********
Config: Using QtTest library 5.12.3, Qt 5.12.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 7.4.0)
PASS   : KisNodeModelTest::initTestCase()
QWARN  : KisNodeModelTest::testSetImage() KoColor debug runtime checks are active.
PASS   : KisNodeModelTest::testSetImage()
QWARN  : KisNodeModelTest::testAddNode() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testAddNode() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testAddNode() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testAddNode() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testAddNode() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
PASS   : KisNodeModelTest::testAddNode()
QWARN  : KisNodeModelTest::testRemoveAllNodes() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testRemoveAllNodes() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testRemoveAllNodes() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testRemoveAllNodes() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testRemoveAllNodes() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
PASS   : KisNodeModelTest::testRemoveAllNodes()
QWARN  : KisNodeModelTest::testRemoveIncludingRoot() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testRemoveIncludingRoot() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testRemoveIncludingRoot() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testRemoveIncludingRoot() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
QWARN  : KisNodeModelTest::testRemoveIncludingRoot() SAFE ASSERT (krita): "!newNode->parent()" in file /home/boud/dev/krita/libs/image/kis_node.cpp, line 500
PASS   : KisNodeModelTest::testRemoveIncludingRoot()
PASS   : KisNodeModelTest::cleanupTestCase()
Totals: 6 passed, 0 failed, 0 skipped, 0 blacklisted, 1597ms
********* Finished testing of KisNodeModelTest *********
Edited by tusooa the west wind

Merge request reports

Loading