aboutsummaryrefslogtreecommitdiff
path: root/test/singleapplication-40
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-10-25 16:57:20 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-10-25 16:57:20 +0200
commit9486e7f6c3394178bd886ebc9189835ab60221a8 (patch)
treebcd0231440692ec6b99446099adc0f463f5e707f /test/singleapplication-40
parentRemove breakpad gitmodule (diff)
downloadsmolbote-9486e7f6c3394178bd886ebc9189835ab60221a8.tar.xz
Add test/ meson.build
Diffstat (limited to 'test/singleapplication-40')
-rw-r--r--test/singleapplication-40/main.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/singleapplication-40/main.cpp b/test/singleapplication-40/main.cpp
new file mode 100644
index 0000000..246dd63
--- /dev/null
+++ b/test/singleapplication-40/main.cpp
@@ -0,0 +1,21 @@
+/* https://github.com/itay-grudev/SingleApplication/issues/40
+ * SingleApplication doesn't work when two processes are started with millisecond delay
+ *
+ * To reproduce: run the app twice with './test/singleapp & ./test/singleapp'
+ */
+#include <QCoreApplication>
+#include <QDebug>
+#include <QTimer>
+
+#include <singleapplication.h>
+
+int main(int argc, char *argv[])
+{
+ SingleApplication app(argc, argv);
+ qDebug() << "process started, pid:" << QCoreApplication::applicationPid();
+
+ QTimer::singleShot(3000, &app, SLOT(quit()));
+
+ return app.exec();
+}
+