88#if GTEST_HAS_TYPED_TEST
95typedef Types<char, int> TwoTypes;
105 typename TestFixture::Vector empty;
108 typename TestFixture::IntSet empty2;
125 EXPECT_EQ(
static_cast<TypeParam
>(2), this->value_);
132class TypedTest1 :
public Test {
141class TypedTest2 :
public Test {
157class NumericTest :
public Test {
160typedef Types<int, long> NumericTypes;
172#if GTEST_HAS_TYPED_TEST_P
175using testing::internal::TypedTestCasePState;
179class TypedTestCasePStateTest :
public Test {
181 virtual void SetUp() {
182 state_.AddTestName(
"foo.cc", 0,
"FooTest",
"A");
183 state_.AddTestName(
"foo.cc", 0,
"FooTest",
"B");
184 state_.AddTestName(
"foo.cc", 0,
"FooTest",
"C");
187 TypedTestCasePState state_;
190TEST_F(TypedTestCasePStateTest, SucceedsForMatchingList) {
191 const char* tests =
"A, B, C";
193 state_.VerifyRegisteredTestNames(
"foo.cc", 1, tests));
198TEST_F(TypedTestCasePStateTest, IgnoresOrderAndSpaces) {
199 const char* tests =
"A,C, B";
201 state_.VerifyRegisteredTestNames(
"foo.cc", 1, tests));
204typedef TypedTestCasePStateTest TypedTestCasePStateDeathTest;
206TEST_F(TypedTestCasePStateDeathTest, DetectsDuplicates) {
208 state_.VerifyRegisteredTestNames(
"foo.cc", 1,
"A, B, A, C"),
209 "foo\\.cc.1.?: Test A is listed more than once\\.");
212TEST_F(TypedTestCasePStateDeathTest, DetectsExtraTest) {
214 state_.VerifyRegisteredTestNames(
"foo.cc", 1,
"A, B, C, D"),
215 "foo\\.cc.1.?: No test named D can be found in this test case\\.");
218TEST_F(TypedTestCasePStateDeathTest, DetectsMissedTest) {
220 state_.VerifyRegisteredTestNames(
"foo.cc", 1,
"A, C"),
221 "foo\\.cc.1.?: You forgot to list test B\\.");
226TEST_F(TypedTestCasePStateDeathTest, DetectsTestAfterRegistration) {
227 state_.VerifyRegisteredTestNames(
"foo.cc", 1,
"A, B, C");
229 state_.AddTestName(
"foo.cc", 2,
"FooTest",
"D"),
230 "foo\\.cc.2.?: Test D must be defined before REGISTER_TYPED_TEST_CASE_P"
231 "\\(FooTest, \\.\\.\\.\\)\\.");
264 ValuesAreCorrect, ValuesAreStillCorrect);
266typedef Types<short, long> MyTwoTypes;
273class TypedTestP1 :
public Test {
280typedef int IntAfterTypedTestCaseP;
287typedef int IntBeforeRegisterTypedTestCaseP;
292class TypedTestP2 :
public Test {
305IntAfterTypedTestCaseP after = 0;
306IntBeforeRegisterTypedTestCaseP before = 0;
320typedef Types<std::vector<double>, std::set<char> > MyContainers;
329class NumericTest :
public Test {
343 DefaultIsZero, ZeroIsLessThanOne);
344typedef Types<int, double> NumericTypes;
347static const char* GetTestName() {
351template <
typename T>
class TrimmedTest :
public Test { };
360 Test1, Test2,Test3 , Test4 ,Test5 );
361template <
typename T1,
typename T2>
struct MyPair {};
363typedef Types<int, double, MyPair<int, int> > TrimTypes;
370#if !defined(GTEST_HAS_TYPED_TEST) && !defined(GTEST_HAS_TYPED_TEST_P)
378TEST(DummyTest, TypedTestsAreNotSupportedOnThisPlatform) {}
static void TearDownTestCase()
static void SetUpTestCase()
const char * name() const
const TestInfo * current_test_info() const GTEST_LOCK_EXCLUDED_(mutex_)
static UnitTest * GetInstance()
#define EXPECT_DEATH_IF_SUPPORTED(statement, regex)
#define TEST_F(test_fixture, test_name)
#define EXPECT_EQ(val1, val2)
#define EXPECT_STREQ(s1, s2)
#define TEST(test_case_name, test_name)
#define ASSERT_TRUE(condition)
#define EXPECT_LT(val1, val2)
REGISTER_TYPED_TEST_CASE_P(TypeParamTest, TestA, TestB)
TYPED_TEST(TypedTest, TestA)
TYPED_TEST_CASE(TypedTest, MyTypes)
TYPED_TEST_CASE_P(TypeParamTest)
TYPED_TEST_P(TypeParamTest, TestA)
INSTANTIATE_TYPED_TEST_CASE_P(My, TypeParamTest, MyTypes)
#define T(meth, val, expected)