Bug 414044 - Classifier unit case not enabled
Summary: Classifier unit case not enabled
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.29.3 (KDE Applications 19.08.3)
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-11 21:37 UTC by Ralf Habacker
Modified: 2019-11-19 07:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.29.80 (KDE Applications 19.11.80)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2019-11-11 21:37:10 UTC
The unit test for UML classifer is not enabled


STEPS TO REPRODUCE
1. build umbrello with enabled unit tests
2. run 'make test'

OBSERVED RESULT
The unit test 'testclassifier' is not executed

EXPECTED RESULT
The unit 'testclassifier' should be executed


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Leap 15.1
KDE Frameworks Version: 5.54
Qt Version: 5.9.7
Comment 1 Ralf Habacker 2019-11-11 21:46:42 UTC
Git commit 9001925a05953d128417756780c461c656e9de2e by Ralf Habacker.
Committed on 11/11/2019 at 21:46.
Pushed by habacker into branch 'release/19.12'.

Fix 'Classifier unit case not enabled'

One problem was that comparing the list address of contained objects
in UMLCanvasObject is incorrect. Instead, each object in this list
must be compared. Also, the comparison of UMLClassifier pointers
does not seem to give the desired result.

Unimplemented tests are now skipped to avoid aborting the test.
FIXED-IN:2.29.90 (KDE Applications 19.11.90)

M  +5    -2    umbrello/uml1model/umlcanvasobject.cpp
M  +6    -6    unittests/CMakeLists.txt
M  +85   -48   unittests/testclassifier.cpp

https://commits.kde.org/umbrello/9001925a05953d128417756780c461c656e9de2e
Comment 2 Ralf Habacker 2019-11-11 23:05:40 UTC
Git commit fd39f64bb3967f710a20dc741a326ad99b620df5 by Ralf Habacker.
Committed on 11/11/2019 at 23:02.
Pushed by habacker into branch 'release/19.12'.

Cleanup classifier unit test

1. Remove unused code
2. Show simple debug message for tests already performed by
   another unit test instead of showing a skipped message.

M  +2    -32   unittests/testclassifier.cpp

https://commits.kde.org/umbrello/fd39f64bb3967f710a20dc741a326ad99b620df5
Comment 3 Ralf Habacker 2019-11-11 23:05:41 UTC
Git commit 331546aac0dcdde20e947a6768d05f4618e37a6d by Ralf Habacker.
Committed on 11/11/2019 at 23:05.
Pushed by habacker into branch 'release/19.12'.

testclassifier: add tests for finding operation(s)

M  +2    -1    unittests/testbase.cpp
M  +69   -3    unittests/testclassifier.cpp

https://commits.kde.org/umbrello/331546aac0dcdde20e947a6768d05f4618e37a6d
Comment 4 Ralf Habacker 2019-11-13 07:26:56 UTC
Git commit e8927446120a64b49b7f69ccdebb5de1a20c5430 by Ralf Habacker.
Committed on 13/11/2019 at 07:26.
Pushed by habacker into branch 'release/19.12'.

Use static objects instead of dynamic to avoid memory leaks

M  +11   -10   unittests/testclassifier.cpp

https://commits.kde.org/umbrello/e8927446120a64b49b7f69ccdebb5de1a20c5430
Comment 5 Ralf Habacker 2019-11-13 15:52:22 UTC
Git commit 7b422fc22f1f2a4873ab1ce7d624677d7aca6e3f by Ralf Habacker.
Committed on 13/11/2019 at 15:48.
Pushed by habacker into branch 'release/19.12'.

Add unit test for class UMLCanvasObject

Since UMLCanvasObject is a base class of UMLClassifier, some tests for
UMLClassifier belong here.

M  +7    -0    unittests/CMakeLists.txt
A  +172  -0    unittests/testumlcanvasobject.cpp     [License: GPL (v2/3)]
A  +43   -0    unittests/testumlcanvasobject.h     [License: GPL (v2/3)]

https://commits.kde.org/umbrello/7b422fc22f1f2a4873ab1ce7d624677d7aca6e3f
Comment 6 Ralf Habacker 2019-11-13 16:09:09 UTC
Git commit c083902ef178d592af4f7c4b54c484d8f57e263c by Ralf Habacker.
Committed on 13/11/2019 at 16:08.
Pushed by habacker into branch 'release/19.12'.

Add super/sub class related tests to classifier unit tests

M  +19   -2    unittests/testclassifier.cpp

https://commits.kde.org/umbrello/c083902ef178d592af4f7c4b54c484d8f57e263c
Comment 7 Ralf Habacker 2019-11-14 09:15:25 UTC
Git commit 5f2e7863aeeab89b9277c94072c8af31f950756c by Ralf Habacker.
Committed on 14/11/2019 at 09:15.
Pushed by habacker into branch 'release/19.12'.

Avoid to use non reentrant iteration as mentioned by Oliver in UMLClassifier::resolveRef()

/****
For reference, here is the non-reentrant iteration scheme -
   NOT USE THIS !
for (UMLObject *obj = subordinates().first(); obj; obj = subordinates().next())
   {  ....  }
****/

M  +2    -4    umbrello/uml1model/entity.cpp
M  +2    -4    umbrello/uml1model/folder.cpp
M  +3    -6    umbrello/uml1model/package.cpp
M  +6    -17   umbrello/uml1model/umlcanvasobject.cpp

https://commits.kde.org/umbrello/5f2e7863aeeab89b9277c94072c8af31f950756c
Comment 8 Ralf Habacker 2019-11-14 23:41:25 UTC
Git commit aa24a8a0046738002dfd6b2b2fe4cf65b371d6a1 by Ralf Habacker.
Committed on 14/11/2019 at 23:40.
Pushed by habacker into branch 'release/19.12'.

Add load and save unit test for UMLClassifier

M  +20   -0    unittests/testclassifier.cpp
M  +1    -0    unittests/testclassifier.h

https://commits.kde.org/umbrello/aa24a8a0046738002dfd6b2b2fe4cf65b371d6a1
Comment 9 Ralf Habacker 2019-11-15 18:03:43 UTC
Git commit edb241a4c1d0661361042a6217c69c4fb85cf39e by Ralf Habacker.
Committed on 15/11/2019 at 18:03.
Pushed by habacker into branch 'release/19.12'.

Cleanup is...() methods for uml classifier and object unit tests

Most of them are located in UMLObject.

M  +6    -11   unittests/testclassifier.cpp
M  +0    -2    unittests/testclassifier.h
M  +66   -0    unittests/testumlobject.cpp
M  +1    -0    unittests/testumlobject.h

https://commits.kde.org/umbrello/edb241a4c1d0661361042a6217c69c4fb85cf39e
Comment 10 Ralf Habacker 2019-11-16 00:11:40 UTC
Git commit 3c0be5a0eb85002ae1d4bc47828c7b6a8bb4dc34 by Ralf Habacker.
Committed on 16/11/2019 at 00:03.
Pushed by habacker into branch 'release/19.12'.

UMLPackage is required by UMLClassifier so adding a unit case is useful

M  +7    -0    unittests/CMakeLists.txt
A  +65   -0    unittests/testpackage.cpp     [License: GPL (v2/3)]
A  +48   -0    unittests/testpackage.h     [License: GPL (v2/3)]

https://commits.kde.org/umbrello/3c0be5a0eb85002ae1d4bc47828c7b6a8bb4dc34
Comment 11 Ralf Habacker 2019-11-16 00:11:40 UTC
Git commit bdda692fca25310dcafff7c9eb50ddfe92e947df by Ralf Habacker.
Committed on 16/11/2019 at 00:03.
Pushed by habacker into branch 'release/19.12'.

Fixup of commit 5f2e7863aeeab89b9277c94072c8af31f950756c

Subordinates references m_List not m_objects.

M  +1    -1    umbrello/uml1model/package.cpp

https://commits.kde.org/umbrello/bdda692fca25310dcafff7c9eb50ddfe92e947df