diff options
Diffstat (limited to 'googletest/test/googletest-param-test-test.cc')
-rw-r--r-- | googletest/test/googletest-param-test-test.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/googletest/test/googletest-param-test-test.cc b/googletest/test/googletest-param-test-test.cc index f92eb316..6ba89654 100644 --- a/googletest/test/googletest-param-test-test.cc +++ b/googletest/test/googletest-param-test-test.cc @@ -1077,6 +1077,27 @@ class NotUsedTest : public testing::TestWithParam<int> {}; template <typename T> class NotUsedTypeTest : public testing::Test {}; TYPED_TEST_SUITE_P(NotUsedTypeTest); + +// Used but not instantiated, this would fail. but... +class NotInstantiatedTest : public testing::TestWithParam<int> {}; +// ... we mark is as allowed. +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NotInstantiatedTest); + +TEST_P(NotInstantiatedTest, Used) { } + +using OtherName = NotInstantiatedTest; +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(OtherName); +TEST_P(OtherName, Used) { } + +// Used but not instantiated, this would fail. but... +template <typename T> +class NotInstantiatedTypeTest : public testing::Test {}; +TYPED_TEST_SUITE_P(NotInstantiatedTypeTest); +// ... we mark is as allowed. +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NotInstantiatedTypeTest); + +TYPED_TEST_P(NotInstantiatedTypeTest, Used) { } +REGISTER_TYPED_TEST_SUITE_P(NotInstantiatedTypeTest, Used); } // namespace works_here int main(int argc, char **argv) { |