diff --git a/utils/tst/CommonTypesTestSuite.h b/utils/tst/CommonTypesTestSuite.h index bfd0c80e6..35d1f9d72 100644 --- a/utils/tst/CommonTypesTestSuite.h +++ b/utils/tst/CommonTypesTestSuite.h @@ -4,32 +4,33 @@ #include "gtest/gtest.h" #include #include +using namespace gmds; // Test for getCommonBut TEST(CommonTypesTestSuite, GetCommonButTest) { - std::vector set1 = {1, 2, 3, 4, 5}; - std::vector set2 = {3, 4, 5, 6, 7}; - TCellID but = 2; + std::vector set1 = {1, 2, 3, 4, 5}; + std::vector set2 = {3, 4, 5, 6, 7}; + gmds::TCellID but = 4; - std::vector result = gmds::getCommonBut(set1, set2, but); + std::vector result = gmds::getCommonBut(set1, set2, but); ASSERT_EQ(result.size(), 2); + ASSERT_TRUE(std::find(result.begin(), result.end(), 2) != result.end()); ASSERT_TRUE(std::find(result.begin(), result.end(), 3) != result.end()); - ASSERT_TRUE(std::find(result.begin(), result.end(), 5) != result.end()); + ASSERT_TRUE(std::find(result.begin(), result.end(), 4) == result.end()); } -// Test for keepFilter TEST(CommonTypesTestSuite, KeepFilterTest) { - std::vector set = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4}; - TInt nb = 2; + std::vector set = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4}; + gmds::TInt nb = 2; - std::vector result = gmds::keepFilter(set, nb); + std::vector result = gmds::keepFilter(set, nb); ASSERT_EQ(result.size(), 2); - ASSERT_TRUE(std::find(result.begin(), result.end(), 2) != result.end()); ASSERT_TRUE(std::find(result.begin(), result.end(), 3) != result.end()); + ASSERT_TRUE(std::find(result.begin(), result.end(), 4) != result.end()); } #endif // GMDS_COMMON_TYPES_TEST_SUITE_H diff --git a/utils/tst/main_test.cpp b/utils/tst/main_test.cpp index 36cf72dec..5066643fd 100644 --- a/utils/tst/main_test.cpp +++ b/utils/tst/main_test.cpp @@ -3,13 +3,13 @@ /*----------------------------------------------------------------------------*/ // Files containing the different test suites to launch #include "ArrayTestSuite.h" -#include "AssertTestSuite.h" +// #include "AssertTestSuite.h" #include "BitVectorTestSuite.h" -// #include "CommonTypesTestSuite.h" +#include "CommonTypesTestSuite.h" // #include "LogTestSuite.h" // #include "OrientedGraphTestSuite.h" #include "ParamTestSuite.h" -#include "RandomGeneratorTestSuite.h" +// #include "RandomGeneratorTestSuite.h" #include "UtilsTestSuite.h" // #include "VariableManagerTestSuite.h" /*----------------------------------------------------------------------------*/