Last change
on this file since 85 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:
850 bytes
|
Rev | Line | |
---|
[2] | 1 | #include "ramlock.h" |
---|
| 2 | #include <iostream> |
---|
| 3 | |
---|
| 4 | using namespace hierarchy_memory::ramlock; |
---|
| 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 \"Ramlock\"" << endl; |
---|
| 22 | |
---|
| 23 | cout << " * Create a Ramlock with a size of 70" << endl; |
---|
| 24 | |
---|
| 25 | Ramlock my_ramlock = Ramlock(param_t("my_ramlock",70)); |
---|
| 26 | my_ramlock.reset(); |
---|
| 27 | |
---|
| 28 | cout << my_ramlock << endl; |
---|
| 29 | |
---|
| 30 | if (my_ramlock.read (10) != UNLOCK) test_ko(1); cout << my_ramlock << endl; |
---|
| 31 | if (my_ramlock.read (10) != LOCK) test_ko(2); cout << my_ramlock << endl; |
---|
| 32 | if (my_ramlock.write(10) != LOCK) test_ko(3); cout << my_ramlock << endl; |
---|
| 33 | if (my_ramlock.write(10) != UNLOCK) test_ko(4); cout << my_ramlock << endl; |
---|
| 34 | |
---|
| 35 | test_ok (); |
---|
| 36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.