59 "n", &
n,
"Number of elements in the vectors" );
64 std::vector<T> generatevector(
const int n_in)
67 std::vector<T> a(n_in);
68 for(
int i = 0; i < n_in; ++i )
89 typedef typename std::vector<T>::size_type size_type;
102 out <<
"\nTest that a[i] == i ... ";
103 vector<T> a = generatevector<T>(
n);;
104 bool local_success =
true;
105 for(
int i = 0; i <
n; ++i ) {
108 if (local_success) out <<
"passed\n";
109 else success =
false;
117 out <<
"\nTest that a.at(i) == i ...\n";
118 vector<T> a = generatevector<T>(
n);;
119 bool local_success =
true;
120 for(
int i = 0; i <
n; ++i ) {
123 if (local_success) out <<
"passed\n";
124 else success =
false;
133 #define UNIT_TEST_GROUP( T ) \ 134 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( vector, defaultConstruct, T ) \ 135 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( vector, sizedConstruct, T ) \ 136 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( vector, operatorBracket, T ) \ 137 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( vector, constAt, T ) #define UNIT_TEST_GROUP(T)
static CommandLineProcessor & getCLP()
Return the CLP to add options to.
#define TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL(TEST_GROUP, TEST_NAME, TYPE)
Macro for defining a templated unit test with one template parameter.
#define TEST_EQUALITY(v1, v2)
Assert the equality of v1 and v2.
#define TEST_COMPARE(v1, comp, v2)
Assert that v1 comp v2 (where comp = '==', '>=", "!=", etc).
const T & getConst(T &t)
Return a constant reference to an object given a non-const reference.
void setOption(const char option_true[], const char option_false[], bool *option_val, const char documentation[]=NULL)
Set a boolean option.
#define TEST_EQUALITY_CONST(v1, v2)
Assert the equality of v1 and constant v2.
TypeTo as(const TypeFrom &t)
Convert from one value type to another.
Templated array class derived from the STL std::vector.
#define TEUCHOS_TEST_EQUALITY(v1, v2, out, success)
Test that two values are equal.
#define TEST_ARRAY_ELE_EQUALITY(a, i, val)
Assert that a[i] == val.
Definition of Teuchos::as, for conversions between types.