Parametrized typed tests

18 views
Skip to first unread message

dirvine

unread,
Nov 16, 2010, 4:04:56 PM11/16/10
to Google C++ Testing Framework
HI,
Sorry if this has been asked, I have searched and cannot find an
answer (although some close).

Is there a method of having a parametized test also be a typed test.

I have a situation where I wish to test some interfaces, so typed
tests are brilliant, however, I would also like to introduce some
patterns i.e. have a TYPED_TEST accept patterns the way that TEST_P
does ?

Many thanks
David

Vlad Losev

unread,
Nov 17, 2010, 12:49:04 AM11/17/10
to dirvine, Google C++ Testing Framework
Hi David,

Unfortunately, each typed tests and value parameterized tests are quite complex in implementation. Combining them, if possible, would be a nightmare to support.

If you need to test different implementation of the same interface (in the OOP sense rather than in the generics sense), you can use value parameterized tests via a technique shown in the sample 7. You can combine parameterization by the interface implementation with another parameter by using the Combine generator.

HTH,
Vlad

dirvine

unread,
Nov 17, 2010, 7:12:34 AM11/17/10
to Google C++ Testing Framework
Thanks very much I will make an attempt at this and if successful, I
may post a sample test to show how it worked. Thank you very much for
your help.

David

On Nov 17, 5:49 am, Vlad Losev <v...@losev.com> wrote:
> Hi David,
>
> Unfortunately, each typed tests and value parameterized tests are quite
> complex in implementation. Combining them, if possible, would be a nightmare
> to support.
>
> If you need to test different implementation of the same interface (in the
> OOP sense rather than in the generics sense), you can use value
> parameterized tests via a technique shown in the sample
> 7<http://code.google.com/p/googletest/source/browse/trunk/samples/sampl...>.
Reply all
Reply to author
Forward
0 new messages