diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-Handles.cc | 22 | ||||
-rw-r--r-- | tests/test-Sanity.cc | 1 | ||||
-rw-r--r-- | tests/test-Tasks.cc | 4 |
3 files changed, 25 insertions, 2 deletions
diff --git a/tests/test-Handles.cc b/tests/test-Handles.cc new file mode 100644 index 0000000..38b020b --- /dev/null +++ b/tests/test-Handles.cc @@ -0,0 +1,22 @@ +#include <Main.h> +#include <Input.h> + +BALAU_STARTUP; + +using namespace Balau; + +void MainTask::Do() { + Printer::log(M_STATUS, "Test::Handles running."); + + bool failed = false; + try { + IO i(new Input("SomeInexistantFile.txt")); + } + catch (GeneralException) { + failed = true; + } + Assert(failed); + IO i(new Input("Makefile")); + + Printer::log(M_STATUS, "Test::Handles passed."); +} diff --git a/tests/test-Sanity.cc b/tests/test-Sanity.cc index 52a85cc..54fa626 100644 --- a/tests/test-Sanity.cc +++ b/tests/test-Sanity.cc @@ -8,6 +8,7 @@ void MainTask::Do() { Printer::log(M_STATUS, "Test::Sanity running."); Assert(sizeof(off_t) == 8); + Assert(sizeof(size_t) == 4); Printer::log(M_STATUS, "Test::Sanity passed."); } diff --git a/tests/test-Tasks.cc b/tests/test-Tasks.cc index 148f943..1faa194 100644 --- a/tests/test-Tasks.cc +++ b/tests/test-Tasks.cc @@ -30,13 +30,13 @@ void MainTask::Do() { Events::TaskEvent taskEvt(testTask); waitFor(&taskEvt); Assert(!taskEvt.gotSignal()); - suspend(); + yield(); Assert(taskEvt.gotSignal()); Events::Timeout timeout(0.1); waitFor(&timeout); Assert(!timeout.gotSignal()); - suspend(); + yield(); Assert(timeout.gotSignal()); Printer::log(M_STATUS, "Test::Tasks passed."); |