[PATCH] D121854: [scudo] Fix test harness integration

Dominic Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 16 14:10:59 PDT 2022


ddcc created this revision.
ddcc added reviewers: vitalybuka, eugenis, cryptoad, mcgrathr, hctim.
Herald added a project: All.
ddcc requested review of this revision.
Herald added a project: Sanitizers.

Explicitly specify the class name to avoid selecting the wrong Run function, and inherit from the correct Test parent


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121854

Files:
  compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
  compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp
  compiler-rt/lib/scudo/standalone/tests/primary_test.cpp


Index: compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
@@ -105,7 +105,7 @@
 
 #define SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, TYPE)                             \
   using FIXTURE##NAME##_##TYPE = FIXTURE##NAME<TYPE>;                          \
-  TEST_F(FIXTURE##NAME##_##TYPE, NAME) { Run(); }
+  TEST_F(FIXTURE##NAME##_##TYPE, NAME) { FIXTURE##NAME<TYPE>::Run(); }
 
 #define SCUDO_TYPED_TEST(FIXTURE, NAME)                                        \
   template <class TypeParam>                                                   \
Index: compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp
@@ -38,7 +38,7 @@
   EXPECT_DEATH(addFixedTag(nullptr, 0), "not supported");
 }
 
-class MemtagTest : public ::testing::Test {
+class MemtagTest : public Test {
 protected:
   void SetUp() override {
     if (!archSupportsMemoryTagging() || !systemDetectsMemoryTagFaultsTestOnly())
Index: compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
@@ -118,7 +118,7 @@
 
 #define SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, TYPE)                             \
   using FIXTURE##NAME##_##TYPE = FIXTURE##NAME<scudo::TYPE>;                   \
-  TEST_F(FIXTURE##NAME##_##TYPE, NAME) { Run(); }
+  TEST_F(FIXTURE##NAME##_##TYPE, NAME) { FIXTURE##NAME<scudo::TYPE>::Run(); }
 
 #define SCUDO_TYPED_TEST(FIXTURE, NAME)                                        \
   template <class TypeParam>                                                   \


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121854.415978.patch
Type: text/x-patch
Size: 1992 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220316/417abac7/attachment.bin>


More information about the llvm-commits mailing list