Added a few apps for testing the shutdown process.

user_shutdown_reply reliably crashes the app server when pressing one
of its buttons (during the shutdown process at least).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13540 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2005-07-07 15:35:22 +00:00
parent 6b454d971d
commit 1c8f0d766a
4 changed files with 104 additions and 0 deletions

View File

@ -44,3 +44,28 @@ if $(TARGET_PLATFORM) = r5 {
SEARCH on [ FGristFiles shutdown.cpp ] = [ FDirName $(OBOS_TOP) src bin ] ;
}
# Two small test apps for testing the shutdown process.
local libbe ;
if $(TARGET_PLATFORM) = r5 {
libbe = libopenbeos.so ;
} else {
libbe = be ;
}
SimpleTest no_shutdown_reply
: no_shutdown_reply.cpp
: $(libbe)
;
SimpleTest negative_shutdown_reply
: negative_shutdown_reply.cpp
: $(libbe)
;
SimpleTest user_shutdown_reply
: user_shutdown_reply.cpp
: $(libbe)
;

View File

@ -0,0 +1,28 @@
/*
* Copyright 2005, Ingo Weinhold, bonefish@users.sf.net.
* Distributed under the terms of the MIT License.
*/
#include <Application.h>
class TestApp : public BApplication {
public:
TestApp()
: BApplication("application/x-vnd.haiku.negative-shutdown-reply")
{
}
virtual bool QuitRequested()
{
return false;
}
};
int
main()
{
TestApp app;
app.Run();
return 0;
}

View File

@ -0,0 +1,17 @@
/*
* Copyright 2005, Ingo Weinhold, bonefish@users.sf.net.
* Distributed under the terms of the MIT License.
*/
#include <Application.h>
int
main()
{
BApplication app("application/x-vnd.haiku.no-shutdown-reply");
while (true)
snooze(1000000);
return 0;
}

View File

@ -0,0 +1,34 @@
/*
* Copyright 2005, Ingo Weinhold, bonefish@users.sf.net.
* Distributed under the terms of the MIT License.
*/
#include <Alert.h>
#include <Application.h>
class TestApp : public BApplication {
public:
TestApp()
: BApplication("application/x-vnd.haiku.user-shutdown-reply")
{
}
virtual bool QuitRequested()
{
BAlert *alert = new BAlert("Quit App?",
"Quit application user_shutdown_reply?",
"Quit", "Cancel", NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
int32 result = alert->Go();
return (result == 0);
}
};
int
main()
{
TestApp app;
app.Run();
return 0;
}