test: fix failing tests

Broken since 69d8ea4a49 because our fake screen
didn't have a root window and writing the XKB rules prop would happily
segfault. Fix this by setting up the required bits.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Michel Dänzer michel.daenzer@amd.com
(cherry picked from commit fde27b9b48)
This commit is contained in:
Peter Hutterer 2018-11-28 10:05:49 +10:00 committed by Adam Jackson
parent c44eee243e
commit 356cf07b8a
2 changed files with 9 additions and 3 deletions

View File

@ -259,6 +259,7 @@ init_simple(void)
screen.DeviceCursorInitialize = device_cursor_init; screen.DeviceCursorInitialize = device_cursor_init;
screen.DeviceCursorCleanup = device_cursor_cleanup; screen.DeviceCursorCleanup = device_cursor_cleanup;
screen.SetCursorPosition = set_cursor_pos; screen.SetCursorPosition = set_cursor_pos;
screen.root = &root;
dixResetPrivates(); dixResetPrivates();
InitAtoms(); InitAtoms();

View File

@ -29,6 +29,7 @@
#include "input.h" #include "input.h"
#include "inputstr.h" #include "inputstr.h"
#include "scrnintstr.h" #include "scrnintstr.h"
#include "windowstr.h"
#include "exevents.h" #include "exevents.h"
#include "extinit.h" #include "extinit.h"
#include "xkbsrv.h" #include "xkbsrv.h"
@ -58,11 +59,15 @@ device_cursor_cleanup(DeviceIntPtr dev, ScreenPtr screen)
static void static void
xtest_init_devices(void) xtest_init_devices(void)
{ {
ScreenRec screen; ScreenRec screen = {0};
ClientRec server_client; ClientRec server_client = {0};
WindowRec root = {0};
WindowOptRec optional = {0};
/* random stuff that needs initialization */ /* random stuff that needs initialization */
memset(&screen, 0, sizeof(screen)); root.drawable.id = 0xab;
root.optional = &optional;
screen.root = &root;
screenInfo.numScreens = 1; screenInfo.numScreens = 1;
screenInfo.screens[0] = &screen; screenInfo.screens[0] = &screen;
screen.myNum = 0; screen.myNum = 0;