00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "Epetra_SerialComm.h"
00029 #include "Newp_Jambo.h"
00030 #include <sstream>
00031
00032 #ifdef HAVE_MPI
00033 #include "mpi.h"
00034 #endif
00035
00036 int main(int argc, char *argv[]){
00037
00038 #ifdef HAVE_MPI
00039 MPI_Init(&argc, &argv);
00040 #endif
00041
00042 using namespace std;
00043
00044
00045 Epetra_SerialComm epetra_serial_comm;
00046 Epetra_Comm * epetra_comm;
00047 epetra_comm = dynamic_cast<Epetra_Comm*>(&epetra_serial_comm);
00048
00049
00050 stringbuf string_buf;
00051 streambuf * stream_buf;
00052 stream_buf = dynamic_cast<streambuf*>(&string_buf);
00053 iostream io_stream(stream_buf);
00054 ostream * o_stream;
00055 o_stream = dynamic_cast<ostream*>(&io_stream);
00056
00057
00058 Newp_Jambo new_package_jambo(*epetra_comm);
00059 new_package_jambo.Print(*o_stream);
00060
00061
00062 char temp[83];
00063 io_stream.getline(temp, 83, 0);
00064
00065 char * expected = "This will print out one line for each of the 1 processes \n\nJambo. I am process 0\n";
00066
00067 if(strcmp(temp, expected) != 0){
00068 cout << "Test Failed!" << endl << " Got::" << strlen(temp) << "::" << temp << "::" << endl << "Expected::" << strlen(expected) << "::" << expected << "::" << endl;
00069 return 1;
00070 }
00071 cout << "Test passed!" << endl;
00072 #ifdef EPETRA_MPI
00073 MPI_Finalize();
00074 #endif
00075 return 0;
00076 }