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;
103 out <<
"\nTest that a[i] == i ... ";
104 vector<T> a = generatevector<T>(
n);;
105 bool local_success =
true;
106 for(
int i = 0; i <
n; ++i ) {
109 if (local_success) out <<
"passed\n";
110 else success =
false;
118 out <<
"\nTest that a.at(i) == i ...\n";
119 vector<T> a = generatevector<T>(
n);;
120 bool local_success =
true;
121 for(
int i = 0; i <
n; ++i ) {
124 if (local_success) out <<
"passed\n";
125 else success =
false;
134 #define UNIT_TEST_GROUP( T ) \
135 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( vector, defaultConstruct, T ) \
136 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( vector, sizedConstruct, T ) \
137 TEUCHOS_UNIT_TEST_TEMPLATE_1_INSTANT( vector, operatorBracket, T ) \
138 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.
#define TEST_COMPARE_CONST(v1, comp, v2)
Assert that v1 comp v2 (where comp = '==', '>=", "!=", etc) where the second object v2 is printed as ...
Definition of Teuchos::as, for conversions between types.