Last change
on this file since 83 was
81,
checked in by rosiere, 16 years ago
|
- Finish Environment (and test)
- Continue predictor_unit
- Add external tools
- svn keyword "Id" set
|
-
Property svn:keywords set to
Id
|
File size:
1.3 KB
|
Rev | Line | |
---|
[2] | 1 | #include "tty.h" |
---|
| 2 | #include <iostream> |
---|
| 3 | |
---|
| 4 | using namespace hierarchy_memory::tty; |
---|
| 5 | using namespace std; |
---|
| 6 | |
---|
| 7 | void test_ko (int val) |
---|
| 8 | { |
---|
| 9 | cout << "***** Test(" << val << ") KO *****" << endl; |
---|
| 10 | exit (val); |
---|
| 11 | } |
---|
| 12 | |
---|
| 13 | void test_ok () |
---|
| 14 | { |
---|
| 15 | cout << "***** Test OK *****" << endl; |
---|
| 16 | // exit (0); |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | int main () |
---|
| 20 | { |
---|
| 21 | cout << "<main> Test de \"Tty\"" << endl; |
---|
| 22 | |
---|
| 23 | cout << " * Create a Tty with a size of 4" << endl; |
---|
| 24 | |
---|
| 25 | const uint32_t nb_tty = 4; |
---|
| 26 | char * name_tty [nb_tty] = {"tty_0","tty_1","tty_2","tty_3"}; |
---|
| 27 | Tty my_tty = Tty(param_t("my_tty",nb_tty,name_tty,false)); |
---|
| 28 | my_tty.reset(); |
---|
| 29 | |
---|
| 30 | cout << my_tty << endl; |
---|
| 31 | |
---|
| 32 | char * message [nb_tty] = { |
---|
| 33 | "Ici Londre : Adeline aime la saucisse de Frankort, je repete : Adeline aime la saucisse de Frankort" , |
---|
| 34 | "Ici Londre : Maurice a garer le camion de bernard dans la cour, je repete Maurice a garer le camion de bernard dans la cour", |
---|
| 35 | "Ici Londre : Londre est la ville qui diffuse des messages a la con, je repete : Londre est la ville qui diffuse des messages a la con", |
---|
| 36 | "Ici Londre : Non, le debarquement n'aura pas lieu le 6 juin 1944 en Normandie, et je ne me repete pas"}; |
---|
| 37 | |
---|
| 38 | for (uint32_t j = 0; j < nb_tty ; j ++) |
---|
| 39 | for (uint32_t i = 0; i < strlen(message[j]); i++) |
---|
| 40 | my_tty.write(j,message[j][i]); |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | cout << "<main> Press <Enter> to stop the test" << endl; |
---|
| 44 | |
---|
| 45 | getchar(); |
---|
| 46 | |
---|
| 47 | test_ok (); |
---|
| 48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.