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:
@@ -44,3 +44,28 @@ if $(TARGET_PLATFORM) = r5 {
|
|||||||
|
|
||||||
SEARCH on [ FGristFiles shutdown.cpp ] = [ FDirName $(OBOS_TOP) src bin ] ;
|
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)
|
||||||
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Ingo Weinhold, [email protected].
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Ingo Weinhold, [email protected].
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Ingo Weinhold, [email protected].
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user