Fixes in BLooper and its tests.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@84 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
ejakowatz
2002-07-11 15:49:01 +00:00
parent 09cdca467d
commit 865f9d8e38
3 changed files with 38 additions and 12 deletions
@@ -4,6 +4,7 @@
//------------------------------------------------------------------------------
// Standard Includes -----------------------------------------------------------
#include <iostream>
// System Includes -------------------------------------------------------------
#include <Looper.h>
@@ -17,13 +18,18 @@
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
port_id _get_looper_port_(const BLooper* looper);
//------------------------------------------------------------------------------
//case 1: looper is unlocked and queue is empty
void TIsMessageWaitingTest::IsMessageWaiting1()
{
BLooper Looper;
#ifndef TEST_R5
assert(!Looper.IsMessageWaiting());
#else
assert(Looper.IsMessageWaiting());
#endif
}
//------------------------------------------------------------------------------
//case 2: looper is unlocked and queue is filled
@@ -39,7 +45,11 @@ void TIsMessageWaitingTest::IsMessageWaiting3()
{
BLooper Looper;
Looper.Lock();
#ifndef TEST_R5
assert(!Looper.IsMessageWaiting());
#else
assert(Looper.IsMessageWaiting());
#endif
}
//------------------------------------------------------------------------------
//case 4: looper is locked and queue is filled
@@ -36,7 +36,7 @@ void TRemoveHandlerTest::RemoveHandler1()
Handler.AddFilter(MessageFilter);
Looper.AddHandler(&Handler);
Looper.RemoveHandler(&Handler);
assert(Handler.FilterList() == NULL);
assert(Handler.FilterList());
}
//------------------------------------------------------------------------------
Test* TRemoveHandlerTest::Suite()