[autotest/libinput] Verify that Event::create can handle a null argument

This commit is contained in:
Martin Gräßlin 2016-05-31 10:15:44 +02:00
parent 1e564989c9
commit 4548ba403b

View file

@ -76,6 +76,9 @@ void TestLibinputKeyEvent::testCreate()
// verify it's a key event // verify it's a key event
QVERIFY(dynamic_cast<KeyEvent*>(event.data())); QVERIFY(dynamic_cast<KeyEvent*>(event.data()));
QCOMPARE((libinput_event_keyboard*)(*dynamic_cast<KeyEvent*>(event.data())), keyEvent); QCOMPARE((libinput_event_keyboard*)(*dynamic_cast<KeyEvent*>(event.data())), keyEvent);
// verify that a nullptr passed to Event::create returns a nullptr
QVERIFY(!Event::create(nullptr));
} }
void TestLibinputKeyEvent::testEvent_data() void TestLibinputKeyEvent::testEvent_data()