Last change
on this file since 73 was
67,
checked in by rosiere, 17 years ago
|
Ajout d'un nouveau composant : fifo generic (un port lecture et un port ecriture).
|
File size:
1.3 KB
|
Line | |
---|
1 | /* |
---|
2 | * $Id$ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Generic/Queue/SelfTest/include/test.h" |
---|
9 | |
---|
10 | #define NB_PARAMS 2 |
---|
11 | |
---|
12 | void usage (int argc, char * argv[]) |
---|
13 | { |
---|
14 | cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl |
---|
15 | << "list_params is :" << endl |
---|
16 | << " - size_queue (uint32_t)" << endl |
---|
17 | << " - size_data (uint32_t)" << endl |
---|
18 | << "" << endl; |
---|
19 | |
---|
20 | for (int i=0; i<argc; i++) |
---|
21 | cerr << argv[i] << " "; |
---|
22 | cerr << endl; |
---|
23 | |
---|
24 | exit (1); |
---|
25 | } |
---|
26 | |
---|
27 | #ifndef SYSTEMC |
---|
28 | int main (int argc, char * argv[]) |
---|
29 | #else |
---|
30 | int sc_main (int argc, char * argv[]) |
---|
31 | #endif |
---|
32 | { |
---|
33 | if (argc != 2+NB_PARAMS) |
---|
34 | usage (argc, argv); |
---|
35 | |
---|
36 | uint32_t x = 1; |
---|
37 | |
---|
38 | const string name = argv[x++]; |
---|
39 | const uint32_t size_queue = atoi(argv[x++]); |
---|
40 | const uint32_t size_data = atoi(argv[x++]); |
---|
41 | |
---|
42 | try |
---|
43 | { |
---|
44 | morpheo::behavioural::generic::queue::Parameters * param = new morpheo::behavioural::generic::queue::Parameters |
---|
45 | (size_queue, |
---|
46 | size_data |
---|
47 | ); |
---|
48 | |
---|
49 | cout << param->print(1); |
---|
50 | |
---|
51 | test (name,param); |
---|
52 | } |
---|
53 | catch (morpheo::ErrorMorpheo & error) |
---|
54 | { |
---|
55 | cout << "<" << name << "> : " << error.what (); |
---|
56 | exit (EXIT_FAILURE); |
---|
57 | } |
---|
58 | catch (...) |
---|
59 | { |
---|
60 | cerr << "<" << name << "> : This test must generate a error" << endl; |
---|
61 | exit (EXIT_FAILURE); |
---|
62 | } |
---|
63 | |
---|
64 | return (EXIT_SUCCESS); |
---|
65 | } |
---|
66 | |
---|
Note: See
TracBrowser
for help on using the repository browser.