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:
parent
6b454d971d
commit
1c8f0d766a
@ -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)
|
||||
;
|
||||
|
||||
|
28
src/tests/servers/registrar/negative_shutdown_reply.cpp
Normal file
28
src/tests/servers/registrar/negative_shutdown_reply.cpp
Normal 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;
|
||||
}
|
17
src/tests/servers/registrar/no_shutdown_reply.cpp
Normal file
17
src/tests/servers/registrar/no_shutdown_reply.cpp
Normal 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;
|
||||
}
|
34
src/tests/servers/registrar/user_shutdown_reply.cpp
Normal file
34
src/tests/servers/registrar/user_shutdown_reply.cpp
Normal 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user