1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : testUPointerOf.cxx
10 #include "MEDMEM_PointerOf.hxx"
11 #include "MEDMEM_Exception.hxx"
14 int main (int argc, char ** argv)
16 cout << "PointerOf Test" << endl ;
17 cout << "--------------" << endl;
22 // Creation d'un PointerOf de int
23 // et vérification de la methode set en essayant avec
24 // une taille nulle, négative puis positive
28 ASSERT((int *)P == NULL);
30 catch ( const std::exception &e )
32 cout << "-------------------------" << endl;
33 cout << " pb avec set(taille = 0) " << endl;
34 cout << "-------------------------" << endl;
35 MESSAGE( "catched exception : " << e.what() ) ;
42 ASSERT((int *)P == NULL);
44 catch ( const std::exception &e )
46 cout << "---------------------" << endl;
47 cout << " pb avec set(taille) " << endl;
48 cout << "---------------------" << endl;
49 MESSAGE( "catched exception : " << e.what() ) ;
56 ASSERT((int *)P != NULL);
58 catch ( const std::exception &e )
60 cout << "---------------------" << endl;
61 cout << " pb avec set(taille) " << endl;
62 cout << "---------------------" << endl;
63 MESSAGE( "catched exception : " << e.what() ) ;
66 for (int i=0; i < size; i++)
71 PointerOf<int> P2(10);
74 for (int i=0; i < size; i++)
79 int * p=new int [size];
80 for (int i=0; i < size; i++)
88 for (int i=0; i < size; i++)
94 const PointerOf<int> P4(p);
95 const PointerOf<int> P5(P4);