Sfoglia il codice sorgente

Activate trace and modify mixed tests

Eric Ramat 5 anni fa
parent
commit
21e07a6f92

+ 2 - 0
src/tests/dtss/CMakeLists.txt

@@ -1,3 +1,5 @@
+add_definitions(-DWITH_TRACE)
+
 INCLUDE_DIRECTORIES(
         ${CMAKE_SOURCE_DIR}/src
         ${ARTIS_INCLUDE_DIRS}

+ 2 - 0
src/tests/mixed/CMakeLists.txt

@@ -1,3 +1,5 @@
+add_definitions(-DWITH_TRACE)
+
 INCLUDE_DIRECTORIES(
         ${CMAKE_SOURCE_DIR}/src
         ${ARTIS_INCLUDE_DIRS}

+ 1 - 1
src/tests/mixed/graph_manager.hpp

@@ -150,7 +150,7 @@ namespace artis {
                         :
                         pdevs::GraphManager<common::DoubleTime>(coordinator, parameters, graph_parameters),
                         S1("S1", artis::common::NoParameters(), artis::common::NoParameters()),
-                        S2("S2", artis::dtss::Parameters<common::DoubleTime>(20), artis::common::NoParameters())
+                        S2("S2", artis::dtss::Parameters<common::DoubleTime>(2), artis::common::NoParameters())
                 {
                     add_child(OneS1, &S1);
                     add_child(OneS2, &S2);

+ 134 - 87
src/tests/mixed/models.hpp

@@ -69,7 +69,8 @@ namespace artis {
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::DELTA_INT);
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::DELTA_INT);
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
@@ -78,43 +79,48 @@ namespace artis {
                     }
                 }
 
-                void dext(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
-                        const common::Bag<common::DoubleTime>& msgs) override
+                void
+                dext(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
+                        const common::Bag<common::DoubleTime>& bag) override
                 {
 
 #ifndef WITH_TRACE
                     (void)t;
-                    (void)msgs;
+                    (void)bag;
 #endif
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::DELTA_EXT)
-                            << "messages = " << msgs.to_string();
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::DELTA_EXT)
+                            << "messages = " << bag.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
                     _phase = SEND;
                 }
 
-                void dconf(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
-                        const common::Bag<common::DoubleTime>& msgs) override
+                void dconf(typename common::DoubleTime::type t,
+                        typename common::DoubleTime::type /* e */,
+                        const common::Bag<common::DoubleTime>& bag) override
                 {
 
 #ifndef WITH_TRACE
                     (void)t;
-                    (void)msgs;
+                    (void)bag;
 #endif
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::DELTA_CONF)
-                            << "messages = " << msgs.to_string();
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::DELTA_CONF)
+                            << "messages = " << bag.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
                 }
 
-                typename common::DoubleTime::type start(typename common::DoubleTime::type t) override
+                typename common::DoubleTime::type
+                start(typename common::DoubleTime::type t) override
                 {
 
 #ifndef WITH_TRACE
@@ -123,14 +129,16 @@ namespace artis {
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::START);
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::START);
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
                     _phase = WAIT;
                     return 0;
                 }
 
-                typename common::DoubleTime::type ta(typename common::DoubleTime::type t) const override
+                typename common::DoubleTime::type
+                ta(typename common::DoubleTime::type t) const override
                 {
 #ifndef WITH_TRACE
                     (void)t;
@@ -142,31 +150,33 @@ namespace artis {
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
                     if (_phase == WAIT) {
-                        return 1;
+                        return 3;
                     } else {
                         return 0;
                     }
                 }
 
-                common::Bag<common::DoubleTime> lambda(typename common::DoubleTime::type t) const override
+                common::Bag<common::DoubleTime>
+                lambda(typename common::DoubleTime::type t) const override
                 {
 
 #ifndef WITH_TRACE
                     (void)t;
 #endif
 
-                    common::Bag<common::DoubleTime> msgs;
+                    common::Bag<common::DoubleTime> bag;
 
-                    msgs.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
+                    bag.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::LAMBDA)
-                            << "messages = " << msgs.to_string();
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::LAMBDA)
+                            << "messages = " << bag.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
-                    return msgs;
+                    return bag;
                 }
 
             private:
@@ -208,7 +218,8 @@ namespace artis {
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::DELTA_INT);
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::DELTA_INT);
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
@@ -217,44 +228,51 @@ namespace artis {
                     }
                 }
 
-                void dext(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
-                        const common::Bag<common::DoubleTime>& msgs) override
+                void
+                dext(typename common::DoubleTime::type t, typename common::DoubleTime::type e,
+                        const common::Bag<common::DoubleTime>& bag) override
                 {
 
-#ifndef WITH_TRACE
-                    (void)t;
-                    (void)msgs;
-#endif
-
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::DELTA_EXT)
-                            << "messages = " << msgs.to_string();
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::DELTA_EXT)
+                            << "messages = " << bag.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
+                    std::for_each(bag.begin(), bag.end(),
+                            [this, t, e](const common::ExternalEvent<common::DoubleTime>& /* event */) {
+                                ++_count;
+                            });
                     _phase = SEND;
                 }
 
-                void dconf(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
-                        const common::Bag<common::DoubleTime>& msgs) override
+                void dconf(typename common::DoubleTime::type t,
+                        typename common::DoubleTime::type e,
+                        const common::Bag<common::DoubleTime>& bag) override
                 {
 
 #ifndef WITH_TRACE
                     (void)t;
-                    (void)msgs;
+                    (void)bag;
 #endif
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::DELTA_CONF)
-                            << "messages = " << msgs.to_string();
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::DELTA_CONF)
+                            << "messages = " << bag.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
+                    dext(t, e, bag);
+                    dint(t);
+
                 }
 
-                typename common::DoubleTime::type start(typename common::DoubleTime::type t) override
+                typename common::DoubleTime::type
+                start(typename common::DoubleTime::type t) override
                 {
 
 #ifndef WITH_TRACE
@@ -263,15 +281,18 @@ namespace artis {
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::START);
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::START);
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
+                    _count = 0;
                     _phase = WAIT;
-                    return std::numeric_limits<double>::max();
+                    return 0; // std::numeric_limits<double>::max();
                 }
 
-                typename common::DoubleTime::type ta(typename common::DoubleTime::type t) const override
+                typename common::DoubleTime::type
+                ta(typename common::DoubleTime::type t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -291,24 +312,26 @@ namespace artis {
                     }
                 }
 
-                common::Bag<common::DoubleTime> lambda(typename common::DoubleTime::type t) const override
+                common::Bag<common::DoubleTime>
+                lambda(typename common::DoubleTime::type t) const override
                 {
 
 #ifndef WITH_TRACE
                     (void)t;
 #endif
-                    common::Bag<common::DoubleTime> msgs;
+                    common::Bag<common::DoubleTime> bag;
 
-                    msgs.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _phase));
+                    bag.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _count));
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::LAMBDA)
-                            << "messages = " << msgs.to_string();
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::LAMBDA)
+                            << "messages = " << bag.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
-                    return msgs;
+                    return bag;
                 }
 
             private:
@@ -317,6 +340,7 @@ namespace artis {
                 };
 
                 Phase _phase;
+                unsigned int _count;
             };
 
             class A2
@@ -332,7 +356,8 @@ namespace artis {
                 A2(const std::string& name,
                         const artis::dtss::Context<artis::common::DoubleTime, A2, artis::dtss::Parameters<common::DoubleTime>>& context)
                         :
-                        artis::dtss::Dynamics<artis::common::DoubleTime, A2, artis::dtss::Parameters<common::DoubleTime>>(name, context),
+                        artis::dtss::Dynamics<artis::common::DoubleTime, A2, artis::dtss::Parameters<common::DoubleTime>>(
+                                name, context),
                         _value(0)
                 {
                     input_ports({{IN, "in"}});
@@ -341,7 +366,8 @@ namespace artis {
 
                 ~A2() override = default;
 
-                void transition(const common::Bag<common::DoubleTime>& x, typename common::DoubleTime::type t) override
+                void transition(const common::Bag<common::DoubleTime>& x,
+                        typename common::DoubleTime::type t) override
                 {
 
 #ifndef WITH_TRACE
@@ -351,14 +377,16 @@ namespace artis {
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::DELTA_INT)
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::DELTA_INT)
                             << "x = " << x.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
                 }
 
-                typename common::DoubleTime::type start(typename common::DoubleTime::type t) override
+                typename common::DoubleTime::type
+                start(typename common::DoubleTime::type t) override
                 {
 
 #ifndef WITH_TRACE
@@ -367,31 +395,34 @@ namespace artis {
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::START);
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::START);
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
                     return 0;
                 }
 
-                common::Bag<common::DoubleTime> lambda(typename common::DoubleTime::type t) const override
+                common::Bag<common::DoubleTime>
+                lambda(typename common::DoubleTime::type t) const override
                 {
 
 #ifndef WITH_TRACE
                     (void)t;
 #endif
-                    common::Bag<common::DoubleTime> msgs;
+                    common::Bag<common::DoubleTime> bag;
 
-                    msgs.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
+                    bag.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::LAMBDA)
-                            << "messages = " << msgs.to_string();
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::LAMBDA)
+                            << "messages = " << bag.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
-                    return msgs;
+                    return bag;
                 }
 
             private:
@@ -411,7 +442,8 @@ namespace artis {
                 B2(const std::string& name,
                         const artis::dtss::Context<artis::common::DoubleTime, B2, artis::dtss::Parameters<common::DoubleTime>>& context)
                         :
-                        artis::dtss::Dynamics<artis::common::DoubleTime, B2, artis::dtss::Parameters<common::DoubleTime>>(name, context),
+                        artis::dtss::Dynamics<artis::common::DoubleTime, B2, artis::dtss::Parameters<common::DoubleTime>>(
+                                name, context),
                         _value(0)
                 {
                     input_ports({{IN, "in"}});
@@ -420,7 +452,8 @@ namespace artis {
 
                 ~B2() override = default;
 
-                void transition(const common::Bag<common::DoubleTime>& x, typename common::DoubleTime::type t) override
+                void transition(const common::Bag<common::DoubleTime>& x,
+                        typename common::DoubleTime::type t) override
                 {
 
 #ifndef WITH_TRACE
@@ -430,14 +463,16 @@ namespace artis {
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::DELTA_INT)
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::DELTA_INT)
                             << "x = " << x.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
                 }
 
-                typename common::DoubleTime::type start(typename common::DoubleTime::type t) override
+                typename common::DoubleTime::type
+                start(typename common::DoubleTime::type t) override
                 {
 
 #ifndef WITH_TRACE
@@ -454,24 +489,26 @@ namespace artis {
                     return 0;
                 }
 
-                common::Bag<common::DoubleTime> lambda(typename common::DoubleTime::type t) const override
+                common::Bag<common::DoubleTime>
+                lambda(typename common::DoubleTime::type t) const override
                 {
 
 #ifndef WITH_TRACE
                     (void)t;
 #endif
-                    common::Bag<common::DoubleTime> msgs;
+                    common::Bag<common::DoubleTime> bag;
 
-                    msgs.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
+                    bag.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::LAMBDA)
-                            << "messages = " << msgs.to_string();
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::LAMBDA)
+                            << "messages = " << bag.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
-                    return msgs;
+                    return bag;
                 }
 
             private:
@@ -508,7 +545,8 @@ namespace artis {
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::DELTA_INT);
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::DELTA_INT);
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
@@ -517,44 +555,49 @@ namespace artis {
                     }
                 }
 
-                void dext(typename common::DoubleTime::type t,typename common::DoubleTime::type /* e */,
-                        const common::Bag<common::DoubleTime>& msgs) override
+                void
+                dext(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
+                        const common::Bag<common::DoubleTime>& bag) override
                 {
 
 #ifndef WITH_TRACE
                     (void)t;
-                    (void)msgs;
+                    (void)bag;
 #endif
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::DELTA_EXT)
-                            << "messages = " << msgs.to_string();
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::DELTA_EXT)
+                            << "messages = " << bag.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
                     _phase = SEND;
                 }
 
-                void dconf(typename common::DoubleTime::type t,typename common::DoubleTime::type /* e */,
-                        const common::Bag<common::DoubleTime>& msgs) override
+                void dconf(typename common::DoubleTime::type t,
+                        typename common::DoubleTime::type /* e */,
+                        const common::Bag<common::DoubleTime>& bag) override
                 {
 
 #ifndef WITH_TRACE
                     (void)t;
-                    (void)msgs;
+                    (void)bag;
 #endif
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::DELTA_CONF)
-                            << "messages = " << msgs.to_string();
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::DELTA_CONF)
+                            << "messages = " << bag.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
                 }
 
-                typename common::DoubleTime::type start(typename common::DoubleTime::type t) override
+                typename common::DoubleTime::type
+                start(typename common::DoubleTime::type t) override
                 {
 
 #ifndef WITH_TRACE
@@ -563,7 +606,8 @@ namespace artis {
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::START);
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::START);
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
@@ -571,7 +615,8 @@ namespace artis {
                     return 0;
                 }
 
-                typename common::DoubleTime::type ta(typename common::DoubleTime::type t) const override
+                typename common::DoubleTime::type
+                ta(typename common::DoubleTime::type t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -591,24 +636,26 @@ namespace artis {
                     }
                 }
 
-                common::Bag<common::DoubleTime> lambda(typename common::DoubleTime::type t) const override
+                common::Bag<common::DoubleTime>
+                lambda(typename common::DoubleTime::type t) const override
                 {
 
 #ifndef WITH_TRACE
                     (void)t;
 #endif
-                    common::Bag<common::DoubleTime> msgs;
+                    common::Bag<common::DoubleTime> bag;
 
-                    msgs.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
+                    bag.push_back(artis::common::ExternalEvent<common::DoubleTime>(OUT, _value));
 
 #ifdef WITH_TRACE
                     common::Trace<common::DoubleTime>::trace()
-                            << common::TraceElement<common::DoubleTime>(get_name(), t, common::LAMBDA)
-                            << "messages = " << msgs.to_string();
+                            << common::TraceElement<common::DoubleTime>(get_name(), t,
+                                    common::LAMBDA)
+                            << "messages = " << bag.to_string();
                     common::Trace<common::DoubleTime>::trace().flush();
 #endif
 
-                    return msgs;
+                    return bag;
                 }
 
             private:

+ 40 - 8
src/tests/mixed/tests.cpp

@@ -65,7 +65,7 @@ TEST_CASE("mixed/hierachical", "run")
     REQUIRE(artis::common::Trace<DoubleTime>::trace().elements().
             filter_model_name("a1").
             filter_type(artis::common::DELTA_EXT).size() == 0);
-    for (double t = 0; t <= 100; ++t) {
+    for (double t = 0; t <= 100; t = t + 3) {
         REQUIRE(artis::common::Trace<
                 DoubleTime > ::trace().elements().
                         filter_model_name("a1").filter_time(t).
@@ -80,7 +80,7 @@ TEST_CASE("mixed/hierachical", "run")
                         filter_type(artis::common::TA).size() == 1);
     }
 
-    for (double t = 0; t <= 100; ++t) {
+    for (double t = 0; t <= 100; t = t + 3) {
         REQUIRE(artis::common::Trace<
                 DoubleTime > ::trace().elements().
                         filter_model_name("b1").filter_time(t).
@@ -89,17 +89,24 @@ TEST_CASE("mixed/hierachical", "run")
                 DoubleTime > ::trace().elements().
                         filter_model_name("b1").filter_time(t).
                         filter_type(artis::common::DELTA_INT).size() == 1);
-        REQUIRE(artis::common::Trace<
-                DoubleTime > ::trace().elements().
-                        filter_model_name("b1").filter_time(t).
-                        filter_type(artis::common::TA).size() == 2);
+        if (t == 0) {
+            REQUIRE(artis::common::Trace<
+                    DoubleTime > ::trace().elements().
+                            filter_model_name("b1").filter_time(t).
+                            filter_type(artis::common::TA).size() == 1);
+        } else {
+            REQUIRE(artis::common::Trace<
+                    DoubleTime > ::trace().elements().
+                            filter_model_name("b1").filter_time(t).
+                            filter_type(artis::common::TA).size() == 2);
+        }
         REQUIRE(artis::common::Trace<
                 DoubleTime > ::trace().elements().
                         filter_model_name("b1").filter_time(t).
                         filter_type(artis::common::DELTA_EXT).size() == 1);
     }
 
-    for (unsigned int t = 0; t <= 100; t += 20) {
+    for (unsigned int t = 0; t <= 100; t += 2) {
         REQUIRE(artis::common::Trace<
                 DoubleTime > ::trace().elements().
                         filter_model_name("a2").filter_time(t).
@@ -109,8 +116,33 @@ TEST_CASE("mixed/hierachical", "run")
                         filter_model_name("a2").filter_time(t).
                         filter_type(artis::common::DELTA_INT).size() == 1);
     }
+    REQUIRE(artis::common::Trace<
+            DoubleTime > ::trace().elements().
+                    filter_model_name("a2").filter_time(0).
+                    filter_type(artis::common::DELTA_INT).at(0).get_comment()
+                    == "x = { ( 0 , a2 , 0 ) }");
+    REQUIRE(artis::common::Trace<
+            DoubleTime > ::trace().elements().
+                    filter_model_name("a2").filter_time(2).
+                    filter_type(artis::common::DELTA_INT).at(0).get_comment()
+                    == "x = { }");
+    REQUIRE(artis::common::Trace<
+            DoubleTime > ::trace().elements().
+                    filter_model_name("a2").filter_time(4).
+                    filter_type(artis::common::DELTA_INT).at(0).get_comment()
+                    == "x = { ( 0 , a2 , 2 ) }");
+    REQUIRE(artis::common::Trace<
+            DoubleTime > ::trace().elements().
+                    filter_model_name("a2").filter_time(6).
+                    filter_type(artis::common::DELTA_INT).at(0).get_comment()
+                    == "x = { ( 0 , a2 , 2 ) }");
+    REQUIRE(artis::common::Trace<
+            DoubleTime > ::trace().elements().
+                    filter_model_name("a2").filter_time(8).
+                    filter_type(artis::common::DELTA_INT).at(0).get_comment()
+                    == "x = { ( 0 , a2 , 3 ) }");
 
-    for (unsigned int t = 0; t <= 100; t += 20) {
+    for (unsigned int t = 0; t <= 100; t += 2) {
         REQUIRE(artis::common::Trace<
                 DoubleTime > ::trace().elements().
                         filter_model_name("b2").filter_time(t).

+ 2 - 0
src/tests/pdevs/CMakeLists.txt

@@ -1,3 +1,5 @@
+add_definitions(-DWITH_TRACE)
+
 INCLUDE_DIRECTORIES(
         ${CMAKE_SOURCE_DIR}/src
         ${ARTIS_INCLUDE_DIRS}