1

I have several questions about googletest framework and its usage:

By fixture in the following questions I mean a class derived from ::testing::Test

  1. As far as I know, I can use fixture along with parameterization feature of gtests. Does this apply to both value-parameterization and type-parameterization?

  2. There are cases when the fixture is irrelevant. Can I use type-parameterization with value-parameterization without fixture? How (example would be nice)?

  3. Pure interest: Can I use fixture together with type- and value-parameterization? (I am quite sure this is a needless complexity)

2
  • So with fixture you mean the derived ::testing::Test class? Some links for the particular features would be helpful to give concise answers to your question. Commented Feb 1, 2017 at 18:48
  • @πάνταῥεῖ you're right, fixture == derived from ::testing::Testthis is what I mean. I guess, what I ask are already the features of the gtest. Not sure what you mean. Commented Feb 1, 2017 at 18:56

1 Answer 1

2

As far as I know, I can use fixture along with parameterization feature of gtests. Does this apply to both value-parameterization and type-parameterization?

Yes, both value-parameterized tests and typed tests or type-parameterized tests must be derived from a fixture class. The linked documentation provides examples.

Can I use type-parameterization with value-parameterization without fixture

I presume you mean "type-parameterization OR value-parameterization". Anyway, you cannot use either without a fixture class, as per the same documentation.

Can I use fixture together with type- and value-parameterization?

Googletest does not expressly support type-and-value-parameterized tests, but you can make a good approximation to it with type-parameterized tests, as I illustrated in a previous answer

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.