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-Sockets.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-Sockets.cc')
-rw-r--r-- | tests/test-Sockets.cc | 16 |
1 files changed, 7 insertions, 9 deletions
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 <Main.h> #include <Socket.h> -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<Worker> * listener; @@ -48,14 +46,14 @@ class Client : public Task { char x, y; IO<Socket> 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(); } }; |