Skip to content

Commit

Permalink
asan: disable UdevWrapperDeathTest when running under address sanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkae committed Jul 17, 2024
1 parent 7aae5ed commit a6a4041
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/unit-tests/test_udev_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ typedef UdevWrapperTest UdevWrapperDeathTest;

TEST_F(UdevWrapperDeathTest, DereferencingEndReturnsInvalidObject)
{
#if !defined(__SANITIZE_ADDRESS__)
::testing::FLAGS_gtest_death_test_style = "threadsafe";
udev_environment.add_device("drm", "control64D", NULL, {}, {});
udev_environment.add_device("drm", "card1", NULL, {}, {});
Expand All @@ -335,6 +336,7 @@ TEST_F(UdevWrapperDeathTest, DereferencingEndReturnsInvalidObject)
iter++;
}
MIR_EXPECT_EXIT((*iter).subsystem(), KilledByInvalidMemoryAccess, "");
#endif
}

TEST_F(UdevWrapperTest, MemberDereferenceWorks)
Expand All @@ -353,6 +355,9 @@ TEST_F(UdevWrapperTest, MemberDereferenceWorks)

TEST_F(UdevWrapperDeathTest, MemberDereferenceOfEndDies)
{
#if defined(__SANITIZE_ADDRESS__)
(void)KilledByInvalidMemoryAccess;
#else
::testing::FLAGS_gtest_death_test_style = "threadsafe";
udev_environment.add_device("drm", "control64D", NULL, {}, {});
udev_environment.add_device("drm", "card1", NULL, {}, {});
Expand All @@ -370,6 +375,7 @@ TEST_F(UdevWrapperDeathTest, MemberDereferenceOfEndDies)
iter++;
}
MIR_EXPECT_EXIT(iter->subsystem(), KilledByInvalidMemoryAccess, "");
#endif
}

TEST_F(UdevWrapperTest, UdevMonitorDoesNotTriggerBeforeEnabling)
Expand Down

0 comments on commit a6a4041

Please sign in to comment.