X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a0816cd508b0beceb6361a66fcf43512e18d3753..fc3a99bce15650c73f13cab08ed959925e561b98:/src/surf/trace_mgr_test.cpp diff --git a/src/surf/trace_mgr_test.cpp b/src/surf/trace_mgr_test.cpp index c498ee60cd..24e202c513 100644 --- a/src/surf/trace_mgr_test.cpp +++ b/src/surf/trace_mgr_test.cpp @@ -15,7 +15,7 @@ bool init_unit_test(); // boost forget to give this prototype on NetBSD, which d #include "xbt/log.h" #include "xbt/misc.h" -#include +#include namespace utf = boost::unit_test; namespace tmgr = simgrid::trace_mgr; @@ -28,7 +28,8 @@ public: explicit MockedResource() : simgrid::surf::Resource(nullptr, "fake", nullptr) {} void apply_event(tmgr_trace_event_t event, double value) { - XBT_VERB("t=%.1f: Change value to %lg (idx: %d)", thedate, value, event->idx); + XBT_VERB("t=%.1f: Change value to %lg (idx: %u)", thedate, value, event->idx); + tmgr_trace_event_unref(&event); } bool isUsed() { return true; } }; @@ -58,9 +59,10 @@ static void trace2vector(const char* str, std::vector* whereto res->apply_event(it, value); whereto->push_back(tmgr::DatedValue(thedate, value)); } else { - XBT_DEBUG("%.1f: ignore an event (idx: %d)\n", thedate, it->idx); + XBT_DEBUG("%.1f: ignore an event (idx: %u)\n", thedate, it->idx); } } + tmgr_finalize(); } /* Fails in a way that is difficult to test: xbt_assert should become throw @@ -155,6 +157,7 @@ static bool init_function() int main(int argc, char** argv) { + XBT_LOG_CONNECT(unit); xbt_log_init(&argc, argv); return ::boost::unit_test::unit_test_main(&init_function, argc, argv); }