stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Lemings" <Eric.Lemi...@roguewave.com>
Subject Convention for defining/calling type-based test cases
Date Mon, 21 Apr 2008 16:09:05 GMT
 
I've noticed a lot of test employing the following convention:
 
template < typename T >
test_case_X (T /*unused*/)
{
    ...
}
 
static void
run_test ()
{
    test_case_X (char ());
}
 
The type argument is typically only used for implicit binding and unused
with the test case function itself.  So couldn't the test case function
be written without the argument and the type specified explicitly at the
point of call?  Example:

template < typename T >
test_case_X ()
{
    ...
}

static void
run_test ()
{
    test_case_X <char> ();
}

This makes it a little more evident that the test case function only
tests the type itself and not instances of the type.

Brad.

Mime
View raw message