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-Sockets.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'tests/test-Sockets.cc') diff --git a/tests/test-Sockets.cc b/tests/test-Sockets.cc index 87d557b..073548a 100644 --- a/tests/test-Sockets.cc +++ b/tests/test-Sockets.cc @@ -1,8 +1,6 @@ #include #include -BALAU_STARTUP; - using namespace Balau; class Worker : public Task { @@ -28,11 +26,11 @@ void Worker::Do() { int r; r = m_io->read(&x, 1); - Assert(x == 'x'); - Assert(r == 1); + TAssert(x == 'x'); + TAssert(r == 1); y = 'y'; r = m_io->write(&y, 1); - Assert(r == 1); + TAssert(r == 1); } Listener * listener; @@ -48,14 +46,14 @@ class Client : public Task { char x, y; IO s(new Socket()); bool c = s->connect("localhost", 1234); - Assert(c); + TAssert(c); x = 'x'; int r; r = s->write(&x, 1); - Assert(r == 1); + TAssert(r == 1); r = s->read(&y, 1); - Assert(y == 'y'); - Assert(r == 1); + TAssert(y == 'y'); + TAssert(r == 1); listener->stop(); } }; -- cgit v1.2.3