2002-07-18 05:03:19 +04:00
|
|
|
// TestApp.h
|
|
|
|
|
|
|
|
#ifndef _beos_test_app_h_
|
|
|
|
#define _beos_test_app_h_
|
|
|
|
|
|
|
|
#include <Application.h>
|
2002-12-09 15:47:37 +03:00
|
|
|
#include <List.h>
|
2002-07-18 05:03:19 +04:00
|
|
|
#include <MessageQueue.h>
|
|
|
|
|
2004-02-19 00:38:04 +03:00
|
|
|
#include <cppunit/Portability.h>
|
|
|
|
|
2002-07-18 05:03:19 +04:00
|
|
|
// TestHandler
|
|
|
|
|
2002-07-24 02:27:43 +04:00
|
|
|
class BTestHandler : public BHandler {
|
2002-07-18 05:03:19 +04:00
|
|
|
public:
|
|
|
|
virtual void MessageReceived(BMessage *message);
|
|
|
|
BMessageQueue &Queue();
|
|
|
|
|
|
|
|
private:
|
|
|
|
BMessageQueue fQueue;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// TestApp
|
|
|
|
|
2004-02-19 00:38:04 +03:00
|
|
|
class CPPUNIT_API BTestApp : public BApplication {
|
2002-07-18 05:03:19 +04:00
|
|
|
public:
|
2002-07-24 02:27:43 +04:00
|
|
|
BTestApp(const char *signature);
|
2002-12-09 15:47:37 +03:00
|
|
|
virtual ~BTestApp();
|
2002-07-18 05:03:19 +04:00
|
|
|
|
|
|
|
status_t Init();
|
|
|
|
void Terminate();
|
|
|
|
|
|
|
|
virtual void ReadyToRun();
|
|
|
|
|
2002-12-09 15:47:37 +03:00
|
|
|
BTestHandler *CreateTestHandler();
|
|
|
|
bool DeleteTestHandler(BTestHandler *handler);
|
|
|
|
|
2002-07-24 02:27:43 +04:00
|
|
|
BTestHandler &Handler();
|
2002-12-09 15:47:37 +03:00
|
|
|
BTestHandler *TestHandlerAt(int32 index);
|
2002-07-18 05:03:19 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
static int32 _AppThreadStart(void *data);
|
|
|
|
|
|
|
|
private:
|
|
|
|
thread_id fAppThread;
|
2002-12-09 15:47:37 +03:00
|
|
|
BList fHandlers;
|
2002-07-18 05:03:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _beos_test_app_h_
|