Changeset 96 for XMLIO_V2/dev/dev_rv/xmlio_xml_parser.hpp
- Timestamp:
- 06/04/10 14:55:53 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/xmlio_xml_parser.hpp
r95 r96 18 18 { 19 19 THashAttributes attributes; 20 20 21 21 do { 22 22 // Traitement de l'identifiant … … 36 36 37 37 } while (_node.goToNextElement()); 38 } 38 } 39 40 static void FreeMemory(void) 41 { 42 HashMap<string, StrHashMap<Context> > &AllListContext = Context::GetAllListObject(); 43 44 for (HashMap<string, StrHashMap<Context> >::Iterator it = AllListContext.begin(); it != AllListContext.end(); it++) 45 { 46 string& id = (*it).first; 47 StrHashMap<Context>& sc = (*it).second; 48 // BUG AllListContext contient une StrHashMap<Context> liée à l'identifiant "" d'où la vérification ci-dessous. 49 if (id.size()>0) delete sc[id]; 50 } 51 } 39 52 40 53 static bool CLASS_TEST(const string& file = string("/local/testsuite/iodef_test.xml"), ostream& log = std::clog) 41 54 { 42 55 ifstream istr( file.c_str() , ifstream::in ); 43 XMLNode node = XMLNode::CreateNode(istr); 56 XMLNode node("simulation"); 57 XMLNode::CreateNode(node, istr); 44 58 XMLParser::Parse(node); 45 log << "Nombre de Contexts listés : " << Context::GetCurrentListObject().getSize() << " contre 2attendus."<< std::endl;59 log << "Nombre de Contexts listés : " << Context::GetCurrentListObject().getSize() << " contre 1 attendus."<< std::endl; 46 60 log << "Nombre de FieldGroups listés : " << FieldGroup::GetCurrentListObject().getSize() << " contre 5 attendus."<< std::endl; 47 61 log << "Description du champs votkeavt : " << Field::GetObject("votkeavt").description << " contre \"Vertical Eddy Diffusivity\" attendus."<< std::endl; 48 62 49 63 log << "Test XMLParser ... ok !" << std::endl; 64 65 FreeMemory(); // Pour supprimer la mémoire liée à l'allocation dynamique. 66 50 67 return (true); 51 68 }
Note: See TracChangeset
for help on using the changeset viewer.