Skip to content

Commit

Permalink
iox-eclipse-iceoryx#337 Adapt mepoo integration test
Browse files Browse the repository at this point in the history
Use std::chrono::steady_clock instead of PosixTimer

Signed-off-by: Marika Lehmann <marika.lehmann@apex.ai>
  • Loading branch information
FerdinandSpitzschnueffler committed May 30, 2022
1 parent 0477dfa commit ce99af6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions iceoryx_posh/test/integrationtests/test_posh_mepoo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include "iceoryx_hoofs/cxx/optional.hpp"
#include "iceoryx_hoofs/internal/units/duration.hpp"
#include "iceoryx_hoofs/posix_wrapper/timer.hpp"
#include "iceoryx_hoofs/testing/timing_test.hpp"
#include "iceoryx_posh/error_handling/error_handling.hpp"
#include "iceoryx_posh/mepoo/mepoo_config.hpp"
Expand All @@ -41,8 +40,6 @@ using namespace iox::units::duration_literals;
using iox::mepoo::MePooConfig;
using iox::roudi::RouDiEnvironment;

using iox::posix::Timer;

class Mepoo_IntegrationTest : public Test
{
public:
Expand Down Expand Up @@ -449,18 +446,18 @@ TIMING_TEST_F(Mepoo_IntegrationTest, MempoolCreationTimeDefaultConfig, Repeat(5)
MemPoolInfoContainer memPoolTestContainer;
auto testMempoolConfig = defaultMemPoolConfig();

auto start = Timer::now();
auto start = std::chrono::steady_clock::now();

SetUp(memPoolTestContainer, testMempoolConfig, configType::DEFAULT);

auto stop = Timer::now();
auto stop = std::chrono::steady_clock::now();

// Calc the difference
iox::units::Duration timediff = stop.value() - start.value();
auto timediff = iox::units::Duration(stop - start);

PrintTiming(timediff);

/// Currently we expect that the RouDi is ready at least after 2 seconds
// Currently we expect that the RouDi is ready at least after 2 seconds
auto maxtime = 2000_ms;
EXPECT_THAT(timediff, Le(maxtime));
});
Expand Down

0 comments on commit ce99af6

Please sign in to comment.