trf++/test/trfutil
diff -N array_t.cpp
--- array_t.cpp 7 Jul 2010 16:11:06 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,64 +0,0 @@
-// array_t.cpp
-
-#include "trfutil/array.h"
-#include <iostream>
-#include <string>
-#include <cassert>
-#include <vector>
-
-using std::cout;
-using std::cerr;
-using std::endl;
-using std::string;
-using std::vector;
-
-//**********************************************************************
-
-int main( ) {
-
- string component = "array";
- string ok_prefix = component + " (I): ";
- string error_prefix = component + " test (E): ";
-
- cout << ok_prefix
- << "---------- Testing component " + component
- + ". ----------" << endl;
-
- // Make sure assert is enabled.
- bool assert_flag = false;
- assert ( ( assert_flag = true, assert_flag ) );
- if ( ! assert_flag ) {
- cerr << "Assert is disabled" << endl;
- return 1;
- }
-
- //********************************************************************
-
- cout << ok_prefix << "Construct array." << endl;
- array<double> arr(3);
- arr(0) = 1.1;
- arr(1) = 2.2;
- arr(2) = 3.3;
- cout << arr(0) << ' ' << arr(1) << ' ' << arr(2) << endl;
- assert( arr.get_size() == 3 );
-
- //********************************************************************
-
- cout << ok_prefix << "Fetch vector." << endl;
- vector<double> vec = arr.get_std_vector();
- assert( vec.size() == 3 );
- cout << vec[0] << ' ' << vec[1] << ' ' << vec[2] << endl;
- assert( vec[0] == 1.1 );
- assert( vec[1] == 2.2 );
- assert( vec[2] == 3.3 );
-
- //********************************************************************
-
- cout << ok_prefix
- << "------------- All tests passed. -------------" << endl;
- return 0;
-
- //********************************************************************
-
-}
-