00001
00002
00003 #include <iostream>
00004
00005 using std::cerr ;
00006 using std::cout ;
00007 using std::endl ;
00008
00009 #include "initT.h"
00010 #include "TheCat.h"
00011 #include "TheDog.h"
00012
00013 int initT::
00014 run(void) {
00015 cout << endl << "*****************************************" << endl;
00016 cout << "Entered initT::run" << endl;
00017 int retVal = 0;
00018
00019 cout << endl << "*****************************************" << endl;
00020 cout << "Using TheCat and TheDog" << endl;
00021 if(!TheCat)
00022 {
00023 cerr << "TheCat was not created" << endl;
00024 return 1;
00025 }
00026
00027 if(!TheDog)
00028 {
00029 cerr << "TheDog was not created" << endl;
00030 return 1;
00031 }
00032
00033 cout << endl << "*************************************" << endl;
00034 string name = TheCat->get_name() ;
00035 if( name == "Muffy" )
00036 {
00037 cout << "correct cat" << endl ;
00038 }
00039 else
00040 {
00041 cerr << "incorrect cat" << endl ;
00042 retVal = 1 ;
00043 }
00044
00045 cout << endl << "*************************************" << endl;
00046 name = TheDog->get_name() ;
00047 if( name == "Killer" )
00048 {
00049 cout << "correct dog" << endl ;
00050 }
00051 else
00052 {
00053 cerr << "incorrect dog" << endl ;
00054 retVal = 1 ;
00055 }
00056
00057 cout << endl << "*****************************************" << endl;
00058 cout << "Returning from initT::run" << endl;
00059
00060 return retVal;
00061 }
00062
00063 int
00064 main(int argC, char **argV) {
00065 Application *app = new initT();
00066 return app->main(argC, argV);
00067 }
00068