Enforce WINML_TEST_CLASS_BEGIN_* matches w/ a WINML_TEST_CLASS_END (#2841)

This commit is contained in:
Tiago Koji Castro Shibata 2020-01-15 15:35:55 -08:00 committed by GitHub
parent 39c9f98a5d
commit 408e600bf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"); \
}
}