Commit 41f4f368 authored by Olivier Stasse's avatar Olivier Stasse Committed by olivier stasse

[linter] Apply cppcheck

parent 3d88a00c
...@@ -144,7 +144,7 @@ TimeDependency<Time>::displayDependencies(std::ostream &os, const int depth, ...@@ -144,7 +144,7 @@ TimeDependency<Time>::displayDependencies(std::ostream &os, const int depth,
std::string ajout = "|"; std::string ajout = "|";
std::string ajout2 = "|"; std::string ajout2 = "|";
typename Dependencies::const_iterator it2 = it; typename Dependencies::const_iterator it2 = it;
it2++; ++it2;
if (it2 == dependencies.end()) { if (it2 == dependencies.end()) {
ajout = "`"; ajout = "`";
ajout2 = " "; ajout2 = " ";
......
...@@ -72,22 +72,22 @@ struct RealTimeLogger::thread { ...@@ -72,22 +72,22 @@ struct RealTimeLogger::thread {
bool changedThreadParams; bool changedThreadParams;
boost::thread t_; boost::thread t_;
thread(RealTimeLogger *logger) explicit thread(RealTimeLogger *logger)
: requestShutdown_(false), threadPolicy_(SCHED_OTHER), threadPriority_(0), : requestShutdown_(false), threadPolicy_(SCHED_OTHER), threadPriority_(0),
changedThreadParams(true), t_(&thread::spin, this, logger) {} changedThreadParams(true), t_(&thread::spin, this, logger) {}
void setThreadPolicy(int policy) { // void setThreadPolicy(int policy) {
threadPolicy_ = policy; // threadPolicy_ = policy;
changedThreadParams = true; // changedThreadParams = true;
} // }
void setPriority(int priority) { // void setPriority(int priority) {
threadPriority_ = priority; // threadPriority_ = priority;
changedThreadParams = true; // changedThreadParams = true;
} // }
int getThreadPolicy() { return threadPolicy_; } // int getThreadPolicy() { return threadPolicy_; }
int getThreadPriority() { return threadPriority_; } // int getThreadPriority() { return threadPriority_; }
void changeThreadParams() { void changeThreadParams() {
int threadPolicy; int threadPolicy;
......
...@@ -46,7 +46,7 @@ Entity::Entity(const string &name__) : name(name__) { ...@@ -46,7 +46,7 @@ Entity::Entity(const string &name__) : name(name__) {
Entity::~Entity() { Entity::~Entity() {
dgDEBUG(25) << "# In (" << name << " { " << endl; dgDEBUG(25) << "# In (" << name << " { " << endl;
for (std::map<const std::string, Command *>::iterator it = commandMap.begin(); for (std::map<const std::string, Command *>::iterator it = commandMap.begin();
it != commandMap.end(); it++) { it != commandMap.end(); ++it) {
delete it->second; delete it->second;
} }
dgDEBUGOUT(25); dgDEBUGOUT(25);
......
...@@ -83,7 +83,7 @@ std::vector<std::string> SignalCaster::listTypenames() const { ...@@ -83,7 +83,7 @@ std::vector<std::string> SignalCaster::listTypenames() const {
std::vector<std::string> typeList; std::vector<std::string> typeList;
for (std::map<std::string, cast_functions_type>::const_iterator iter = for (std::map<std::string, cast_functions_type>::const_iterator iter =
functions_.begin(); functions_.begin();
iter != functions_.end(); iter++) iter != functions_.end(); ++iter)
typeList.push_back(iter->first); typeList.push_back(iter->first);
return typeList; return typeList;
} }
......
...@@ -317,7 +317,7 @@ void TracerRealTime::display(std::ostream &os) const { ...@@ -317,7 +317,7 @@ void TracerRealTime::display(std::ostream &os) const {
os.precision(PRECISION); os.precision(PRECISION);
} }
os << endl; os << endl;
iterFile++; ++iterFile;
} }
} }
......
...@@ -67,3 +67,4 @@ DYNAMIC_GRAPH_TEST(signal-all) ...@@ -67,3 +67,4 @@ DYNAMIC_GRAPH_TEST(signal-all)
DYNAMIC_GRAPH_TEST(command-test) DYNAMIC_GRAPH_TEST(command-test)
DYNAMIC_GRAPH_TEST(test-mt) DYNAMIC_GRAPH_TEST(test-mt)
TARGET_LINK_LIBRARIES(test-mt tracer) TARGET_LINK_LIBRARIES(test-mt tracer)
DYNAMIC_GRAPH_TEST(exceptions)
...@@ -37,7 +37,7 @@ public: ...@@ -37,7 +37,7 @@ public:
bool test_four_args_; bool test_four_args_;
virtual const std::string &getClassName() const { return CLASS_NAME; } virtual const std::string &getClassName() const { return CLASS_NAME; }
CustomEntity(const std::string n) : Entity(n) { explicit CustomEntity(const std::string &n) : Entity(n) {
test_zero_arg_ = false; test_zero_arg_ = false;
test_one_arg_ = false; test_one_arg_ = false;
test_two_args_ = false; test_two_args_ = false;
...@@ -164,13 +164,13 @@ BOOST_AUTO_TEST_CASE(command_test) { ...@@ -164,13 +164,13 @@ BOOST_AUTO_TEST_CASE(command_test) {
/// Try to find the command 1_arg /// Try to find the command 1_arg
res = false; res = false;
Command *a_cmd = entity.getNewStyleCommand(vec_fname[0]); entity.getNewStyleCommand(vec_fname[0]);
BOOST_CHECK(true); BOOST_CHECK(true);
/// Generate an exception by searching a command with an empty name.w /// Generate an exception by searching a command with an empty name.w
std::string empty(""); std::string empty("");
try { try {
a_cmd = entity.getNewStyleCommand(empty); entity.getNewStyleCommand(empty);
} catch (dynamicgraph::ExceptionFactory &aef) { } catch (dynamicgraph::ExceptionFactory &aef) {
res = (aef.getCode() == dynamicgraph::ExceptionFactory::UNREFERED_FUNCTION); res = (aef.getCode() == dynamicgraph::ExceptionFactory::UNREFERED_FUNCTION);
} }
......
...@@ -19,7 +19,7 @@ struct CustomEntity : public dynamicgraph::Entity { ...@@ -19,7 +19,7 @@ struct CustomEntity : public dynamicgraph::Entity {
virtual const std::string &getClassName() const { return CLASS_NAME; } virtual const std::string &getClassName() const { return CLASS_NAME; }
CustomEntity(const std::string n) : Entity(n) {} explicit CustomEntity(const std::string &n) : Entity(n) {}
virtual ~CustomEntity() {} virtual ~CustomEntity() {}
......
...@@ -32,7 +32,7 @@ class CustomEntity : public Entity { ...@@ -32,7 +32,7 @@ class CustomEntity : public Entity {
public: public:
static const std::string CLASS_NAME; static const std::string CLASS_NAME;
virtual const std::string &getClassName() const { return CLASS_NAME; } virtual const std::string &getClassName() const { return CLASS_NAME; }
CustomEntity(const std::string n) : Entity(n) { explicit CustomEntity(const std::string &n) : Entity(n) {
logger_.setTimeSample(0.001); logger_.setTimeSample(0.001);
logger_.setStreamPrintPeriod(0.005); logger_.setStreamPrintPeriod(0.005);
logger_.setVerbosity(VERBOSITY_ALL); logger_.setVerbosity(VERBOSITY_ALL);
...@@ -62,10 +62,7 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(CustomEntity, "CustomEntity"); ...@@ -62,10 +62,7 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(CustomEntity, "CustomEntity");
} // namespace dynamicgraph } // namespace dynamicgraph
BOOST_AUTO_TEST_CASE(debug_logger_wrong_initialization) { BOOST_AUTO_TEST_CASE(debug_logger_wrong_initialization) {
std::ofstream of;
dynamicgraph::RealTimeLogger::instance(); dynamicgraph::RealTimeLogger::instance();
// of.open("/tmp/dg-LOGS.txt",std::ofstream::out|std::ofstream::app);
// dgADD_OSTREAM_TO_RTLOG (of);
BOOST_CHECK_EQUAL(dynamicgraph::CustomEntity::CLASS_NAME, "CustomEntity"); BOOST_CHECK_EQUAL(dynamicgraph::CustomEntity::CLASS_NAME, "CustomEntity");
......
...@@ -28,7 +28,7 @@ class CustomEntity : public Entity { ...@@ -28,7 +28,7 @@ class CustomEntity : public Entity {
public: public:
static const std::string CLASS_NAME; static const std::string CLASS_NAME;
virtual const std::string &getClassName() const { return CLASS_NAME; } virtual const std::string &getClassName() const { return CLASS_NAME; }
CustomEntity(const std::string n) : Entity(n) { explicit CustomEntity(const std::string &n) : Entity(n) {
logger_.setTimeSample(0.001); logger_.setTimeSample(0.001);
logger_.setStreamPrintPeriod(0.005); logger_.setStreamPrintPeriod(0.005);
logger_.setVerbosity(VERBOSITY_ALL); logger_.setVerbosity(VERBOSITY_ALL);
......
...@@ -28,7 +28,7 @@ struct MyEntity : public dynamicgraph::Entity { ...@@ -28,7 +28,7 @@ struct MyEntity : public dynamicgraph::Entity {
dynamicgraph::SignalTimeDependent<double, int> m_sigdTimeDepSOUT; dynamicgraph::SignalTimeDependent<double, int> m_sigdTimeDepSOUT;
dynamicgraph::SignalTimeDependent<double, int> m_sigdTwoTimeDepSOUT; dynamicgraph::SignalTimeDependent<double, int> m_sigdTwoTimeDepSOUT;
MyEntity(const std::string &name) explicit MyEntity(const std::string &name)
: Entity(name), : Entity(name),
m_sigdSIN("MyEntity(" + name + ")::input(double)::in_double"), m_sigdSIN("MyEntity(" + name + ")::input(double)::in_double"),
m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2), m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2),
......
...@@ -28,7 +28,7 @@ class CustomEntity : public Entity { ...@@ -28,7 +28,7 @@ class CustomEntity : public Entity {
public: public:
static const std::string CLASS_NAME; static const std::string CLASS_NAME;
virtual const std::string &getClassName() const { return CLASS_NAME; } virtual const std::string &getClassName() const { return CLASS_NAME; }
CustomEntity(const std::string n) : Entity(n) { explicit CustomEntity(const std::string &n) : Entity(n) {
dynamicgraph::dgDEBUGFLOW.openFile("/tmp/dynamic-graph-traces.txt"); dynamicgraph::dgDEBUGFLOW.openFile("/tmp/dynamic-graph-traces.txt");
} }
~CustomEntity() { ~CustomEntity() {
...@@ -53,10 +53,13 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(CustomEntity, "CustomEntity"); ...@@ -53,10 +53,13 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(CustomEntity, "CustomEntity");
BOOST_AUTO_TEST_CASE(testDebugTrace) { BOOST_AUTO_TEST_CASE(testDebugTrace) {
BOOST_CHECK_EQUAL(dynamicgraph::CustomEntity::CLASS_NAME, "CustomEntity"); BOOST_CHECK_EQUAL(dynamicgraph::CustomEntity::CLASS_NAME, "CustomEntity");
dynamicgraph::CustomEntity &entity = dynamicgraph::CustomEntity *ptr_entity =
*(dynamic_cast<dynamicgraph::CustomEntity *>( (dynamic_cast<dynamicgraph::CustomEntity *>(
dynamicgraph::FactoryStorage::getInstance()->newEntity("CustomEntity", dynamicgraph::FactoryStorage::getInstance()->newEntity("CustomEntity",
"my-entity"))); "my-entity")));
dynamicgraph::CustomEntity &entity = *ptr_entity;
entity.testDebugTrace(); entity.testDebugTrace();
/// Copy the debug file into the oss_debug_file /// Copy the debug file into the oss_debug_file
...@@ -89,4 +92,6 @@ BOOST_AUTO_TEST_CASE(testDebugTrace) { ...@@ -89,4 +92,6 @@ BOOST_AUTO_TEST_CASE(testDebugTrace) {
two_sub_string_identical = str_to_test == oss_debug_file.str(); two_sub_string_identical = str_to_test == oss_debug_file.str();
BOOST_CHECK(two_sub_string_identical); BOOST_CHECK(two_sub_string_identical);
delete ptr_entity;
} }
...@@ -27,7 +27,7 @@ struct MyEntity : public dynamicgraph::Entity { ...@@ -27,7 +27,7 @@ struct MyEntity : public dynamicgraph::Entity {
dynamicgraph::SignalTimeDependent<double, int> m_sigdTimeDepSOUT; dynamicgraph::SignalTimeDependent<double, int> m_sigdTimeDepSOUT;
dynamicgraph::SignalTimeDependent<double, int> m_sigdTwoTimeDepSOUT; dynamicgraph::SignalTimeDependent<double, int> m_sigdTwoTimeDepSOUT;
MyEntity(const std::string &name) explicit MyEntity(const std::string &name)
: Entity(name), : Entity(name),
m_sigdSIN("MyEntity(" + name + ")::input(double)::in_double"), m_sigdSIN("MyEntity(" + name + ")::input(double)::in_double"),
m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2), m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2),
......
...@@ -31,14 +31,15 @@ public: ...@@ -31,14 +31,15 @@ public:
static const std::string CLASS_NAME; static const std::string CLASS_NAME;
virtual const std::string &getClassName() const { return CLASS_NAME; } virtual const std::string &getClassName() const { return CLASS_NAME; }
CustomEntity(const std::string n) explicit CustomEntity(const std::string &n)
: Entity(n), : Entity(n),
m_sigdSIN(NULL, "CustomEntity(" + name + ")::input(double)::in_double"), m_sigdSIN(NULL, "CustomEntity(" + name + ")::input(double)::in_double"),
m_sigdSIN2(NULL, m_sigdSIN2(NULL,
"CustomEntity(" + name + ")::input(double)::in_double"), "CustomEntity(" + name + ")::input(double)::in_double"),
m_sigdTimeDepSOUT( m_sigdTimeDepSOUT(
boost::bind(&CustomEntity::update, this, _1, _2), m_sigdSIN, boost::bind(&CustomEntity::update, this, _1, _2), m_sigdSIN,
"CustomEntity(" + name + ")::input(double)::out_double") {} "CustomEntity(" + name + ")::input(double)::out_double"),
m_value(0.0) {}
~CustomEntity() { entityDeregistration(); } ~CustomEntity() { entityDeregistration(); }
......
// Copyright 2020 Olivier Stasse
// LAAS, CNRS
#include <dynamic-graph/exception-abstract.h>
#include <dynamic-graph/exception-factory.h>
#include <dynamic-graph/exception-signal.h>
#include <dynamic-graph/exception-traces.h>
#include <sstream>
#include <boost/test/output_test_stream.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/test/unit_test_suite.hpp>
using boost::test_tools::output_test_stream;
using namespace dynamicgraph;
BOOST_AUTO_TEST_CASE(exception_abstract) {
std::string msg_aea("Test exception abstract");
ExceptionAbstract aEA(10, msg_aea);
const char *aC = aEA.getMessage();
output_test_stream output;
output << aC;
BOOST_CHECK(output.is_equal("Test exception abstract"));
output << aEA;
BOOST_CHECK(
output.is_equal("AbstractError [#10]: Test exception abstract\n"));
std::string msg_aet("Test exception abstract");
ExceptionTraces aET(ExceptionTraces::GENERIC, msg_aet);
output << aET;
}
...@@ -18,7 +18,7 @@ class CustomEntity : public Entity { ...@@ -18,7 +18,7 @@ class CustomEntity : public Entity {
public: public:
static const std::string CLASS_NAME; static const std::string CLASS_NAME;
virtual const std::string &getClassName() const { return CLASS_NAME; } virtual const std::string &getClassName() const { return CLASS_NAME; }
CustomEntity(const std::string n) : Entity(n) {} explicit CustomEntity(const std::string &n) : Entity(n) {}
}; };
const std::string CustomEntity::CLASS_NAME = "CustomEntity"; const std::string CustomEntity::CLASS_NAME = "CustomEntity";
} // namespace dynamicgraph } // namespace dynamicgraph
......
...@@ -23,7 +23,7 @@ struct MyEntity : public dynamicgraph::Entity { ...@@ -23,7 +23,7 @@ struct MyEntity : public dynamicgraph::Entity {
dynamicgraph::SignalPtr<double, int> m_sigdSIN; dynamicgraph::SignalPtr<double, int> m_sigdSIN;
dynamicgraph::SignalTimeDependent<double, int> m_sigdTimeDepSOUT; dynamicgraph::SignalTimeDependent<double, int> m_sigdTimeDepSOUT;
MyEntity(const std::string &name) explicit MyEntity(const std::string &name)
: Entity(name), : Entity(name),
m_sigdSIN(NULL, "MyEntity(" + name + ")::input(double)::in_double"), m_sigdSIN(NULL, "MyEntity(" + name + ")::input(double)::in_double"),
m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2), m_sigdTimeDepSOUT(boost::bind(&MyEntity::update, this, _1, _2),
......
...@@ -76,6 +76,7 @@ BOOST_AUTO_TEST_CASE(test_base) { ...@@ -76,6 +76,7 @@ BOOST_AUTO_TEST_CASE(test_base) {
} catch (const ExceptionSignal &aea) { } catch (const ExceptionSignal &aea) {
res = (aea.getCode() == ExceptionSignal::PLUG_IMPOSSIBLE); res = (aea.getCode() == ExceptionSignal::PLUG_IMPOSSIBLE);
} }
BOOST_CHECK(res);
res = false; res = false;
try { try {
...@@ -83,6 +84,7 @@ BOOST_AUTO_TEST_CASE(test_base) { ...@@ -83,6 +84,7 @@ BOOST_AUTO_TEST_CASE(test_base) {
} catch (const ExceptionSignal &aea) { } catch (const ExceptionSignal &aea) {
res = (aea.getCode() == ExceptionSignal::PLUG_IMPOSSIBLE); res = (aea.getCode() == ExceptionSignal::PLUG_IMPOSSIBLE);
} }
BOOST_CHECK(res);
res = false; res = false;
try { try {
...@@ -101,6 +103,7 @@ BOOST_AUTO_TEST_CASE(test_base) { ...@@ -101,6 +103,7 @@ BOOST_AUTO_TEST_CASE(test_base) {
} catch (const ExceptionSignal &aea) { } catch (const ExceptionSignal &aea) {
res = (aea.getCode() == ExceptionSignal::SET_IMPOSSIBLE); res = (aea.getCode() == ExceptionSignal::SET_IMPOSSIBLE);
} }
BOOST_CHECK(res);
/// get a value /// get a value
res = false; res = false;
...@@ -110,6 +113,7 @@ BOOST_AUTO_TEST_CASE(test_base) { ...@@ -110,6 +113,7 @@ BOOST_AUTO_TEST_CASE(test_base) {
} catch (const ExceptionSignal &aea) { } catch (const ExceptionSignal &aea) {
res = (aea.getCode() == ExceptionSignal::SET_IMPOSSIBLE); res = (aea.getCode() == ExceptionSignal::SET_IMPOSSIBLE);
} }
BOOST_CHECK(res);
/// Trigger revaluation of the signal /// Trigger revaluation of the signal
res = false; res = false;
...@@ -118,6 +122,7 @@ BOOST_AUTO_TEST_CASE(test_base) { ...@@ -118,6 +122,7 @@ BOOST_AUTO_TEST_CASE(test_base) {
} catch (const ExceptionSignal &aea) { } catch (const ExceptionSignal &aea) {
res = (aea.getCode() == ExceptionSignal::SET_IMPOSSIBLE); res = (aea.getCode() == ExceptionSignal::SET_IMPOSSIBLE);
} }
BOOST_CHECK(res);
/// Trace the signal /// Trace the signal
res = false; res = false;
...@@ -126,6 +131,7 @@ BOOST_AUTO_TEST_CASE(test_base) { ...@@ -126,6 +131,7 @@ BOOST_AUTO_TEST_CASE(test_base) {
} catch (const ExceptionSignal &aea) { } catch (const ExceptionSignal &aea) {
res = (aea.getCode() == ExceptionSignal::SET_IMPOSSIBLE); res = (aea.getCode() == ExceptionSignal::SET_IMPOSSIBLE);
} }
BOOST_CHECK(res);
/// Display the signal /// Display the signal
sigB.display(output); sigB.display(output);
...@@ -142,7 +148,7 @@ BOOST_AUTO_TEST_CASE(test_cast_helper) { ...@@ -142,7 +148,7 @@ BOOST_AUTO_TEST_CASE(test_cast_helper) {
std::istringstream iss_fail; std::istringstream iss_fail;
iss.str("test"); iss.str("test");
defaultCR.cast(iss_fail); defaultCR.cast(iss_fail);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
// Take int, not string // Take int, not string
} }
} }
...@@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) { ...@@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) {
try { try {
std::istringstream ss("test"); std::istringstream ss("test");
myVectorSignal.set(ss); myVectorSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[0] != \"[\""; std::cout << "Test passed : ss[0] != \"[\"";
} }
...@@ -179,7 +179,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) { ...@@ -179,7 +179,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) {
try { try {
std::istringstream ss("[test"); std::istringstream ss("[test");
myVectorSignal.set(ss); myVectorSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[1] != %i"; std::cout << "Test passed : ss[1] != %i";
} }
...@@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) { ...@@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) {
try { try {
std::istringstream ss("[5["); std::istringstream ss("[5[");
myVectorSignal.set(ss); myVectorSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[2] != \"]\""; std::cout << "Test passed : ss[2] != \"]\"";
} }
...@@ -195,7 +195,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) { ...@@ -195,7 +195,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) {
try { try {
std::istringstream ss("[5]test"); std::istringstream ss("[5]test");
myVectorSignal.set(ss); myVectorSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[3] != \"(\""; std::cout << "Test passed : ss[3] != \"(\"";
} }
...@@ -203,7 +203,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) { ...@@ -203,7 +203,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) {
try { try {
std::istringstream ss("[5](1, "); std::istringstream ss("[5](1, ");
myVectorSignal.set(ss); myVectorSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
BOOST_ERROR("Can't happened"); BOOST_ERROR("Can't happened");
} }
...@@ -211,7 +211,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) { ...@@ -211,7 +211,7 @@ BOOST_AUTO_TEST_CASE(custom_vector_registerer) {
try { try {
std::istringstream ss("[5](1,2,3,4,5]"); std::istringstream ss("[5](1,2,3,4,5]");
myVectorSignal.set(ss); myVectorSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[-1] != \")\""; std::cout << "Test passed : ss[-1] != \")\"";
} }
} }
...@@ -232,7 +232,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -232,7 +232,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("test"); std::istringstream ss("test");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[0] != \"[\""; std::cout << "Test passed : ss[0] != \"[\"";
} }
...@@ -240,7 +240,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -240,7 +240,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("[test"); std::istringstream ss("[test");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[1] != %i"; std::cout << "Test passed : ss[1] != %i";
} }
...@@ -248,7 +248,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -248,7 +248,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("[5["); std::istringstream ss("[5[");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[2] != \",\""; std::cout << "Test passed : ss[2] != \",\"";
} }
...@@ -256,7 +256,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -256,7 +256,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("[5,c"); std::istringstream ss("[5,c");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[3] != %i"; std::cout << "Test passed : ss[3] != %i";
} }
...@@ -264,7 +264,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -264,7 +264,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("[5,3["); std::istringstream ss("[5,3[");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[4] != \"]\""; std::cout << "Test passed : ss[4] != \"]\"";
} }
...@@ -272,7 +272,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -272,7 +272,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("[5,3]test"); std::istringstream ss("[5,3]test");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[5] != \"(\""; std::cout << "Test passed : ss[5] != \"(\"";
} }
...@@ -280,7 +280,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -280,7 +280,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("[5,3](test"); std::istringstream ss("[5,3](test");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[6] != \"(\""; std::cout << "Test passed : ss[6] != \"(\"";
} }
...@@ -288,7 +288,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -288,7 +288,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("[5,3]((1,"); std::istringstream ss("[5,3]((1,");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
BOOST_ERROR("Can't happened"); BOOST_ERROR("Can't happened");
} }
...@@ -296,7 +296,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -296,7 +296,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("[5,3]((1,2,3]"); std::istringstream ss("[5,3]((1,2,3]");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << ("ss[6+n] != \")\""); std::cout << ("ss[6+n] != \")\"");
} }
...@@ -304,7 +304,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -304,7 +304,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("[5,1]((1)(2)(3["); std::istringstream ss("[5,1]((1)(2)(3[");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[5] != \")\""; std::cout << "Test passed : ss[5] != \")\"";
} }
...@@ -312,7 +312,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -312,7 +312,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("[5,1]((1)(2)(3)["); std::istringstream ss("[5,1]((1)(2)(3)[");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[5] != \")\""; std::cout << "Test passed : ss[5] != \")\"";
} }
...@@ -320,7 +320,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) { ...@@ -320,7 +320,7 @@ BOOST_AUTO_TEST_CASE(custom_matrix_registerer) {
try { try {
std::istringstream ss("[3,1]((1)(2),(3)["); std::istringstream ss("[3,1]((1)(2),(3)[");
myMatrixSignal.set(ss); myMatrixSignal.set(ss);
} catch (ExceptionSignal e) { } catch (ExceptionSignal &e) {
std::cout << "Test passed : ss[5] != \")\" and ignore \",\""; std::cout << "Test passed : ss[5] != \")\" and ignore \",\"";
} }
......
...@@ -34,7 +34,8 @@ public: ...@@ -34,7 +34,8 @@ public:
std::list<sigDouble_t *> inputsig; std::list<sigDouble_t *> inputsig;
std::list<sigString_t *> inputsigV; std::list<sigString_t *> inputsigV;