Files
haiku-beta6/src/tests/kits/app/bhandler/UnlockLooperTest.cpp
T
Tyler Dauwalder be2939cab7 Moved the rest of the App Kit tests over to the new framework.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@383 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-22 09:28:00 +00:00

95 lines
2.5 KiB
C++

//------------------------------------------------------------------------------
// UnlockLooperTest.cpp
//
//------------------------------------------------------------------------------
// Standard Includes -----------------------------------------------------------
// System Includes -------------------------------------------------------------
#include <be/app/Looper.h>
// Project Includes ------------------------------------------------------------
// Local Includes --------------------------------------------------------------
#include "UnlockLooperTest.h"
// Local Defines ---------------------------------------------------------------
// Globals ---------------------------------------------------------------------
//------------------------------------------------------------------------------
/**
UnlockLooper()
@case handler has no looper
@results NONE
@note Original implementation apparently doesn't check to see if a
looper actually exists before trying to call Unlock() on it.
Disabled for TEST_R5.
*/
void TUnlockLooperTest::UnlockLooper1()
{
#if !defined(TEST_R5)
BHandler Handler;
Handler.UnlockLooper();
#endif
}
//------------------------------------------------------------------------------
/**
UnlockLooper()
@case handler has a looper which is initially unlocked
@results debug message "looper must be locked before proceeding" from
BLooper::AssertLock()
*/
void TUnlockLooperTest::UnlockLooper2()
{
DEBUGGER_ESCAPE;
BLooper Looper;
BHandler Handler;
Looper.AddHandler(&Handler);
if (Looper.IsLocked())
{
// Make sure the looper is unlocked
Looper.Unlock();
}
Handler.UnlockLooper();
}
//------------------------------------------------------------------------------
/**
UnlockLooper()
@case handler has a looper which is initially locked
@results NONE
*/
void TUnlockLooperTest::UnlockLooper3()
{
BLooper Looper;
BHandler Handler;
Looper.AddHandler(&Handler);
if (!Looper.IsLocked())
{
Looper.Lock();
}
Handler.UnlockLooper();
}
//------------------------------------------------------------------------------
Test* TUnlockLooperTest::Suite()
{
TestSuite* SuiteOfTests = new TestSuite("BHandler::UnlockLooper");
ADD_TEST4(BHandler, SuiteOfTests, TUnlockLooperTest, UnlockLooper1);
ADD_TEST4(BHandler, SuiteOfTests, TUnlockLooperTest, UnlockLooper2);
ADD_TEST4(BHandler, SuiteOfTests, TUnlockLooperTest, UnlockLooper3);
return SuiteOfTests;
}
//------------------------------------------------------------------------------
/*
* $Log $
*
* $Id $
*
*/