Skip to content
Snippets Groups Projects
Commit 10f48a1a authored by vincent  lorrain's avatar vincent lorrain
Browse files

[NodeRegex][fix]

parent 5ab342fe
No related branches found
No related tags found
1 merge request!14Graph regex
......@@ -66,12 +66,20 @@ endif()
target_compile_features(${module_name} PRIVATE cxx_std_14)
if (DOSANITIZE STREQUAL "ON")
set(SANITIZE_FLAGS -fsanitize=address,leak,undefined,float-divide-by-zero -fno-omit-frame-pointer)
else()
set(SANITIZE_FLAGS)
endif()
target_compile_options(${module_name} PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -Wextra -Wold-style-cast -Winline -pedantic -Werror=narrowing -Wshadow $<$<BOOL:${WERROR}>:-Werror>>)
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -Wextra -fPIC -Wold-style-cast -Winline -pedantic -Werror=narrowing -Wshadow -fstrict-aliasing -Wstrict-aliasing=1 $<$<BOOL:${WERROR}>:-Werror> ${SANITIZE_FLAGS}>)
target_compile_options(${module_name} PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:
/W4>)
$<$<CXX_COMPILER_ID:MSVC>:
/W4>)
target_link_options(${module_name} PUBLIC ${SANITIZE_FLAGS})
if(CMAKE_COMPILER_IS_GNUCXX AND COVERAGE)
append_coverage_compiler_flags()
......
......@@ -31,7 +31,7 @@ protected:
public:
Hook(std::shared_ptr<Operator> op) : mOperator(op) {}
virtual ~Hook();
virtual ~Hook() = default;
virtual void call() = 0;
......
......@@ -34,7 +34,7 @@ struct ConditionalData {
*/
//void* value;
std::unique_ptr<BaseConditionalValue> value;
const std::type_info* type;
const std::type_info* type =nullptr;
/////////////////////////////////
//
......
......@@ -24,6 +24,7 @@
#include "aidge/utils/Registrar.hpp"
#include "aidge/utils/Types.h"
namespace Aidge {
class GenericOperator_Op
: public Operator,
......
......@@ -63,7 +63,6 @@ std::shared_ptr<FsmGraph> GraphFsmInterpreter::keyF(std::shared_ptr<AstNode<gReg
return graph;
}
std::shared_ptr<FsmGraph> GraphFsmInterpreter::sepF(std::shared_ptr<FsmGraph> leftFsm,std::shared_ptr<FsmGraph> rigthFsm){
size_t idxLeft = leftFsm->getNbSubFsm();
......@@ -73,7 +72,6 @@ std::shared_ptr<FsmGraph> GraphFsmInterpreter::sepF(std::shared_ptr<FsmGraph> le
return leftFsm;
}
std::shared_ptr<FsmGraph> GraphFsmInterpreter::nextF(std::shared_ptr<FsmGraph> leftFsm,std::shared_ptr<FsmGraph> rigthFsm){
/*
combine the 2 Graph
......@@ -89,6 +87,7 @@ std::shared_ptr<FsmGraph> GraphFsmInterpreter::nextF(std::shared_ptr<FsmGraph> l
//the rigthFsm is no longer usfull
return leftFsm;
}
std::shared_ptr<FsmGraph> GraphFsmInterpreter::qomF(std::shared_ptr<FsmGraph> fsm){
/*
+
......@@ -154,6 +153,7 @@ std::shared_ptr<FsmGraph> GraphFsmInterpreter::qomF(std::shared_ptr<FsmGraph> fs
return fsm;
}
std::shared_ptr<FsmGraph> GraphFsmInterpreter::qzmF(std::shared_ptr<FsmGraph> fsm){
/*
qomf and a bypass empty start to valide
......
......@@ -223,6 +223,11 @@ using namespace Aidge;
throw std::runtime_error(errorMessage.str());
}
dataVector.push_back(data);
//clear
for (std::size_t i = 0; i < datas.size(); ++i) {
delete datas[i];
}
datas.clear();
return dataVector;
}
......@@ -255,6 +260,10 @@ using namespace Aidge;
throw std::runtime_error("EQ Unknown type encountered :" + a->getType() );
}
dataVector.push_back(data);
//clear
for (std::size_t i = 0; i < datas.size(); ++i) {
delete datas[i];
}
datas.clear();
return dataVector;
}
......@@ -286,6 +295,10 @@ using namespace Aidge;
throw std::runtime_error("NEQ Unknown type encountered :" + a->getType() );
}
dataVector.push_back(data);
//clear
for (std::size_t i = 0; i < datas.size(); ++i) {
delete datas[i];
}
datas.clear();
return dataVector;
}
......@@ -309,6 +322,10 @@ using namespace Aidge;
dataVector.push_back(data);
//clear
for (std::size_t i = 0; i < datas.size(); ++i) {
delete datas[i];
}
datas.clear();
return dataVector;
}
......@@ -332,6 +349,10 @@ using namespace Aidge;
dataVector.push_back(data);
//clear
for (std::size_t i = 0; i < datas.size(); ++i) {
delete datas[i];
}
datas.clear();
return dataVector;
}
......@@ -354,6 +375,10 @@ using namespace Aidge;
dataVector.push_back(data);
//clear
for (std::size_t i = 0; i < datas.size(); ++i) {
delete datas[i];
}
datas.clear();
return dataVector;
}
......@@ -53,6 +53,10 @@ TEST_CASE("Create good init GRegex", "[GRegex]") {
// Perform tests
REQUIRE(GReg.getStmInit().size() == 1);
REQUIRE(GReg.getStmFab().getNumberOfStm() == 1);
for (const std::string& key : nodeTypeKey) {
delete nodesRegex[key];
}
}
......@@ -101,6 +105,10 @@ TEST_CASE("Function matchFromStartNodes | One Match of Nodes sequence", "[GRegex
// Perform tests
REQUIRE(result == true_result);
for (const std::string& key : nodeTypeKey) {
delete nodesRegex[key];
}
}
TEST_CASE("Function matchFromStartNodes | One Match of parallel branches ", "[GRegex]") {
......@@ -166,6 +174,10 @@ TEST_CASE("Function matchFromStartNodes | One Match of parallel branches ", "[GR
// Perform tests
REQUIRE(result == true_result);
REQUIRE(wrong_start_result == empty_result);
for (const std::string& key : nodeTypeKey) {
delete nodesRegex[key];
}
}
/*
......
......@@ -79,6 +79,10 @@ TEST_CASE("Create good init SeqStm", "[SeqStm]") {
REQUIRE(stm.getAllCommonNode().size() == 0);
REQUIRE(stm.getAllNodeTested().size() == 0);
REQUIRE(stm.getAllNodeValidated().size() == 0);
for (const std::string& key : nodeTypeKey) {
delete nodesRegex[key];
}
}
TEST_CASE("Test testNode function", "[SeqStm]") {
......@@ -156,4 +160,8 @@ TEST_CASE("Test testNode function", "[SeqStm]") {
REQUIRE(stm.isStmBlocked() == true);
REQUIRE(stm.getAllNodeTested() == testAllNodeTested);
REQUIRE(stm.getAllNodeValidated() == testAllNodeValidated);
for (const std::string& key : nodeTypeKey) {
delete nodesRegex[key];
}
}
\ No newline at end of file
......@@ -36,6 +36,10 @@ TEST_CASE("Create good init StmFactory", "[StmFactory]") {
}
StmFactory stmF(nodesRegex);
REQUIRE(stmF.getNumberOfStm() == 0);
for (const std::string& key : nodeTypeKey) {
delete nodesRegex[key];
}
}
TEST_CASE("Test in makeNewStm the getStmIdx StmFactory", "[SeqStm]") {
......@@ -66,6 +70,10 @@ TEST_CASE("Test in makeNewStm the getStmIdx StmFactory", "[SeqStm]") {
//test the number of stm
REQUIRE(stmF.getNumberOfStm() == 2);
for (const std::string& key : nodeTypeKey) {
delete nodesRegex[key];
}
}
TEST_CASE("Test in makeNewStm the stm StmFactory", "[SeqStm]") {
......@@ -123,6 +131,9 @@ TEST_CASE("Test in makeNewStm the stm StmFactory", "[SeqStm]") {
REQUIRE(stm->getAllNodeTested() == testAllNodeTested);
REQUIRE(stm->getAllNodeValidated() == testAllNodeValidated);
for (const std::string& key : nodeTypeKey) {
delete nodesRegex[key];
}
}
......@@ -185,5 +196,9 @@ TEST_CASE("Test in duplicateStm StmFactory", "[SeqStm]") {
REQUIRE(stmD->isStmBlocked() == false);
REQUIRE(stmD->getAllNodeTested().size() == 0);
REQUIRE(stmD->getAllNodeValidated().size() == 0);
for (const std::string& key : nodeTypeKey) {
delete nodesRegex[key];
}
}
......@@ -86,6 +86,4 @@ TEST_CASE("FsmMatch") {
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment