Renamed to HandlerLooperTest.{h,cpp}
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@384 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,63 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// LooperTest.cpp
|
|
||||||
//
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Standard Includes -----------------------------------------------------------
|
|
||||||
|
|
||||||
// System Includes -------------------------------------------------------------
|
|
||||||
#include <be/app/Looper.h>
|
|
||||||
|
|
||||||
// Project Includes ------------------------------------------------------------
|
|
||||||
|
|
||||||
// Local Includes --------------------------------------------------------------
|
|
||||||
#include "LooperTest.h"
|
|
||||||
|
|
||||||
// Local Defines ---------------------------------------------------------------
|
|
||||||
|
|
||||||
// Globals ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
Looper()
|
|
||||||
@case Not added to a BLooper
|
|
||||||
@results Returns NULL
|
|
||||||
*/
|
|
||||||
void TLooperTest::LooperTest1()
|
|
||||||
{
|
|
||||||
CPPUNIT_ASSERT(fHandler.Looper() == NULL);
|
|
||||||
}
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
Looper()
|
|
||||||
@case Add to a BLooper, then remove
|
|
||||||
@results Returns the added-to BLooper; when removed, returns NULL
|
|
||||||
*/
|
|
||||||
void TLooperTest::LooperTest2()
|
|
||||||
{
|
|
||||||
BLooper Looper;
|
|
||||||
Looper.AddHandler(&fHandler);
|
|
||||||
CPPUNIT_ASSERT(fHandler.Looper() == &Looper);
|
|
||||||
|
|
||||||
CPPUNIT_ASSERT(Looper.RemoveHandler(&fHandler));
|
|
||||||
CPPUNIT_ASSERT(fHandler.Looper() == NULL);
|
|
||||||
}
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
Test* TLooperTest::Suite()
|
|
||||||
{
|
|
||||||
TestSuite* SuiteOfTests = new TestSuite("BHandler::Looper");
|
|
||||||
|
|
||||||
ADD_TEST(SuiteOfTests, TLooperTest, LooperTest1);
|
|
||||||
ADD_TEST(SuiteOfTests, TLooperTest, LooperTest2);
|
|
||||||
|
|
||||||
return SuiteOfTests;
|
|
||||||
}
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/*
|
|
||||||
* $Log $
|
|
||||||
*
|
|
||||||
* $Id $
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// LooperTest.h
|
|
||||||
//
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifndef LOOPERTEST_H
|
|
||||||
#define LOOPERTEST_H
|
|
||||||
|
|
||||||
// Standard Includes -----------------------------------------------------------
|
|
||||||
|
|
||||||
// System Includes -------------------------------------------------------------
|
|
||||||
#if defined(TEST_R5)
|
|
||||||
#include <be/app/Handler.h>
|
|
||||||
#else
|
|
||||||
#include <Handler.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Project Includes ------------------------------------------------------------
|
|
||||||
|
|
||||||
// Local Includes --------------------------------------------------------------
|
|
||||||
#include "../common.h"
|
|
||||||
|
|
||||||
// Local Defines ---------------------------------------------------------------
|
|
||||||
|
|
||||||
// Globals ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
class TLooperTest : public TestCase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
TLooperTest() {;}
|
|
||||||
TLooperTest(std::string name) : TestCase(name) {;}
|
|
||||||
|
|
||||||
void LooperTest1();
|
|
||||||
void LooperTest2();
|
|
||||||
|
|
||||||
static Test* Suite();
|
|
||||||
|
|
||||||
private:
|
|
||||||
BHandler fHandler;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //LOOPERTEST_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* $Log $
|
|
||||||
*
|
|
||||||
* $Id $
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user