1//------------------------------------------------------------------------------ 2// QuitTest.cpp 3// 4//------------------------------------------------------------------------------ 5 6// Standard Includes ----------------------------------------------------------- 7 8// System Includes ------------------------------------------------------------- 9#include <Looper.h> 10#include <Messenger.h> 11 12// Project Includes ------------------------------------------------------------ 13 14// Local Includes -------------------------------------------------------------- 15#include "QuitTest.h" 16 17// Local Defines --------------------------------------------------------------- 18 19// Globals --------------------------------------------------------------------- 20 21//------------------------------------------------------------------------------ 22/** 23 Quit() 24 @case Looper is unlocked 25 @result Prints message "ERROR - you must Lock a looper before calling 26 Quit(), team=%ld, looper=%s\n" 27 */ 28void 29TQuitTest::QuitTest1() 30{ 31 BLooper* looper = new BLooper; 32 looper->Unlock(); 33 looper->Quit(); 34} 35 36 37void 38TQuitTest::QuitTest2() 39{ 40 BLooper* looper = new BLooper; 41 looper->Run(); 42 43 BMessage reply; 44 BMessenger(looper).SendMessage(B_QUIT_REQUESTED, &reply); 45} 46 47 48//------------------------------------------------------------------------------ 49TestSuite* 50TQuitTest::Suite() 51{ 52 TestSuite* suite = new TestSuite("BLooper::Quit()"); 53 ADD_TEST4(BLooper, suite, TQuitTest, QuitTest1); 54 ADD_TEST4(BLooper, suite, TQuitTest, QuitTest2); 55 return suite; 56} 57//------------------------------------------------------------------------------ 58 59/* 60 * $Log $ 61 * 62 * $Id $ 63 * 64 */ 65 66