diff options
author | Pixel <pixel@nobis-crew.org> | 2011-12-04 01:19:09 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-12-04 01:20:10 -0800 |
commit | d440c3f50a918a932293ad98bcec96eaa4683222 (patch) | |
tree | 33e8e42a8e4506ae9da70cdb44dd133bde7f7219 /tests/test-Http.cc | |
parent | e5577eb7a643ce7885e5d14660a6d24254161622 (diff) |
Reworked some things in the architecture, mainly exceptions and asserts.
-) Removed Assert()
-) Added AAssert(), IAssert(), RAssert(), TAssert() and Failure()
-) Reworked all asserts in the code, and added meaningful messages to them.
-) Changed the way the startup code is generated; BALAU_STARTUP is no longer necessary.
Diffstat (limited to 'tests/test-Http.cc')
-rw-r--r-- | tests/test-Http.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/test-Http.cc b/tests/test-Http.cc index 15ef7de..e6ba38d 100644 --- a/tests/test-Http.cc +++ b/tests/test-Http.cc @@ -1,7 +1,6 @@ #include <Main.h> #include <HttpServer.h> - -BALAU_STARTUP; +#include <TaskMan.h> #define DAEMON_NAME "Balau/1.0" @@ -48,13 +47,15 @@ bool TestFailure::Do(HttpServer * server, Http::Request & req, HttpServer::Actio throw GeneralException("Test..."); } +#define NTHREADS 4 + void MainTask::Do() { Printer::enable(M_DEBUG); Printer::log(M_STATUS, "Test::Http running."); - Thread * tms[4]; + Thread * tms[NTHREADS]; - for (int i = 0; i < 4; i++) + for (int i = 0; i < NTHREADS; i++) tms[i] = TaskMan::createThreadedTaskMan(); HttpServer * s = new HttpServer(); @@ -70,7 +71,7 @@ void MainTask::Do() { s->stop(); - for (int i = 0; i < 4; i++) + for (int i = 0; i < NTHREADS; i++) tms[i]->join(); Printer::log(M_STATUS, "Test::Http passed."); |