[libinput] A not valid LibInput::Context should return -1 as filedescriptor
0 is a valid filedescriptor after all. Autotest extended to cover this case.
This commit is contained in:
parent
2d9ff54e68
commit
c04f193532
2 changed files with 3 additions and 1 deletions
|
@ -54,6 +54,8 @@ void TestContext::testCreateFailUdev()
|
|||
// should not have a valid libinput
|
||||
libinput *libinput = context;
|
||||
QVERIFY(!libinput);
|
||||
QVERIFY(!context.assignSeat("testSeat"));
|
||||
QCOMPARE(context.fileDescriptor(), -1);
|
||||
}
|
||||
|
||||
void TestContext::testAssignSeat_data()
|
||||
|
|
|
@ -81,7 +81,7 @@ bool Context::assignSeat(const char *seat)
|
|||
int Context::fileDescriptor()
|
||||
{
|
||||
if (!isValid()) {
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
return libinput_get_fd(m_libinput);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue