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:
Clemens Zeidler
2011-05-29 22:47:23 +00:00
parent f47952f723
commit 389f3fe159
2 changed files with 23 additions and 5 deletions
+22 -5
View File
@@ -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;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
+1
View File
@@ -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();
}; };