iceoryx_hoofs/test/moduletests/test_posix_timer.cpp
/// Unit tests which segfaults (issue #243). If the segfault is fixed this unit test has
/// to be adjusted but for the moment it seems that it causes the segfault
/// reliable.
Unit tests which segfaults (issue #243). If the segfault is fixed this unit test has
to be adjusted but for the moment it seems that it causes the segfault
reliable.
Unit tests which segfaults ( issue #243 ) . If the segfault is fixed this unit test has to be adjusted but for the moment it seems that it causes the segfault reliable .
TEST_F(Timer_test, DISABLED_SelfTriggeringTimerWorksAndDoesNotCauseSegFault)
{
    Duration selfTriggerTimeout = 1_ns;
    int repetitions = 100;
    std::atomic_int counter{0};
    {
        Timer sut{selfTriggerTimeout, [&] {
                      std::this_thread::sleep_for(std::chrono::milliseconds(100));
                      if (counter < repetitions)
                      {
                          EXPECT_FALSE(
                              sut.restart(selfTriggerTimeout, Timer::RunMode::ONCE, Timer::CatchUpPolicy::IMMEDIATE)
                                  .has_error());
                      }
                      ++counter;
                  }};
        ASSERT_FALSE(sut.start(Timer::RunMode::ONCE, Timer::CatchUpPolicy::IMMEDIATE).has_error());
        std::this_thread::sleep_for(std::chrono::milliseconds(1000));
    }
}
TEST_F ( Timer_test , DISABLED_SelfTriggeringTimerWorksAndDoesNotCauseSegFault ) { Duration selfTriggerTimeout = 1 _ns ; int repetitions = 100 ; std :: atomic_int counter { 0 } ; { Timer sut { selfTriggerTimeout , [ & ] { std :: this_thread :: sleep_for ( std :: chrono :: milliseconds ( 100 ) ) ; if ( counter < repetitions ) { EXPECT_FALSE ( sut . restart ( selfTriggerTimeout , Timer :: RunMode :: ONCE , Timer :: CatchUpPolicy :: IMMEDIATE ) . has_error ( ) ) ; } ++ counter ; } } ; ASSERT_FALSE ( sut . start ( Timer :: RunMode :: ONCE , Timer :: CatchUpPolicy :: IMMEDIATE ) . has_error ( ) ) ; std :: this_thread :: sleep_for ( std :: chrono :: milliseconds ( 1000 ) ) ; } }
Unit tests which segfaults (issue #243).
Unit tests which segfaults ( issue #243 ) .
/// this timing is set to provoke the segfault. if the timing is /// decreased the segfault is more unlikely to occure but with a /// value of 100 ms it always happens. see issue #243 /// this time seems to be sufficient to cause the segfault