Skip to content

Commit

Permalink
Enforce WINML_TEST_CLASS_BEGIN_* matches w/ a WINML_TEST_CLASS_END (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoshibata authored Jan 15, 2020
1 parent 39c9f98 commit 408e600
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions winml/test/common/googleTestMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"); \
}
}

0 comments on commit 408e600

Please sign in to comment.