template <typename T>

class WithParamInterface

Defined at line 1689 of file ../../third_party/googletest/src/googletest/include/gtest/gtest.h

The pure interface class that all value-parameterized tests inherit from.

A value-parameterized class must inherit from both ::testing::Test and

::testing::WithParamInterface. In most cases that just means inheriting

from ::testing::TestWithParam, but more complicated test hierarchies

may need to inherit from Test and WithParamInterface at different levels.

This interface has support for accessing the test parameter value via

the GetParam() method.

Use it with one of the parameter generator defining functions, like Range(),

Values(), ValuesIn(), Bool(), Combine(), and ConvertGenerator

<T

>().

class FooTest : public ::testing::TestWithParam

<int

> {

protected:

FooTest() {

// Can use GetParam() here.

}

~FooTest() override {

// Can use GetParam() here.

}

void SetUp() override {

// Can use GetParam() here.

}

void TearDown override {

// Can use GetParam() here.

}

};

TEST_P(FooTest, DoesBar) {

// Can use GetParam() method here.

Foo foo;

ASSERT_TRUE(foo.DoesBar(GetParam()));

}

INSTANTIATE_TEST_SUITE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));

Public Methods

void ~WithParamInterface<T> ()

Defined at line 1692 of file ../../third_party/googletest/src/googletest/include/gtest/gtest.h

const ParamType & GetParam ()

The current parameter value. Is also available in the test fixture's

constructor.

Defined at line 1696 of file ../../third_party/googletest/src/googletest/include/gtest/gtest.h

Friends

template <class TestClass>
class ParameterizedTestFactory