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:
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
// System Includes -------------------------------------------------------------
|
// System Includes -------------------------------------------------------------
|
||||||
#include <Looper.h>
|
#include <Looper.h>
|
||||||
|
#include <Messenger.h>
|
||||||
|
|
||||||
// Project Includes ------------------------------------------------------------
|
// Project Includes ------------------------------------------------------------
|
||||||
|
|
||||||
@@ -24,17 +25,33 @@
|
|||||||
@result Prints message "ERROR - you must Lock a looper before calling
|
@result Prints message "ERROR - you must Lock a looper before calling
|
||||||
Quit(), team=%ld, looper=%s\n"
|
Quit(), team=%ld, looper=%s\n"
|
||||||
*/
|
*/
|
||||||
void TQuitTest::QuitTest1()
|
void
|
||||||
|
TQuitTest::QuitTest1()
|
||||||
{
|
{
|
||||||
BLooper* Looper = new BLooper;
|
BLooper* looper = new BLooper;
|
||||||
Looper->Unlock();
|
looper->Unlock();
|
||||||
Looper->Quit();
|
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()");
|
TestSuite* suite = new TestSuite("BLooper::Quit()");
|
||||||
ADD_TEST4(BLooper, suite, TQuitTest, QuitTest1);
|
ADD_TEST4(BLooper, suite, TQuitTest, QuitTest1);
|
||||||
|
ADD_TEST4(BLooper, suite, TQuitTest, QuitTest2);
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class TQuitTest : public TestCase
|
|||||||
TQuitTest(std::string name) : TestCase(name) {;}
|
TQuitTest(std::string name) : TestCase(name) {;}
|
||||||
|
|
||||||
void QuitTest1();
|
void QuitTest1();
|
||||||
|
void QuitTest2();
|
||||||
|
|
||||||
static TestSuite* Suite();
|
static TestSuite* Suite();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user