summaryrefslogtreecommitdiff
path: root/src/test/ElementTest.cc
blob: a17e0bbedb063351b0b2140cdd248949f46eee87 (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
38
39
40
41
42
43
44
45
46
/*
 * BasicTest.cc
 *
 *  Created on: Mar 17, 2011
 *      Author: jakob
 */

#include <iostream>
#include <assert.h>
#include "Dipole.h"
#include "FODO.h"
#include "Vector3D.h"

using namespace std;
using namespace vhc;

int main() {

	//test d'affichage
	Dipole* d = new Dipole(Vector3D(0,0,0), Vector3D(1,2,0), 0.2, 0.2, Vector3D::Null, NULL);
	cout << *d << endl;
	delete d; d = NULL;

	FODO* fodo = new FODO(Vector3D(0,0,0), Vector3D(1, 0,0), 0.2, 0.2, 3);
	cout << *fodo << endl;
	delete fodo; fodo = NULL;

/*
	CurvedElement* c = new CurvedElement(Vector3D(0,1,0), Vector3D(1,0,0), 0.2, 1);
	cout << *c << endl;
	delete c; c = NULL;

	//test d'initialisation illegale
	bool caught = false;
	try {
		CurvedElement(Vector3D(0,0,0), Vector3D(1,0,0), 0.2, 1.0 / 0.4);
		//                                                   ^ le rayon de courbure est trop petit
	} catch (Exception& e) {
		caught = true;
	};
	assert(caught);

*/
	return 0;
}