From bc26665661565918af484ccd17caad951010df60 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 6 Jun 2010 20:45:53 -0700 Subject: Initialize private keys in test suite Make sure all of the private keys used by the test code are initialized before being used. Signed-off-by: Keith Packard Tested-by: Robert Hooker --- test/xi2/protocol-common.c | 13 +++++++++++-- test/xtest.c | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/xi2/protocol-common.c b/test/xi2/protocol-common.c index fd93e15da..ad18042f9 100644 --- a/test/xi2/protocol-common.c +++ b/test/xi2/protocol-common.c @@ -27,6 +27,7 @@ #include #include "extinit.h" /* for XInputExtensionInit */ +#include "exglobals.h" #include #include "protocol-common.h" @@ -107,7 +108,6 @@ ClientRec init_client(int len, void *data) /* we store the privates now and reassign it after the memset. this way * we can share them across multiple test runs and don't have to worry * about freeing them after each test run. */ - PrivateRec *privates = client.devPrivates; client.index = CLIENT_INDEX; client.clientAsMask = CLIENT_MASK; @@ -115,7 +115,7 @@ ClientRec init_client(int len, void *data) client.req_len = len; client.requestBuffer = data; - client.devPrivates = privates; + dixAllocatePrivates(&client.devPrivates, PRIVATE_CLIENT); return client; } @@ -136,6 +136,9 @@ void init_window(WindowPtr window, WindowPtr parent, int id) g_assert(window->optional); } +extern DevPrivateKeyRec miPointerScreenKeyRec; +extern DevPrivateKeyRec miPointerPrivKeyRec; + /* Needed for the screen setup, otherwise we crash during sprite initialization */ static Bool device_cursor_init(DeviceIntPtr dev, ScreenPtr screen) { return TRUE; } static Bool set_cursor_pos(DeviceIntPtr dev, ScreenPtr screen, int x, int y, Bool event) { return TRUE; } @@ -153,7 +156,13 @@ void init_simple(void) dixResetPrivates(); InitAtoms(); + XkbInitPrivates(); + XTestInitPrivates(); + dixRegisterPrivateKey(&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec)); + dixRegisterPrivateKey(&miPointerScreenKeyRec, PRIVATE_SCREEN, 0); + dixRegisterPrivateKey(&miPointerPrivKeyRec, PRIVATE_DEVICE, 0); XInputExtensionInit(); + init_window(&root, NULL, ROOT_WINDOW_ID); init_window(&window, &root, CLIENT_WINDOW_ID); diff --git a/test/xtest.c b/test/xtest.c index cc1188d7d..af75f0c90 100644 --- a/test/xtest.c +++ b/test/xtest.c @@ -30,6 +30,7 @@ #include "inputstr.h" #include "scrnintstr.h" #include "exevents.h" +#include "xkbsrv.h" #include "xserver-properties.h" #include @@ -59,6 +60,9 @@ static void xtest_init_devices(void) dixResetPrivates(); InitAtoms(); + XkbInitPrivates(); + XTestInitPrivates(); + /* this also inits the xtest devices */ InitCoreDevices(); -- cgit v1.2.3