diff --git a/umbrello/uml1model/umlcanvasobject.cpp b/umbrello/uml1model/umlcanvasobject.cpp index 520c3e48c..1877c33cb 100644 --- a/umbrello/uml1model/umlcanvasobject.cpp +++ b/umbrello/uml1model/umlcanvasobject.cpp @@ -1,460 +1,463 @@ /*************************************************************************** * This program 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 2 of the License, or * * (at your option) any later version. * * * * copyright (C) 2003-2014 * * Umbrello UML Modeller Authors * ***************************************************************************/ // own header #include "umlcanvasobject.h" // local includes #include "debug_utils.h" #include "uml.h" #include "umldoc.h" #include "classifier.h" #include "association.h" #include "attribute.h" #include "operation.h" #include "template.h" #include "stereotype.h" #include "idchangelog.h" // kde includes #include DEBUG_REGISTER_DISABLED(UMLCanvasObject) /** * Sets up a UMLCanvasObject. * * @param name The name of the Concept. * @param id The unique id of the Concept. */ UMLCanvasObject::UMLCanvasObject(const QString & name, Uml::ID::Type id) : UMLObject(name, id) { } /** * Standard deconstructor. */ UMLCanvasObject::~UMLCanvasObject() { //removeAllAssociations(); // No! This is way too late to do that. // It should have been called explicitly before destructing the // UMLCanvasObject. if (associations()) DEBUG(DBG_SRC) << "UMLCanvasObject destructor: FIXME: there are still associations()"; } /** * Return the subset of subordinates that matches the given type. * * @param assocType The AssociationType::Enum to match. * @return The list of associations that match assocType. */ UMLAssociationList UMLCanvasObject::getSpecificAssocs(Uml::AssociationType::Enum assocType) { UMLAssociationList list; UMLObject *o = 0; for (UMLObjectListIt oit(subordinates()); oit.hasNext();) { o = oit.next(); if (o->baseType() != UMLObject::ot_Association) continue; UMLAssociation *a = o->asUMLAssociation(); if (a->getAssocType() == assocType) list.append(a); } return list; } /** * Adds an association end to subordinates. * * @param assoc The association to add. * @todo change param type to UMLRole */ bool UMLCanvasObject::addAssociationEnd(UMLAssociation* assoc) { Q_ASSERT(assoc); // add association only if not already present in list if (!hasAssociation(assoc)) { subordinates().append(assoc); // Don't emit signals during load from XMI UMLObject::emitModified(); emit sigAssociationEndAdded(assoc); return true; } return false; } /** * Determine if this canvasobject has the given association. * * @param assoc The association to check. */ bool UMLCanvasObject::hasAssociation(UMLAssociation* assoc) { uint cnt = subordinates().count(assoc); DEBUG(DBG_SRC) << "count is " << cnt; return (cnt > 0); } /** * Remove an association end from the CanvasObject. * * @param assoc The association to remove. * @todo change param type to UMLRole */ int UMLCanvasObject::removeAssociationEnd(UMLAssociation * assoc) { if (!hasAssociation(assoc) || !subordinates().removeAll(assoc)) { DEBUG(DBG_SRC) << "cannot find given assoc " << assoc << " in list"; return -1; } UMLApp::app()->document()->removeAssociation(assoc, false); UMLObject::emitModified(); emit sigAssociationEndRemoved(assoc); return subordinates().count(); } /** * Remove all association ends from the CanvasObject. */ void UMLCanvasObject::removeAllAssociationEnds() { for (int i = 0; i < subordinates().count(); i++) { UMLObject *o = subordinates().at(i); if (o->baseType() != UMLObject::ot_Association) { continue; } UMLAssociation *assoc = o->asUMLAssociation(); //umldoc->slotRemoveUMLObject(assoc); UMLObject* objA = assoc->getObject(Uml::RoleType::A); UMLObject* objB = assoc->getObject(Uml::RoleType::B); UMLCanvasObject *roleAObj = objA->asUMLCanvasObject(); if (roleAObj) { roleAObj->removeAssociationEnd(assoc); } else if (objA) { DEBUG(DBG_SRC) << name() << ": objA " << objA->name() << " is not a UMLCanvasObject"; } else DEBUG(DBG_SRC) << name() << "): objA is NULL"; UMLCanvasObject *roleBObj = objB->asUMLCanvasObject(); if (roleBObj) { roleBObj->removeAssociationEnd(assoc); } else if (objB) { DEBUG(DBG_SRC) << name() << "): objB " << objB->name() << " is not a UMLCanvasObject"; } else DEBUG(DBG_SRC) << name() << "): objB is NULL"; } } /** * Remove all child objects. * Just clear list, objects must be deleted where they were created * (or we have bad crashes). */ void UMLCanvasObject::removeAllChildObjects() { if (!subordinates().isEmpty()) { removeAllAssociationEnds(); subordinates().clear(); } } /** * Returns a name for the new association, operation, template * or attribute appended with a number if the default name is * taken e.g. new_association, new_association_1 etc. * * @param type The object type for which to make a name. * @param prefix Optional prefix to use for the name. * If not given then uniqChildName() will choose the prefix * internally based on the object type. * @return Unique name string for the ObjectType given. */ QString UMLCanvasObject::uniqChildName(const UMLObject::ObjectType type, const QString &prefix /* = QString() */) { QString currentName; currentName = prefix; if (currentName.isEmpty()) { switch (type) { case UMLObject::ot_Association: currentName = i18n("new_association"); break; case UMLObject::ot_Attribute: currentName = i18n("new_attribute"); break; case UMLObject::ot_Template: currentName = i18n("new_template"); break; case UMLObject::ot_Operation: currentName = i18n("new_operation"); break; case UMLObject::ot_EnumLiteral: currentName = i18n("new_literal"); break; case UMLObject::ot_EntityAttribute: currentName = i18n("new_field"); break; case UMLObject::ot_UniqueConstraint: currentName = i18n("new_unique_constraint"); break; case UMLObject::ot_ForeignKeyConstraint: currentName = i18n("new_fkey_constraint"); break; case UMLObject::ot_CheckConstraint: currentName = i18n("new_check_constraint"); break; case UMLObject::ot_InstanceAttribute: currentName = i18n("new_object"); break; default: uWarning() << "uniqChildName() called for unknown child type " << UMLObject::toString(type); return QLatin1String("ERROR_in_UMLCanvasObject_uniqChildName"); } } QString name = currentName; for (int number = 1; findChildObject(name); ++number) { name = currentName + QLatin1Char('_') + QString::number(number); } return name; } /** * Find a child object with the given name. * * @param n The name of the object to find. * @param t The type to find (optional.) If not given then * any object type will match. * @return Pointer to the object found; NULL if none found. */ UMLObject * UMLCanvasObject::findChildObject(const QString &n, UMLObject::ObjectType t) { const bool caseSensitive = UMLApp::app()->activeLanguageIsCaseSensitive(); UMLObject *obj = 0; for (UMLObjectListIt oit(subordinates()); oit.hasNext();) { obj = oit.next(); if (t != UMLObject::ot_UMLObject && obj->baseType() != t) continue; if (caseSensitive) { if (obj->name() == n) return obj; } else if (obj->name().toLower() == n.toLower()) { return obj; } } return 0; } /** * Find an association. * * @param id The id of the object to find. * @param considerAncestors boolean switch to consider ancestors while searching * @return Pointer to the object found (NULL if not found.) */ UMLObject* UMLCanvasObject::findChildObjectById(Uml::ID::Type id, bool considerAncestors) { Q_UNUSED(considerAncestors); UMLObject *o = 0; for (UMLObjectListIt oit(subordinates()); oit.hasNext();) { o = oit.next(); if (o->id() == id) return o; } return 0; } /** * Overloaded '==' operator */ bool UMLCanvasObject::operator==(const UMLCanvasObject& rhs) const { if (this == &rhs) { return true; } if (!UMLObject::operator==(rhs)) { return false; } if (subordinates().count() != rhs.subordinates().count()) { return false; } - if (&subordinates() != &(rhs.subordinates())) { - return false; + for (int i = 0; i < subordinates().count(); i++) { + UMLObject *a = subordinates().at(i); + UMLObject *b = subordinates().at(i); + if (!(*a == *b)) + return false; } return true; } /** * Copy the internal presentation of this object into the new * object. */ void UMLCanvasObject::copyInto(UMLObject *lhs) const { UMLObject::copyInto(lhs); // TODO Associations are not copied at the moment. This because // the duplicate function (on umlwidgets) do not copy the associations. // //target->subordinates() = subordinates(); } /** * Returns the number of associations for the CanvasObject. * This is the sum of the aggregations and compositions. * * @return The number of associations for the Concept. */ int UMLCanvasObject::associations() { int count = 0; UMLObject *obj = 0; for (UMLObjectListIt oit(subordinates()); oit.hasNext();) { obj = oit.next(); if (obj->baseType() == UMLObject::ot_Association) count++; } return count; } /** * Return the list of associations for the CanvasObject. * * @return The list of associations for the CanvasObject. */ UMLAssociationList UMLCanvasObject::getAssociations() { UMLAssociationList assocs; UMLObject *o = 0; for (UMLObjectListIt oit(subordinates()); oit.hasNext() ;) { o = oit.next(); if (o->baseType() != UMLObject::ot_Association) continue; UMLAssociation *assoc = o->asUMLAssociation(); assocs.append(assoc); } return assocs; } /** * Return a list of the superclasses of this concept. * TODO: This overlaps with UMLClassifier::findSuperClassConcepts(), * see if we can merge the two. * * @param withRealizations include realizations in the returned list (default=yes) * @return The list of superclasses for the concept. */ UMLClassifierList UMLCanvasObject::getSuperClasses(bool withRealizations) { UMLClassifierList list; UMLAssociationList assocs = getAssociations(); foreach (UMLAssociation* a, assocs) { uIgnoreZeroPointer(a); if ((a->getAssocType() != Uml::AssociationType::Generalization && a->getAssocType() != Uml::AssociationType::Realization) || (!withRealizations && a->getAssocType() == Uml::AssociationType::Realization) || a->getObjectId(Uml::RoleType::A) != id()) continue; UMLClassifier *c = a->getObject(Uml::RoleType::B)->asUMLClassifier(); if (c) list.append(c); else DEBUG(DBG_SRC) << name() << ": generalization's other end is not a " << "UMLClassifier (id= " << Uml::ID::toString(a->getObjectId(Uml::RoleType::B)) << ")"; } return list; } /** * Return a list of the classes that inherit from this concept. * TODO: This overlaps with UMLClassifier::findSubClassConcepts(), * see if we can merge the two. * * @return The list of classes inheriting from the concept. */ UMLClassifierList UMLCanvasObject::getSubClasses() { UMLClassifierList list; UMLAssociationList assocs = getAssociations(); foreach (UMLAssociation* a, assocs) { uIgnoreZeroPointer(a); if ((a->getAssocType() != Uml::AssociationType::Generalization && a->getAssocType() != Uml::AssociationType::Realization) || a->getObjectId(Uml::RoleType::B) != id()) continue; UMLClassifier *c = a->getObject(Uml::RoleType::A)->asUMLClassifier(); if (c) list.append(c); else DEBUG(DBG_SRC) << "specialization's other end is not a UMLClassifier" << " (id=" << Uml::ID::toString(a->getObjectId(Uml::RoleType::A)) << ")"; } return list; } /** * Shorthand for getSpecificAssocs(Uml::at_Realization) * * @return The list of realizations for the Concept. */ UMLAssociationList UMLCanvasObject::getRealizations() { return getSpecificAssocs(Uml::AssociationType::Realization); } /** * Shorthand for getSpecificAssocs(Uml::at_Aggregation) * * @return The list of aggregations for the Concept. */ UMLAssociationList UMLCanvasObject::getAggregations() { return getSpecificAssocs(Uml::AssociationType::Aggregation); } /** * Shorthand for getSpecificAssocs(Uml::at_Composition) * * @return The list of compositions for the Concept. */ UMLAssociationList UMLCanvasObject::getCompositions() { return getSpecificAssocs(Uml::AssociationType::Composition); } /** * Shorthand for getSpecificAssocs(Uml::at_Relationship) * * @return The list of relationships for the entity. */ UMLAssociationList UMLCanvasObject::getRelationships() { return getSpecificAssocs(Uml::AssociationType::Relationship); } /** * Reimplementation of UMLObject method. */ bool UMLCanvasObject::resolveRef() { bool overallSuccess = UMLObject::resolveRef(); for (UMLObjectListIt ait(subordinates()); ait.hasNext();) { UMLObject *obj = ait.next(); if (! obj->resolveRef()) { subordinates().removeAll(obj); overallSuccess = false; } } return overallSuccess; } diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index b427b5efb..cac9fe026 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -1,165 +1,165 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) set(SRC_PATH ../umbrello) include_directories( ${LIBXML2_INCLUDE_DIR} ${LIBXSLT_INCLUDE_DIR} ${CMAKE_SOURCE_DIR} ${SRC_PATH} ${SRC_PATH}/debug/ ${SRC_PATH}/dialogs/ ${SRC_PATH}/dialogs/pages ${SRC_PATH}/dialogs/widgets ${SRC_PATH}/clipboard ${SRC_PATH}/cmds ${SRC_PATH}/codegenerators ${SRC_PATH}/codegenerators/ada/ ${SRC_PATH}/codegenerators/as/ ${SRC_PATH}/codegenerators/cpp/ ${SRC_PATH}/codegenerators/csharp/ ${SRC_PATH}/codegenerators/d/ ${SRC_PATH}/codegenerators/idl/ ${SRC_PATH}/codegenerators/java/ ${SRC_PATH}/codegenerators/js/ ${SRC_PATH}/codegenerators/pascal/ ${SRC_PATH}/codegenerators/perl/ ${SRC_PATH}/codegenerators/php/ ${SRC_PATH}/codegenerators/python/ ${SRC_PATH}/codegenerators/ruby/ ${SRC_PATH}/codegenerators/sql/ ${SRC_PATH}/codegenerators/tcl/ ${SRC_PATH}/codegenerators/vala/ ${SRC_PATH}/codegenerators/xml/ ${SRC_PATH}/codegenwizard ${SRC_PATH}/codeimport ${SRC_PATH}/debug ${SRC_PATH}/dialogs ${SRC_PATH}/docgenerators ${SRC_PATH}/menus/ ${SRC_PATH}/refactoring ${SRC_PATH}/uml1model/ ${SRC_PATH}/umlwidgets/ ${CMAKE_CURRENT_BINARY_DIR} ) if(NOT BUILD_KF5) set(LIBS Qt4::QtCore Qt4::QtGui Qt4::QtXml Qt4::QtTest Qt4::QtWebKit ${KDE4_KFILE_LIBS} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} libumbrello ) else() set(LIBS Qt5::Xml Qt5::Test Qt5::Widgets Qt5::WebKitWidgets KF5::I18n KF5::Crash ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} libumbrello ) endif() ecm_add_test( testbasictypes.cpp LINK_LIBRARIES ${LIBS} TEST_NAME testbasictypes ) ecm_add_test( testumlobject.cpp testbase.cpp LINK_LIBRARIES ${LIBS} TEST_NAME testumlobject ) -#ecm_add_test( -# testclassifier.cpp -# testbase.cpp -# LINK_LIBRARIES ${LIBS} -# TEST_NAME testclassifier -#) +ecm_add_test( + testclassifier.cpp + testbase.cpp + LINK_LIBRARIES ${LIBS} + TEST_NAME testclassifier +) ecm_add_test( testcppwriter.cpp testbase.cpp LINK_LIBRARIES ${LIBS} TEST_NAME testcppwriter ) ecm_add_test( testpythonwriter.cpp testbase.cpp LINK_LIBRARIES ${LIBS} TEST_NAME testpythonwriter ) ecm_add_test( testoptionstate.cpp testbase.cpp LINK_LIBRARIES ${LIBS} TEST_NAME testoptionstate ) set(testumlroledialog_SRCS testumlroledialog.cpp ) add_executable(testumlroledialog ${testumlroledialog_SRCS}) target_link_libraries(testumlroledialog ${LIBS}) add_executable(testcrashhandler testcrashhandler.cpp) target_link_libraries(testcrashhandler ${LIBS}) add_executable(testlistpopupmenu testlistpopupmenu.cpp testbase.cpp) target_link_libraries(testlistpopupmenu ${LIBS}) find_package(LLVM CONFIG) find_package(Clang CONFIG) if(NOT Clang_FOUND) find_package(CLANG QUIET) endif() if(LLVM_FOUND AND (Clang_FOUND OR CLANG_FOUND) AND LLVM_VERSION VERSION_LESS "8.0.0") message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") message(STATUS "Found CLANG ${CLANG_PACKAGE_VERSION}") include_directories(${LLVM_INCLUDE_DIRS}) add_definitions(${LLVM_DEFINITIONS}) include_directories(${CLANG_INCLUDE_DIRS}) add_definitions(${CLANG_DEFINITIONS}) # Now build our tools add_executable(testllvm testllvm.cpp) # Find the libraries that correspond to the LLVM components # that we wish to use if(LLVM_VERSION_MAJOR STREQUAL "7") set(llvm_libs LLVM) else() llvm_map_components_to_libnames(llvm_libs support core irreader analysis) endif() # Link against LLVM libraries target_link_libraries(testllvm ${llvm_libs} clangFrontend clangTooling clangBasic) add_executable(testllvmparser testllvmparser.cpp) if(NOT LLVM_VERSION_MAJOR STREQUAL "7") llvm_map_components_to_libnames(llvm_libs support) endif() target_link_libraries(testllvmparser ${llvm_libs} clangFrontend clangTooling clangAST clangBasic ${LIBS}) ecm_mark_nongui_executable(testllvm testllvmparser) endif() add_custom_target(check COMMAND ${CMAKE_BUILD_TOOL} test) diff --git a/unittests/testclassifier.cpp b/unittests/testclassifier.cpp index 81a223bd3..8cbfb28eb 100644 --- a/unittests/testclassifier.cpp +++ b/unittests/testclassifier.cpp @@ -1,245 +1,282 @@ /* Copyright 2011 Andi Fischer This program 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 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program 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 this program. If not, see . */ -#include "TEST_classifier.h" +#include "testclassifier.h" // app include #include "uml.h" #include "classifier.h" -const bool IS_NOT_IMPL = false; +#define IS_NOT_IMPL() QSKIP("not implemented yet", SkipSingle) //----------------------------------------------------------------------------- +//#define RUN_ALL + +#ifdef RUN_ALL +#undef QCOMPARE +#define QCOMPARE(actual, expected) \ + QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__) +#endif + void TEST_classifier::test_equal() { UMLClassifier* a = new UMLClassifier("Test A", Uml::ID::None); UMLClassifier* b = a; UMLClassifier* c = new UMLClassifier("Test A", Uml::ID::None); UMLClassifier* d = new UMLClassifier("Test B", Uml::ID::None); - QCOMPARE(a == b, true); - QCOMPARE(a == c, true); - QCOMPARE(b == c, true); - QCOMPARE(c == d, false); + QCOMPARE(*a == *b, true); + QCOMPARE(*a == *c, true); + QCOMPARE(*b == *c, true); + QCOMPARE(*c == *d, false); } void TEST_classifier::test_copyInto() { UMLClassifier* a = new UMLClassifier("Test A", Uml::ID::None); UMLClassifier* b = new UMLClassifier("Test B", Uml::ID::None); b->copyInto(a); - QCOMPARE(a == b, true); + QCOMPARE(*a == *b, true); } void TEST_classifier::test_clone() { UMLClassifier* a = new UMLClassifier("Test A", Uml::ID::None); - UMLClassifier* b; - b = static_cast(a->clone()); - QCOMPARE(a == b, true); + UMLClassifier* b = a->clone()->asUMLClassifier(); + QCOMPARE(*a == *b, true); } void TEST_classifier::test_addAttributeWithType() { UMLClassifier* a = new UMLClassifier("Test A", Uml::ID::None); UMLAttribute* attrA = a->addAttribute("attributeA_", Uml::ID::None); /* UMLAttribute* attrB = */ a->addAttribute("attributeB_", Uml::ID::None); - int num1 = a->attributes(); + int num1 = a->getAttributeList().count(); QCOMPARE(num1, 2); int num2 = a->removeAttribute(attrA); QCOMPARE(num2, 1); // one deleted - int num3 = a->attributes(); + int num3 = a->getAttributeList().count(); QCOMPARE(num3, num1 - 1); } void TEST_classifier::test_addAttributeWithObject() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_addAttributeWithAttribute() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_removeAndCountAttribute() { UMLClassifier* a = new UMLClassifier("Test A", Uml::ID::None); - int num0 = a->attributes(); + int num0 = a->getAttributeList().count(); QCOMPARE(num0, 0); // no attributes present yet /*UMLAttribute* attrA = */ a->addAttribute("attributeA_", Uml::ID::None); UMLAttribute* attrB = a->addAttribute("attributeB_", Uml::ID::None); UMLAttribute* attrC = a->addAttribute("attributeC_", Uml::ID::None); /* UMLAttribute* attrD = */ a->addAttribute("attributeD_", Uml::ID::None); - int num1 = a->attributes(); + int num1 = a->getAttributeList().count(); QCOMPARE(num1, 4); int num2 = a->removeAttribute(attrB); - QCOMPARE(num2, 1); // one deleted + QCOMPARE(num2, 3); // one deleted num2 = a->removeAttribute(attrC); - QCOMPARE(num2, 1); // one deleted - int num3 = a->attributes(); + QCOMPARE(num2, 2); // one deleted + int num3 = a->getAttributeList().count(); QCOMPARE(num3, 2); } void TEST_classifier::test_getAttributeList() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_addOperationWithPosition() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_addOperationWithLog() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_checkOperationSignature() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_removeAndCountOperation() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_getOperationList() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_addTemplateWithType() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_addTemplateWithLog() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_addTemplateWithPosition() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_removeAndCountTemplate() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_findTemplate() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_getTemplateList() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_takeItem() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_getFilteredList() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_resolveRef() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_findOperations() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_findChildObjectById() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_findOperation() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_findSuperClassConcepts() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_findSubClassConcepts() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_setGetClassAssoc() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_setBaseType() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_isInterface() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_isDatatype() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_setGetOriginType() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_setGetIsReference() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_hasAbstractOps() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_makeChildObject() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } void TEST_classifier::test_getUniAssociationToBeImplemented() { - QCOMPARE(IS_NOT_IMPL, true); + IS_NOT_IMPL(); } QTEST_MAIN(TEST_classifier) + +class A { +public: + A(int a) :_a(a) {} + bool operator ==(const A & rhs) const + { + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); + return _a == rhs._a; + } +private: + int _a; +}; + + +#if 0 +int main(int argc, char **argv) +{ + +// A a(5); +// A b(2); +// A c(a); +// printf("%d\n", a == b); +// printf("%d\n", a == c); + + QApplication app(argc, argv); + TEST_classifier z; + z.initTestCase(); + z.test_equal(); +} +#endif