diff --git a/winml/test/common/googleTestMacros.h b/winml/test/common/googleTestMacros.h index dc38c6402f..f0507435b9 100644 --- a/winml/test/common/googleTestMacros.h +++ b/winml/test/common/googleTestMacros.h @@ -10,18 +10,20 @@ } #define WINML_TEST_CLASS_BEGIN_NO_SETUP(test_class_name) \ - class test_class_name : public ::testing::Test { \ - }; + namespace { \ + class test_class_name : public ::testing::Test { \ + }; #define WINML_TEST_CLASS_BEGIN_WITH_SETUP(test_class_name, setup_method) \ - class test_class_name : public ::testing::Test { \ - protected: \ - void SetUp() override { \ - getapi().setup_method(); \ - } \ - }; + namespace { \ + class test_class_name : public ::testing::Test { \ + protected: \ + void SetUp() override { \ + getapi().setup_method(); \ + } \ + }; -#define WINML_TEST_CLASS_END() +#define WINML_TEST_CLASS_END() } // For old versions of gtest without GTEST_SKIP, stream the message and return success instead #ifndef GTEST_SKIP @@ -77,4 +79,4 @@ if (auto isEdgeCore = RuntimeParameters::Parameters.find("EdgeCore"); \ isEdgeCore != RuntimeParameters::Parameters.end() && isEdgeCore->second != "0") { \ WINML_SKIP_TEST("Test can't be run in EdgeCore"); \ - } \ No newline at end of file + }