mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-31 16:09:28 +02:00
Add alpha-build-only crash-me buttons, for testing of crash reporting
This commit is contained in:
parent
87652aff23
commit
d28554189d
@ -360,6 +360,31 @@ void OnCrashReport(const CommandContext &WXUNUSED(context) )
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef IS_ALPHA
|
||||
void OnSegfault(const CommandContext &)
|
||||
{
|
||||
unsigned *p = nullptr;
|
||||
*p = 0xDEADBEEF;
|
||||
}
|
||||
|
||||
void OnException(const CommandContext &)
|
||||
{
|
||||
// Throw an exception that can be caught only as (...)
|
||||
// The intent is to exercise detection of unhandled exceptions by the
|
||||
// crash reporter
|
||||
struct Unique{};
|
||||
throw Unique{};
|
||||
}
|
||||
|
||||
void OnAssertion(const CommandContext &)
|
||||
{
|
||||
// We don't use assert() much directly, but Breakpad does detect it
|
||||
// This may crash the program only in debug builds
|
||||
// See also wxSetAssertHandler, and wxApp::OnAssertFailure()
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
void OnMenuTree(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
@ -523,13 +548,25 @@ BaseItemSharedPtr HelpMenu()
|
||||
FN(OnCrashReport), AlwaysEnabledFlag )
|
||||
#endif
|
||||
|
||||
#ifdef IS_ALPHA
|
||||
#ifdef IS_ALPHA
|
||||
,
|
||||
// alpha-only items don't need to internationalize, so use
|
||||
// Verbatim for labels
|
||||
|
||||
Command( wxT("RaiseSegfault"), Verbatim("Test segfault report"),
|
||||
FN(OnSegfault), AlwaysEnabledFlag ),
|
||||
|
||||
Command( wxT("ThrowException"), Verbatim("Test exception report"),
|
||||
FN(OnException), AlwaysEnabledFlag ),
|
||||
|
||||
Command( wxT("ViolateAssertion"), Verbatim("Test assertion report"),
|
||||
FN(OnAssertion), AlwaysEnabledFlag ),
|
||||
|
||||
// Menu explorer. Perhaps this should become a macro command
|
||||
Command( wxT("MenuTree"), XXO("Menu Tree..."),
|
||||
Command( wxT("MenuTree"), Verbatim("Menu Tree..."),
|
||||
FN(OnMenuTree),
|
||||
AlwaysEnabledFlag )
|
||||
#endif
|
||||
#endif
|
||||
)
|
||||
#ifndef __WXMAC__
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user