Explorar el Código

BUG: Fix ctkAbstractFactoryTest1 intermittent failure

ctkAbstractFactoryTest1 intermittently failed because it checked the specific
order of items stored in a QHash. Change the test to accept the expected items
in any order.
Max Smolens hace 7 años
padre
commit
9ef4e8673a
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      Libs/Core/Testing/Cpp/ctkAbstractFactoryTest1.cpp

+ 3 - 3
Libs/Core/Testing/Cpp/ctkAbstractFactoryTest1.cpp

@@ -109,10 +109,10 @@ int ctkAbstractFactoryTest1(int argc, char * argv [] )
     }
   factory.registerItems();
   if (factory.itemKeys().count() != 2 ||
-      factory.itemKeys()[0] != "item1" ||
-      factory.itemKeys()[1] != "item2")
+      !factory.itemKeys().contains("item1") ||
+      !factory.itemKeys().contains("item2"))
     {
-    std::cerr<< "ctkAbstractFactory::keys() failed" << std::endl;
+    std::cerr<< "ctkAbstractFactory::itemKeys() failed" << std::endl;
     return EXIT_FAILURE;
     }
   item1 = factory.instantiate("item1");