diff --git a/src/language/ASTModulesImporter.cpp b/src/language/ASTModulesImporter.cpp index 8436a5eb39e577cf3a136bade537a40acc1f1dfc..1a164cf24d949ea9f7072eeedb26107e83b0579e 100644 --- a/src/language/ASTModulesImporter.cpp +++ b/src/language/ASTModulesImporter.cpp @@ -6,7 +6,7 @@ #include <PEGGrammar.hpp> #include <CFunctionEmbedder.hpp> -#include <CMathModule.hpp> +#include <MathModule.hpp> #include <memory> @@ -28,7 +28,7 @@ ASTModulesImporter::_importModule(ASTNode& import_node) std::cout << " * importing '" << rang::fgB::green << module_name << rang::style::reset << "' module\n"; if (module_name == "math") { - CMathModule math_module; + MathModule math_module; CFunctionEmbedderTable& c_function_embedder_table = m_symbol_table.cFunctionEbedderTable(); diff --git a/src/language/CMakeLists.txt b/src/language/CMakeLists.txt index acd8b1e57764fcfc0a194aebc516aeb751c324b2..21510acb1af86023c555c093509fb9363c1f5868 100644 --- a/src/language/CMakeLists.txt +++ b/src/language/CMakeLists.txt @@ -31,7 +31,7 @@ add_library( ASTPrinter.cpp ASTSymbolTableBuilder.cpp ASTSymbolInitializationChecker.cpp - CMathModule.cpp + MathModule.cpp PugsParser.cpp) # Additional dependencies diff --git a/src/language/CMathModule.cpp b/src/language/MathModule.cpp similarity index 96% rename from src/language/CMathModule.cpp rename to src/language/MathModule.cpp index 26d8a8f133a519f17ea6d7f62e600808b85d9858..934b55be831698dfaa8c06edad4b338d5101c7b9 100644 --- a/src/language/CMathModule.cpp +++ b/src/language/MathModule.cpp @@ -1,11 +1,11 @@ -#include <CMathModule.hpp> +#include <MathModule.hpp> #include <CFunctionEmbedder.hpp> #include <iostream> void -CMathModule::_addFunction(const std::string& name, std::shared_ptr<ICFunctionEmbedder> c_function_embedder) +MathModule::_addFunction(const std::string& name, std::shared_ptr<ICFunctionEmbedder> c_function_embedder) { auto [i_function, success] = m_name_cfunction_map.insert(std::make_pair(name, c_function_embedder)); // LCOV_EXCL_START @@ -16,7 +16,7 @@ CMathModule::_addFunction(const std::string& name, std::shared_ptr<ICFunctionEmb // LCOV_EXCL_STOP } -CMathModule::CMathModule() +MathModule::MathModule() { this->_addFunction("sqrt", std::make_shared<CFunctionEmbedder<double, double>>( std::function<double(double)>{[](double x) -> double { return std::sqrt(x); }})); diff --git a/src/language/CMathModule.hpp b/src/language/MathModule.hpp similarity index 88% rename from src/language/CMathModule.hpp rename to src/language/MathModule.hpp index 65b0890dfa4097182d5ecc3026936d7dae1cfcc6..2d78710766036940d7dff3805ebb5d4213dcebd4 100644 --- a/src/language/CMathModule.hpp +++ b/src/language/MathModule.hpp @@ -8,7 +8,7 @@ #include <unordered_map> class ICFunctionEmbedder; -class CMathModule +class MathModule { private: std::unordered_map<std::string, std::shared_ptr<ICFunctionEmbedder>> m_name_cfunction_map; @@ -22,9 +22,9 @@ class CMathModule return m_name_cfunction_map; } - CMathModule(); + MathModule(); - ~CMathModule() = default; + ~MathModule() = default; }; #endif // CMATH_MODULE_HPP diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 01762e9d1ed0b211ca5e3a81a0c43609786d7e16..b22063248eea18d23f2510e3691fad6c3179a711 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -44,7 +44,7 @@ add_executable (unit_tests test_CFunctionEmbedder.cpp test_CFunctionEmbedderTable.cpp test_CFunctionProcessor.cpp - test_CMathModule.cpp + test_MathModule.cpp test_ContinueProcessor.cpp test_ConcatExpressionProcessor.cpp test_CRSMatrix.cpp diff --git a/tests/test_CFunctionProcessor.cpp b/tests/test_CFunctionProcessor.cpp index efd3efad7e56d35014d86d4d35546b2038f61cef..0809ca9bd8ec098aadb114b3810fbddd5937544f 100644 --- a/tests/test_CFunctionProcessor.cpp +++ b/tests/test_CFunctionProcessor.cpp @@ -12,7 +12,7 @@ #include <ASTSymbolTableBuilder.hpp> -#include <CMathModule.hpp> +#include <MathModule.hpp> #define CHECK_CFUNCTION_EVALUATION_RESULT(data, variable_name, expected_value) \ { \ @@ -257,7 +257,7 @@ let z:Z, z = round(-1.2); CHECK_CFUNCTION_EVALUATION_RESULT(data, "z", int64_t{-1}); } - CMathModule math_module; + MathModule math_module; bool missing_test = false; for (auto [cmath_name, c_function] : math_module.getNameCFunctionsMap()) { diff --git a/tests/test_CMathModule.cpp b/tests/test_MathModule.cpp similarity index 99% rename from tests/test_CMathModule.cpp rename to tests/test_MathModule.cpp index f6365bdd7e27e835462287b49beb79e9c080b6de..5239387a56a0ae3b0a87ac746667844e0f00abb8 100644 --- a/tests/test_CMathModule.cpp +++ b/tests/test_MathModule.cpp @@ -3,13 +3,13 @@ #include <CFunctionEmbedder.hpp> #include <CFunctionEmbedderTable.hpp> -#include <CMathModule.hpp> +#include <MathModule.hpp> -TEST_CASE("CMathModule", "[language]") +TEST_CASE("MathModule", "[language]") { rang::setControlMode(rang::control::Off); - CMathModule math_module; + MathModule math_module; const auto& name_cfunction = math_module.getNameCFunctionsMap(); REQUIRE(name_cfunction.size() == 22);