1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : testUPointerOf.cxx
10 #include "MEDMEM_PointerOf.hxx"
11 #include "MEDMEM_Exception.hxx"
12 using namespace MEDMEM;
15 int main (int argc, char ** argv)
17 cout << "PointerOf Test" << endl ;
18 cout << "--------------" << endl;
23 // Creation d'un PointerOf de int
24 // et vérification de la methode set en essayant avec
25 // une taille nulle, négative puis positive
29 ASSERT((int *)P == NULL);
31 catch ( const std::exception &e )
33 cout << "-------------------------" << endl;
34 cout << " pb avec set(taille = 0) " << endl;
35 cout << "-------------------------" << endl;
36 MESSAGE( "catched exception : " << e.what() ) ;
43 ASSERT((int *)P == NULL);
45 catch ( const std::exception &e )
47 cout << "---------------------" << endl;
48 cout << " pb avec set(taille) " << endl;
49 cout << "---------------------" << endl;
50 MESSAGE( "catched exception : " << e.what() ) ;
57 ASSERT((int *)P != NULL);
59 catch ( const std::exception &e )
61 cout << "---------------------" << endl;
62 cout << " pb avec set(taille) " << endl;
63 cout << "---------------------" << endl;
64 MESSAGE( "catched exception : " << e.what() ) ;
67 for (int i=0; i < size; i++)
72 PointerOf<int> P2(10);
75 for (int i=0; i < size; i++)
80 int * p=new int [size];
81 for (int i=0; i < size; i++)
89 for (int i=0; i < size; i++)
95 const PointerOf<int> P4(p);
96 const PointerOf<int> P5(P4);