Skip to content
Snippets Groups Projects
Commit 425ee7c0 authored by Bergé's avatar Bergé
Browse files

Try to find a way to coverage more files.

Focus on signal-array (not Boost test).
Try to understand a way to make boost test and analyze signal-array.

Signed-off-by: default avatarBergé <corentin.berge@outlook.fr>
parent 580a58a5
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,7 @@ namespace dynamicgraph {
#define SEND_WARNING_STREAM_MSG(msg) SEND_MSG(msg,MSG_TYPE_WARNING_STREAM)
#define SEND_ERROR_STREAM_MSG(msg) SEND_MSG(msg,MSG_TYPE_ERROR_STREAM)
template<typename T>
/*template<typename T>
std::string toString(const T& v, const int precision=3, const int width=-1)
{
std::stringstream ss;
......@@ -71,7 +71,7 @@ namespace dynamicgraph {
else
ss<<std::fixed<<std::setprecision(precision)<<v;
return ss.str();
}
}*/
template<typename T>
std::string toString(const std::vector<T>& v, const int precision=3, const int width=-1,
......
......@@ -61,11 +61,13 @@ namespace dynamicgraph
(m_lv==VERBOSITY_INFO_WARNING_ERROR && isDebugMsg(type)))
return;
//TODO Modif ici
// if print is allowed by current verbosity level
if(isStreamMsg(type))
{
int l = line;
// check whether counter already exists
string id = file+toString(line);
string id = file+/*toString(line)*/+ l;
map<string,double>::iterator it = m_stream_msg_counters.find(id);
if(it == m_stream_msg_counters.end())
{
......
//
// Created by Corentin on 7/3/19.
//
#include <sstream>
#include <dynamic-graph/command-direct-setter.h>
#define BOOST_TEST_MODULE command
#include <boost/test/unit_test.hpp>
#include <boost/test/output_test_stream.hpp>
using boost::test_tools::output_test_stream;
struct Command : public dynamicgraph::command::DirectSetter
{
};
\ No newline at end of file
......@@ -52,6 +52,7 @@ BOOST_AUTO_TEST_CASE (constructor)
BOOST_CHECK_EQUAL (entity->getName (), "my-entity");
BOOST_CHECK_EQUAL (entity->Entity::getClassName (), "Entity");
BOOST_CHECK_EQUAL (entity->getClassName (), CustomEntity::CLASS_NAME);
//CustomEntity entity2 ("");
// Deregister entities before destroying them
dynamicgraph::PoolStorage::destroy();
......
//
// Created by corentin on 7/3/19.
//
#include <boost/foreach.hpp>
#include <dynamic-graph/signal.h>
#define BOOST_TEST_MODULE signal_array
#include <boost/test/unit_test.hpp>
#include <boost/test/output_test_stream.hpp>
using boost::test_tools::output_test_stream;
typedef dynamicgraph::SignalArray_const<int> sigInt_t;
template <>
class DummyClass
{
public:
DEF_SIZE = 20;
protected:
std::list<int> inputsig;
unsigned int inputsig_S,inputsig_R;
};
\ No newline at end of file
......@@ -109,6 +109,7 @@ BOOST_AUTO_TEST_CASE (standard_double_registerer)
output_test_stream output;
mySignal.trace (output);
BOOST_CHECK (output.is_equal (test.second));
}
}
......@@ -176,4 +177,4 @@ BOOST_AUTO_TEST_CASE (typeid_issue)
BOOST_CHECK (typeid(vA) == typeid(vB));
BOOST_CHECK_EQUAL (std::string (typeid(vA).name ()),
std::string (typeid(vB).name ()));
}
}
\ No newline at end of file
......@@ -11,6 +11,32 @@
#include <dynamic-graph/pool.h>
#include <iostream>
#define BOOST_TEST_MODULE signal_ptr
#include <boost/test/unit_test.hpp>
#include <boost/test/output_test_stream.hpp>
using boost::test_tools::output_test_stream;
typedef dynamicgraph::SignalPtr<double, int> sigDouble_t;
template<class T>
class DummyClass
{
public:
std::string proname;
int main( void )
{
......@@ -31,6 +57,7 @@ int main( void )
cout << "SigPtrA = "; sigPtrARef.get(cout); cout << std::endl;
cout << "SigPtrB = "; sigPtrBRef.get(cout); cout << std::endl;
return 0;
}
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