From 4548ba403b4a80313fc26a6e1be233c74e028c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 31 May 2016 10:15:44 +0200 Subject: [PATCH] [autotest/libinput] Verify that Event::create can handle a null argument --- autotests/libinput/key_event_test.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autotests/libinput/key_event_test.cpp b/autotests/libinput/key_event_test.cpp index a5577d0aff..4f22008d1e 100644 --- a/autotests/libinput/key_event_test.cpp +++ b/autotests/libinput/key_event_test.cpp @@ -76,6 +76,9 @@ void TestLibinputKeyEvent::testCreate() // verify it's a key event QVERIFY(dynamic_cast(event.data())); QCOMPARE((libinput_event_keyboard*)(*dynamic_cast(event.data())), keyEvent); + + // verify that a nullptr passed to Event::create returns a nullptr + QVERIFY(!Event::create(nullptr)); } void TestLibinputKeyEvent::testEvent_data()