From 29637e951955d1747d325407e2d833646c98f1c2 2019-09-11 11:41:29 From: Alexis Jeandet Date: 2019-09-11 11:41:29 Subject: [PATCH] Switched to cpp_utils package Signed-off-by: Alexis Jeandet --- diff --git a/include/Common/Numeric.h b/include/Common/Numeric.h deleted file mode 100644 index 08b7f00..0000000 --- a/include/Common/Numeric.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef NUMERIC_H -#define NUMERIC_H -#include -#include -#include -#include - -namespace SciQLop::numeric { - -/* - taken from here https://en.cppreference.com/w/cpp/types/numeric_limits/epsilon -*/ -template -typename std::enable_if::is_integer, bool>::type - almost_equal(T x, T y, int ulp=1) -{ - // the machine epsilon has to be scaled to the magnitude of the values used - // and multiplied by the desired precision in ULPs (units in the last place) - return std::abs(x-y) <= std::numeric_limits::epsilon() * std::abs(x+y) * ulp - // unless the result is subnormal - || std::abs(x-y) < std::numeric_limits::min(); -} - -} - -#endif diff --git a/include/Common/StringUtils.h b/include/Common/StringUtils.h deleted file mode 100644 index 856a138..0000000 --- a/include/Common/StringUtils.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef SCIQLOP_STRINGUTILS_H -#define SCIQLOP_STRINGUTILS_H - -#include "CoreGlobal.h" - -#include -#include -#include -#include -#include -#include - -/** - * Utility class with methods for strings - */ -namespace StringUtils -{ - /** - * Generates a unique name from a default name and a set of forbidden names. - * - * Generating the unique name is done by adding an index to the default name - * and stopping at the first index for which the generated name is not in the - * forbidden names. - * - * Examples (defaultName, forbiddenNames -> result): - * - "FGM", {"FGM"} -> "FGM1" - * - "FGM", {"ABC"} -> "FGM" - * - "FGM", {"FGM", "FGM1"} -> "FGM2" - * - "FGM", {"FGM", "FGM2"} -> "FGM1" - * - "", {"ABC"} -> "1" - * - * @param defaultName the default name - * @param forbiddenNames the set of forbidden names - * @return the unique name generated - */ - static QString uniqueName(const QString& defaultName, - const std::vector& forbiddenNames) noexcept - { - // Gets the base of the unique name to generate, by removing trailing number - // (for example, base name of "FGM12" is "FGM") - auto baseName = defaultName; - baseName.remove(QRegExp{QStringLiteral("\\d*$")}); - - // Finds the unique name by adding an index to the base name and stops when - // the generated name isn't forbidden - QString newName{}; - auto forbidden = true; - for(auto i = 0; forbidden; ++i) - { - newName = (i == 0) ? baseName : baseName + QString::number(i); - forbidden = - newName.isEmpty() || - std::any_of(forbiddenNames.cbegin(), forbiddenNames.cend(), - [&newName](const auto& name) { - return name.compare(newName, Qt::CaseInsensitive) == 0; - }); - } - - return newName; - } - - template - QString join(const container& input, const char* sep) - { - QStringList list; - if constexpr(std::is_same_v) - { - std::transform( - std::cbegin(input), std::cend(input), std::back_inserter(list), - [](const auto& item) { return QString::fromStdString(item); }); - } - else if constexpr(std::is_same_v) - { - std::copy(std::cbegin(input), std::cend(input), std::back_inserter(list)); - } - return list.join(sep); - } - - template - QString join(const container& input, const char* sep, - std::function op) - { - QStringList list; - std::transform(std::cbegin(input), std::cend(input), - std::back_inserter(list), op); - return list.join(sep); - } -} // namespace StringUtils - -#endif // SCIQLOP_STRINGUTILS_H diff --git a/include/Common/containers.h b/include/Common/containers.h deleted file mode 100644 index 61290fb..0000000 --- a/include/Common/containers.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef CONTAINERS_H -#define CONTAINERS_H -#include "cpp_utils.h" - -#include -#include -#include - -namespace SciQLop::containers -{ - template - auto contains(const T1& container, const T2& value) - -> decltype(container.front(), std::end(container), true) - { - return std::find(std::cbegin(container), std::cend(container), value) != - std::cend(container); - } - - template - auto contains(const T1& container, const T2& value) - -> decltype(container.find(value), std::cend(container), true) - { - return container.find(value) != std::cend(container); - } - - template - auto index_of(const T1& container, const T2& value) - -> decltype(container.front() == value, 0) - { - return std::distance( - std::cbegin(container), - std::find(std::cbegin(container), std::cend(container), value)); - } - - template - auto index_of(const T1& container, const T2& value) - -> decltype(container.front().get(), std::is_pointer::value, 0) - { - return std::distance(std::cbegin(container), - std::find_if(std::cbegin(container), - std::cend(container), - [value](const auto& item) { - return value == item.get(); - })); - } - -} // namespace SciQLop::containers - -#endif // CONTAINERS_H diff --git a/include/Common/cpp_utils.h b/include/Common/cpp_utils.h deleted file mode 100644 index fa3d39c..0000000 --- a/include/Common/cpp_utils.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef CPP_UTILS_H -#define CPP_UTILS_H - -#include "types_detectors.h" - -#include -#include -#include - -template using void_t = void; - -#define HAS_METHOD(method) \ - template struct _has_##method : std::false_type \ - {}; \ - \ - template \ - struct _has_##method< \ - T, void_t>> \ - : std::true_type \ - {}; \ - \ - template \ - static inline constexpr bool has_##method = _has_##method::value; - -// taken from here https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/ -#define ALIAS_TEMPLATE_FUNCTION(highLevelF, lowLevelF) \ - template \ - inline auto highLevelF(Args&&... args) \ - ->decltype(lowLevelF(std::forward(args)...)) \ - { \ - return lowLevelF(std::forward(args)...); \ - } - -template constexpr T diff(const std::pair& p) -{ - return p.second - p.first; -} - -template constexpr auto const& to_value(const T& item) -{ - if constexpr(std::is_pointer_v>>) - { return *item; } - else - { - if constexpr(is_smart_ptr::value) { return *item.get(); } - else - { - return item; - } - } -} - -template void repeat_n(T func, int number) -{ - for(int i = 0; i < number; i++) - func(); -} - -inline int operator*(int number, const std::function& func) -{ - for(int i = 0; i < number; i++) - func(); - return number; -} - -#endif // CPP_UTILS_H diff --git a/include/Common/deprecate.h b/include/Common/deprecate.h deleted file mode 100644 index 390e4b8..0000000 --- a/include/Common/deprecate.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef DEPRECATE_H -#define DEPRECATE_H - -#ifdef HIDE_DEPRECATED - #define DEPRECATE(x) -#else - #define DEPRECATE(x) x -#endif - -#endif diff --git a/include/Common/trees.h b/include/Common/trees.h deleted file mode 100644 index 17673d2..0000000 --- a/include/Common/trees.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once -#include "cpp_utils.h" -#include "types_detectors.h" - -#include -#include -#include - -HAS_METHOD(name) -HAS_METHOD(text) -HAS_METHOD(toStdString) - -template std::string _get_name(const T& item) -{ - if constexpr(has_name) { return _get_name(item.name()); } - else if constexpr(has_text) - { - return _get_name(item.text(0)); - } - else if constexpr(has_toStdString) - { - return _get_name(item.toStdString()); - } - else - { - return item; - } -} - -template -void _print_tree(const T& tree, int indent_increment, int indent_lvl) -{ - auto print_lambda = [&indent_lvl, &indent_increment](const auto& node) { - indent_lvl * [indent_increment](){std::cout <<"│"<< std::string(indent_increment, ' ');}; - std::cout << "├"; - (indent_increment-1) * [](){std::cout <<"─";}; - std::cout << " "<< _get_name(to_value(node)) << std::endl; - print_tree(to_value(node), indent_increment, indent_lvl+1); - }; - if constexpr(is_qt_tree_item::value) - { - for(int i = 0; i < tree.childCount(); i++) - { - print_lambda(tree.child(i)); - } - } - else - { - std::for_each(std::cbegin(tree), std::cend(tree), print_lambda); - } -} - -template -void print_tree(const T& tree, int indent_increment = 3, int indent_lvl = 0) -{ - _print_tree(to_value(tree), indent_increment, indent_lvl); -} diff --git a/include/Common/types_detectors.h b/include/Common/types_detectors.h deleted file mode 100644 index c13462a..0000000 --- a/include/Common/types_detectors.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once -#include - -template struct is_smart_ptr : std::false_type -{}; -template -struct is_smart_ptr().get(), - std::declval().reset())> : std::true_type -{}; - -template struct is_qt_tree_item : std::false_type -{}; -template -struct is_qt_tree_item().takeChildren(), - std::declval().parent(), - std::declval().addChild(nullptr))> - : std::true_type -{}; - -template struct has_name_method : std::false_type -{}; -template -struct has_name_method().name(), - std::declval())> : std::true_type -{}; - -template struct has_text_method : std::false_type -{}; -template -struct has_text_method().text(), - std::declval())> : std::true_type -{}; - - -template struct has_tostdstring_method : std::false_type -{}; -template -struct has_tostdstring_method().toStdString(), - std::declval())> : std::true_type -{}; diff --git a/include/Data/DateTimeRange.h b/include/Data/DateTimeRange.h index 2edc1f3..c61a7b5 100644 --- a/include/Data/DateTimeRange.h +++ b/include/Data/DateTimeRange.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include @@ -32,8 +32,8 @@ struct DateTimeRangeTransformation Seconds shift; bool operator==(const DateTimeRangeTransformation& other) const { - return SciQLop::numeric::almost_equal(zoom, other.zoom, 1) && - SciQLop::numeric::almost_equal(shift, other.shift, 1); + return cpp_utils::numeric::almost_equal(zoom, other.zoom, 1) && + cpp_utils::numeric::almost_equal(shift, other.shift, 1); } DateTimeRangeTransformation merge(const DateTimeRangeTransformation& other) const @@ -99,8 +99,8 @@ struct DateTimeRange bool operator==(const DateTimeRange& other) const { - return SciQLop::numeric::almost_equal(m_TStart, other.m_TStart, 1) && - SciQLop::numeric::almost_equal(m_TEnd, other.m_TEnd, 1); + return cpp_utils::numeric::almost_equal(m_TStart, other.m_TStart, 1) && + cpp_utils::numeric::almost_equal(m_TEnd, other.m_TEnd, 1); } bool operator!=(const DateTimeRange& other) const diff --git a/include/Data/DateTimeRangeHelper.h b/include/Data/DateTimeRangeHelper.h index 35ad32c..954c3a2 100644 --- a/include/Data/DateTimeRangeHelper.h +++ b/include/Data/DateTimeRangeHelper.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include enum class TransformationType { ZoomOut, ZoomIn, PanRight, PanLeft, Unknown }; @@ -32,14 +32,14 @@ namespace DateTimeRangeHelper { inline bool isPureShift(const DateTimeRange& range1, const DateTimeRange& range2) { - return SciQLop::numeric::almost_equal(range1.delta(), range2.delta(), 1) - && !SciQLop::numeric::almost_equal(range1.m_TStart, range2.m_TStart, 1); + return cpp_utils::numeric::almost_equal(range1.delta(), range2.delta(), 1) + && !cpp_utils::numeric::almost_equal(range1.m_TStart, range2.m_TStart, 1); } inline bool isPureZoom(const DateTimeRange& range1, const DateTimeRange& range2) { - return !SciQLop::numeric::almost_equal(range1.delta(),range2.delta(),1)&& - SciQLop::numeric::almost_equal(range1.center(), range2.center(),1); + return !cpp_utils::numeric::almost_equal(range1.delta(),range2.delta(),1)&& + cpp_utils::numeric::almost_equal(range1.center(), range2.center(),1); } @@ -68,7 +68,7 @@ namespace DateTimeRangeHelper { auto transformation = computeTransformation (range1,range2); if(transformation.has_value ()) { - if(SciQLop::numeric::almost_equal(transformation->zoom,1.)) + if(cpp_utils::numeric::almost_equal(transformation->zoom,1.)) { if(transformation->shift > 0.) return TransformationType::PanRight; diff --git a/include/Data/IDataProvider.h b/include/Data/IDataProvider.h index 4d58bfa..7e1f1a3 100644 --- a/include/Data/IDataProvider.h +++ b/include/Data/IDataProvider.h @@ -4,7 +4,7 @@ #include "CoreGlobal.h" #include -#include +#include #include #include #include diff --git a/include/DataSource/DataSourceItem.h b/include/DataSource/DataSourceItem.h index 5493dcc..f2c9c0b 100644 --- a/include/DataSource/DataSourceItem.h +++ b/include/DataSource/DataSourceItem.h @@ -4,7 +4,7 @@ #include "CoreGlobal.h" #include -#include +#include #include #include #include diff --git a/include/Variable/Variable2.h b/include/Variable/Variable2.h index 4890de8..0b7a2d9 100644 --- a/include/Variable/Variable2.h +++ b/include/Variable/Variable2.h @@ -4,7 +4,7 @@ #include "CoreGlobal.h" #include -#include +#include #include #include #include diff --git a/include/Variable/VariableSynchronizationGroup2.h b/include/Variable/VariableSynchronizationGroup2.h index b5380fb..4059452 100644 --- a/include/Variable/VariableSynchronizationGroup2.h +++ b/include/Variable/VariableSynchronizationGroup2.h @@ -6,7 +6,7 @@ #include "CoreGlobal.h" #include -#include +#include /** * @brief The VariableSynchronizationGroup2 class holds a list of Variables uuid which are synchronized @@ -52,7 +52,7 @@ public: */ bool contains(QUuid variable) const noexcept { - return SciQLop::containers::contains(this->_variables,variable); + return cpp_utils::containers::contains(this->_variables,variable); } /** diff --git a/include/Variable/private/VCTransaction.h b/include/Variable/private/VCTransaction.h index ec5a8f1..3c02de7 100644 --- a/include/Variable/private/VCTransaction.h +++ b/include/Variable/private/VCTransaction.h @@ -1,7 +1,7 @@ #pragma once #include "Variable/VariableSynchronizationGroup2.h" -#include +#include #include #include #include diff --git a/meson.build b/meson.build index 55e5ac1..d3c67e2 100644 --- a/meson.build +++ b/meson.build @@ -2,19 +2,15 @@ catalogicpp_dep = dependency('catalogicpp', required : true, fallback:['catalogicpp','catalogicpp_dep']) pybind11_dep = dependency('pybind11', required : true, fallback:['pybind11','pybind11_dep']) timeseries_dep = dependency('TimeSeries', required : true, fallback:['TimeSeries','time_series_dep']) +cpp_utils_dep = dependency('cpp_utils', fallback:['cpp_utils','cpp_utils_dep']) core_moc_headers = [ - './include/Common/containers.h', - './include/Common/StringUtils.h', - './include/Common/Numeric.h', './include/Common/spimpl.h', './include/Common/DateUtils.h', './include/Common/MimeTypesDef.h', './include/Common/SignalWaiter.h', - './include/Common/deprecate.h', './include/Common/debug.h', './include/Common/MetaTypes.h', - './include/Common/cpp_utils.h', './include/Common/SortUtils.h', './include/Data/DateTimeRangeHelper.h', './include/Data/ScalarTimeSerie.h', @@ -58,7 +54,6 @@ core_moc_files = qt5.preprocess(moc_headers : core_moc_headers, moc_sources: cor core_sources = ['./src/Common/MimeTypesDef.cpp', './src/Common/SignalWaiter.cpp', './src/Common/DateUtils.cpp', - './src/Common/StringUtils.cpp', './src/Network/Downloader.cpp', './src/Network/NetworkController.cpp', './src/Settings/SqpSettingsDefs.cpp', @@ -83,14 +78,14 @@ sciqlop_core_lib = library('sciqlopcore', core_moc_files, cpp_args : '-DCORE_LIB', include_directories : core_inc, - dependencies : [qt5core, qt5network, catalogicpp_dep, pybind11_dep, timeseries_dep], + dependencies : [qt5core, qt5network, catalogicpp_dep, pybind11_dep, timeseries_dep, cpp_utils_dep], install : true ) sciqlop_core = declare_dependency(link_with : sciqlop_core_lib, include_directories : core_inc, - dependencies : [qt5core, qt5network, catalogicpp_dep, pybind11_dep, timeseries_dep]) + dependencies : [qt5core, qt5network, catalogicpp_dep, pybind11_dep, timeseries_dep, cpp_utils_dep]) pymod = import('python') python3 = pymod.find_installation('python3') diff --git a/src/Catalogue/CatalogueController.cpp b/src/Catalogue/CatalogueController.cpp index 74f6789..a45ded8 100644 --- a/src/Catalogue/CatalogueController.cpp +++ b/src/Catalogue/CatalogueController.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include @@ -8,7 +8,7 @@ #include #include -using namespace SciQLop::containers; +using namespace cpp_utils::containers; // class CatalogueController::CatalogueControllerPrivate //{ diff --git a/src/Common/StringUtils.cpp b/src/Common/StringUtils.cpp deleted file mode 100644 index c0e736e..0000000 --- a/src/Common/StringUtils.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "Common/StringUtils.h" - - - - diff --git a/src/DataSource/DataSourceController.cpp b/src/DataSource/DataSourceController.cpp index ce4effb..8f41043 100644 --- a/src/DataSource/DataSourceController.cpp +++ b/src/DataSource/DataSourceController.cpp @@ -3,7 +3,7 @@ #include "DataSource/DataSourceItem.h" #include "DataSource/DataSourceItemAction.h" -#include +#include #include #include #include diff --git a/src/Variable/VariableController2.cpp b/src/Variable/VariableController2.cpp index ac8061c..0733c64 100644 --- a/src/Variable/VariableController2.cpp +++ b/src/Variable/VariableController2.cpp @@ -2,7 +2,7 @@ #include "Variable/VariableSynchronizationGroup2.h" -#include +#include #include #include #include @@ -75,7 +75,7 @@ class VariableController2::VariableController2Private #if __cplusplus > 201703L [[unlikely]] #endif - if(!_variables.size() > index) + if(!(_variables.size() > static_cast(index))) SCIQLOP_ERROR(threadSafeVaraiblesMaps, "Index is out of bounds"); auto it = _variables.cbegin(); while(index != 0) diff --git a/src/Variable/VariableModel2.cpp b/src/Variable/VariableModel2.cpp index 0286e4d..326f92a 100644 --- a/src/Variable/VariableModel2.cpp +++ b/src/Variable/VariableModel2.cpp @@ -1,7 +1,8 @@ #include #include -#include -#include +#include +#include +#include #include #include #include @@ -55,7 +56,7 @@ namespace auto forbiddenNames = std::vector(variables.size()); std::transform(variables.cbegin(), variables.cend(), forbiddenNames.begin(), [](const auto& variable) { return variable->name(); }); - auto uniqueName = StringUtils::uniqueName(defaultName, forbiddenNames); + auto uniqueName = cpp_utils::strings::make_unique_name(defaultName, forbiddenNames); Q_ASSERT(!uniqueName.isEmpty()); return uniqueName; @@ -254,7 +255,7 @@ void VariableModel2::variableUpdated(QUuid id) noexcept void VariableModel2::variableAdded(const std::shared_ptr& variable) { - if(!SciQLop::containers::contains(_variables, variable)) + if(!cpp_utils::containers::contains(_variables, variable)) { beginInsertRows(QModelIndex(), this->_variables.size(), this->_variables.size()); diff --git a/tests/Common/TestContainers.cpp b/tests/Common/TestContainers.cpp deleted file mode 100644 index 45e7465..0000000 --- a/tests/Common/TestContainers.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include -#include - -template -void test() -{ - T cont{{1,2,3,3,3}}; - T empty; - - QCOMPARE(SciQLop::containers::contains(cont,1),true); - QCOMPARE(SciQLop::containers::contains(cont,3),true); - - QCOMPARE(SciQLop::containers::contains(cont,-1),false); - QCOMPARE(SciQLop::containers::contains(empty,1),false); -} - -class TestContainers: public QObject { - Q_OBJECT - -private slots: - void testVector() { test< std::vector >();} - void testSet() { test< std::set >();} - void testList() { test< std::list >();} - void testQVector(){ test< QVector >();} - void testQList() { test< QList >();} -}; - -QTEST_MAIN(TestContainers) -#include "TestContainers.moc" diff --git a/tests/Common/TestStringUtils.cpp b/tests/Common/TestStringUtils.cpp deleted file mode 100644 index c6f66f1..0000000 --- a/tests/Common/TestStringUtils.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include - -#include -#include - -class TestStringUtils : public QObject { - Q_OBJECT - -private slots: - void testUniqueName_data(); - void testUniqueName(); -}; - -void TestStringUtils::testUniqueName_data() -{ - // ////////////// // - // Test structure // - // ////////////// // - - QTest::addColumn("defaultName"); - QTest::addColumn >("forbiddenNames"); - QTest::addColumn("expectedName"); - - // ////////// // - // Test cases // - // ////////// // - - QTest::newRow("uniqueName") << "FGM" << std::vector{"FGM2"} << "FGM"; - QTest::newRow("uniqueName2") << "FGM2" << std::vector{"FGM", "FGM1", "FGM2"} << "FGM3"; - QTest::newRow("uniqueName3") << "FGM1" << std::vector{"FGM1"} << "FGM"; - QTest::newRow("uniqueName4") << "FGM" << std::vector{"FGM"} << "FGM1"; - QTest::newRow("uniqueName5") << "FGM" << std::vector{"FGM", "FGM1", "FGM3"} << "FGM2"; - QTest::newRow("uniqueName6") << "FGM" << std::vector{"A", "B", "C"} << "FGM"; - QTest::newRow("uniqueName7") << "FGM" << std::vector{"fGm", "FGm1", "Fgm2"} << "FGM3"; - QTest::newRow("uniqueName8") << "" << std::vector{"A", "B", "C"} << "1"; - QTest::newRow("uniqueName9") << "24" << std::vector{"A", "B", "C"} << "1"; -} - -void TestStringUtils::testUniqueName() -{ - QFETCH(QString, defaultName); - QFETCH(std::vector, forbiddenNames); - QFETCH(QString, expectedName); - - auto result = StringUtils::uniqueName(defaultName, forbiddenNames); - QCOMPARE(result, expectedName); -} - -QTEST_MAIN(TestStringUtils) -#include "TestStringUtils.moc" diff --git a/tests/Data/TestDateTimeRange.cpp b/tests/Data/TestDateTimeRange.cpp index 052987f..10a4d3e 100644 --- a/tests/Data/TestDateTimeRange.cpp +++ b/tests/Data/TestDateTimeRange.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/tests/Variable/TestVariableController2.cpp b/tests/Variable/TestVariableController2.cpp index b6fa1dd..637a3dc 100644 --- a/tests/Variable/TestVariableController2.cpp +++ b/tests/Variable/TestVariableController2.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -47,7 +47,7 @@ private slots: }); QVERIFY(!callbackCalled); auto var1 = vc.createVariable("var1", {}, provider, range); - QVERIFY(SciQLop::containers::contains(vc.variables(), var1)); + QVERIFY(cpp_utils::containers::contains(vc.variables(), var1)); QVERIFY(callbackCalled); } @@ -64,10 +64,10 @@ private slots: auto var1 = vc.createVariable("var1", {}, provider, range); while(!vc.isReady(var1)) QCoreApplication::processEvents(); - QVERIFY(SciQLop::containers::contains(vc.variables(), var1)); + QVERIFY(cpp_utils::containers::contains(vc.variables(), var1)); QVERIFY(!callbackCalled); vc.deleteVariable(var1); - QVERIFY(!SciQLop::containers::contains(vc.variables(), var1)); + QVERIFY(!cpp_utils::containers::contains(vc.variables(), var1)); QVERIFY(callbackCalled); } diff --git a/tests/Variable/TestVariableController2Async.cpp b/tests/Variable/TestVariableController2Async.cpp index 3fe7ee0..0e1c360 100644 --- a/tests/Variable/TestVariableController2Async.cpp +++ b/tests/Variable/TestVariableController2Async.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/tests/Variable/TestVariableController2WithSync.cpp b/tests/Variable/TestVariableController2WithSync.cpp index f84a01a..f886f68 100644 --- a/tests/Variable/TestVariableController2WithSync.cpp +++ b/tests/Variable/TestVariableController2WithSync.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -52,7 +52,7 @@ private slots: }); QVERIFY(!callbackCalled); auto var1 = vc.createVariable("var1", {}, provider, range); - QVERIFY(SciQLop::containers::contains(vc.variables(), var1)); + QVERIFY(cpp_utils::containers::contains(vc.variables(), var1)); QVERIFY(callbackCalled); } @@ -67,14 +67,14 @@ private slots: callbackCalled = true; }); auto var1 = vc.createVariable("var1", {}, provider, range); - QVERIFY(SciQLop::containers::contains(vc.variables(), var1)); + QVERIFY(cpp_utils::containers::contains(vc.variables(), var1)); QVERIFY(!callbackCalled); while(!vc.isReady(var1)) { qApp->processEvents(); } vc.deleteVariable(var1); - QVERIFY(!SciQLop::containers::contains(vc.variables(), var1)); + QVERIFY(!cpp_utils::containers::contains(vc.variables(), var1)); QVERIFY(callbackCalled); } diff --git a/tests/meson.build b/tests/meson.build index 62619a4..e338f68 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -10,16 +10,6 @@ TestUtils_dep = declare_dependency(link_with : TestUtils, tests = [ { - 'name':'TestStringUtils', - 'sources': ['Common/TestStringUtils.cpp'], - 'deps': [sciqlop_core, qt5test] - }, - { - 'name':'TestContainers', - 'sources': ['Common/TestContainers.cpp'], - 'deps': [sciqlop_core, qt5test] - }, - { 'name':'TestSyncGroup', 'sources': ['Variable/TestSyncGroup.cpp'], 'deps': [sciqlop_core, qt5test]