From e7cdb5b6a0e0152297369d57774caae307e1be77 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 6 May 2017 13:34:41 +0200 Subject: tracker/test: add a quick way to crash the application Don't leave home without it. --- tracker-test/test.cpp | 6 +++++- tracker-test/test.ui | 25 ++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/tracker-test/test.cpp b/tracker-test/test.cpp index 06a4f1f2..c0bc4ef3 100644 --- a/tracker-test/test.cpp +++ b/tracker-test/test.cpp @@ -8,8 +8,10 @@ #include "test.h" #include "api/plugin-api.hpp" -#include +#include + +#include #include const double test_tracker::incr[6] = @@ -79,6 +81,8 @@ test_dialog::test_dialog() { ui.setupUi(this); + connect(ui.buttonBox->button(QDialogButtonBox::Abort), &QPushButton::clicked, []() { *(volatile int*)0 = 0; }); + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); } diff --git a/tracker-test/test.ui b/tracker-test/test.ui index 1141d584..556b19a3 100644 --- a/tracker-test/test.ui +++ b/tracker-test/test.ui @@ -9,8 +9,8 @@ 0 0 - 184 - 39 + 278 + 58 @@ -27,10 +27,29 @@ false + + + + + 0 + 0 + + + + Pressing "Abort" will immediately crash the application. + + + + + + 0 + 0 + + - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::Abort|QDialogButtonBox::Close -- cgit v1.2.3