#include "sopnamsp.h" #include "machdefs.h" #include #include #include "math.h" #include #include #include #include "timing.h" #include "timestamp.h" #include "histinit.h" #include "pexceptions.h" /* Programme test de la classe TimeStamp */ /* SOPHYA - R. Ansari (LAL) - Mars 2005 */ int main(int narg, char* arg[]) { cout << " ---- Programme ttimestamp.cc - Test classe TimeStamp --- " << endl; int rc = 0; try { SophyaInit(); // PPRegister(FIO_SphereECP); // DObjRegister(FIO_SphereECP, SphereECP); InitTim(); TimeStamp ts; cout << "ts: Now : " << ts << endl; TimeStamp ts2("30/01/1962","14:22:35.65"); cout << "ts2: 30/01/1962 14:22:35.65 : " << ts2 << endl; TimeStamp ts3("01/01/1905","00:00:00"); cout << "ts3: 01/01/1905 , 00:00:00 : " << ts3 << " (double): " << (double)ts3 << endl; TimeStamp ts4("01/01/1901","03:00:20"); cout << "ts3: 01/01/1901 , 02:00:20 : " << ts4 << " (double): " << (double)ts4 << endl; } catch (PThrowable & exc) { cerr << " ttimestamp.cc: Catched Exception (PThrowable)" << (string)typeid(exc).name() << " - Msg= " << exc.Msg() << endl; rc = 99; } catch (std::exception & e) { cerr << " ttimestamp.cc: Catched std::xception " << " - what()= " << e.what() << endl; rc = 98; } catch (...) { cerr << " ttimestamp.cc: some other exception (...) was caught ! " << endl; rc = 97; } PrtTim("End ttimestamp " ); cout << " ---- Programme ttimestamp.cc- FIN (Rc=" << rc << ") --- " << endl; return rc; }