Closed GoogleCodeExporter closed 8 years ago
Type parameterized tests are for verifying how your template code works when
instantiated with different types. If you want to verify your code with
different values of the same type, use value parameterized tests.
If you want different types _and_ specific parameters for each type, define and
specialize a template like this and then use it in your type parameterized
tests:
template <typename T> class ValueForType;
template <> class ValueForType<int> {
public:
static const int value = 5;
};
template <> class ValueForType<int>::value;
template <> class ValueForType<char> {
public:
static const char value = 'a';
};
template <> class ValueForType<char>::value;
You can write a macro to make defining such mappings easier.
Original comment by vladlosev
on 18 Aug 2011 at 7:28
Original issue reported on code.google.com by
charming...@gmail.com
on 15 Aug 2011 at 7:29