summaryrefslogtreecommitdiff
path: root/src/test/ParserTest.cc
blob: 42a0c3efd8c001cf0cb254cf94dc18bb74d055c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * simulationTest.cc
 *
 *  Created on: 28 mai 2011
 *      Author: christian
 */
#include <iostream>
#include "Parser.h"
#include "Accelerator.h"
#include "exceptions.h"

using namespace std;
using namespace vhc;

/* Ne marche pas. L'ouverture du fichier est impossible.
 * Pourtant j'ai essayé en exercice le même bout de code
 * [ que dans la méthode extract() ] pour ouvrir un fichier, et ça marchait....
 * Je suspecte un problème avec la makefile.*/

int main(){
	try{
		Parser pars("./accelerator.xml");

		Accelerator* a = pars.extract();

		cout<< *a <<endl;

		a->clear();

		delete a;
	}
	catch(Exception const& ex){
		cout<<ex.getExceptionType()<<endl
			<<ex.getMessage()<<endl;
	}
	return 0;
}