Add a simple test just to check that the synchronous quit request does not crash.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41824 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f47952f723
commit
389f3fe159
@ -7,6 +7,7 @@
|
||||
|
||||
// System Includes -------------------------------------------------------------
|
||||
#include <Looper.h>
|
||||
#include <Messenger.h>
|
||||
|
||||
// Project Includes ------------------------------------------------------------
|
||||
|
||||
@ -24,17 +25,33 @@
|
||||
@result Prints message "ERROR - you must Lock a looper before calling
|
||||
Quit(), team=%ld, looper=%s\n"
|
||||
*/
|
||||
void TQuitTest::QuitTest1()
|
||||
void
|
||||
TQuitTest::QuitTest1()
|
||||
{
|
||||
BLooper* Looper = new BLooper;
|
||||
Looper->Unlock();
|
||||
Looper->Quit();
|
||||
BLooper* looper = new BLooper;
|
||||
looper->Unlock();
|
||||
looper->Quit();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TQuitTest::QuitTest2()
|
||||
{
|
||||
BLooper* looper = new BLooper;
|
||||
looper->Run();
|
||||
|
||||
BMessage reply;
|
||||
BMessenger(looper).SendMessage(B_QUIT_REQUESTED, &reply);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
TestSuite* TQuitTest::Suite()
|
||||
TestSuite*
|
||||
TQuitTest::Suite()
|
||||
{
|
||||
TestSuite* suite = new TestSuite("BLooper::Quit()");
|
||||
ADD_TEST4(BLooper, suite, TQuitTest, QuitTest1);
|
||||
ADD_TEST4(BLooper, suite, TQuitTest, QuitTest2);
|
||||
return suite;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -26,6 +26,7 @@ class TQuitTest : public TestCase
|
||||
TQuitTest(std::string name) : TestCase(name) {;}
|
||||
|
||||
void QuitTest1();
|
||||
void QuitTest2();
|
||||
|
||||
static TestSuite* Suite();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user