From d440c3f50a918a932293ad98bcec96eaa4683222 Mon Sep 17 00:00:00 2001 From: Pixel Date: Sun, 4 Dec 2011 01:19:09 -0800 Subject: 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. --- tests/test-Http.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/test-Http.cc') 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 #include - -BALAU_STARTUP; +#include #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."); -- cgit v1.2.3