| 49 | Element *ops_TheActiveElement = 0; |
| 50 | |
| 51 | int main(int argc, char **argv) |
| 52 | { |
| 53 | // |
| 54 | // local variables used in test |
| 55 | // |
| 56 | int numColumns = 5; |
| 57 | char *columns[numColumns]; |
| 58 | char column1[] = "col1"; |
| 59 | char column2[] = "col2"; |
| 60 | char column3[] = "col3"; |
| 61 | char column4[] = "col4"; |
| 62 | char column5[] = "col5"; |
| 63 | columns[0] = column1; |
| 64 | columns[1] = column2; |
| 65 | columns[2] = column3; |
| 66 | columns[3] = column4; |
| 67 | columns[4] = column5; |
| 68 | int result, result1, result2, result3, result4; |
| 69 | |
| 70 | Vector data1(numColumns); |
| 71 | Vector data2(numColumns-1); |
| 72 | for (int i=0; i<numColumns; i++) |
| 73 | data1(i) = i+1; |
| 74 | for (int i=0; i<numColumns-1; i++) |
| 75 | data2(i) = i+1; |
| 76 | |
| 77 | |
| 78 | |
| 79 | opserr << " *******************************************************************\n"; |
| 80 | opserr << " DataOutputStreamHandler unit test\n"; |
| 81 | opserr << " *******************************************************************\n\n"; |
| 82 | opserr << " The DataOutputStream class provides implements 2 methods \n"; |
| 83 | opserr << " open() - to open a connection to the o/p stream"; |
| 84 | opserr << " write() - to send the contents of a vector to this stream\n\n"; |
| 85 | opserr << " *******************************************************************\n"; |
| 86 | |
| 87 | // |
| 88 | // first test we can create DataOutputStream object to test. |
| 89 | // |
| 90 | |
| 91 | opserr << "TEST: Creation of DataOutputStream object - will create 3 objects 1,2, & 3\n"; |
| 92 | |
| 93 | DataOutputStreamHandler *theHandler1 = new DataOutputStreamHandler(); |
| 94 | DataOutputStreamHandler *theHandler2 = new DataOutputStreamHandler(true); |
| 95 | DataOutputStreamHandler *theHandler3 = new DataOutputStreamHandler(false); |
| 96 | DataOutputStreamHandler *theHandler4 = new DataOutputStreamHandler(); |
| 97 | |
| 98 | if (theHandler1 != 0 && theHandler2 != 0 && theHandler3 != 0) |
| 99 | opserr << "PASS: Creation of DataOutputStreamHandler object\n\n"; |
| 100 | else { |
| 101 | opserr << "FAIL: Creation of DataOutputStreamHandler object\n\n"; |
| 102 | exit(-1); |
| 103 | } |
| 104 | |
| 105 | // |
| 106 | // test open() method |
| 107 | // |
| 108 | |