summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-06-06 20:45:53 -0700
committerKeith Packard <keithp@keithp.com>2010-06-06 21:24:04 -0700
commitbc26665661565918af484ccd17caad951010df60 (patch)
tree1f922d9d23c3b43974714c0df0715a467a231a5d /test
parentf03be727d647183a2176355ad0ac9a6735067be9 (diff)
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 <keithp@keithp.com> Tested-by: Robert Hooker <sarvatt@ubuntu.com>
Diffstat (limited to 'test')
-rw-r--r--test/xi2/protocol-common.c13
-rw-r--r--test/xtest.c4
2 files changed, 15 insertions, 2 deletions
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 <stdint.h>
#include "extinit.h" /* for XInputExtensionInit */
+#include "exglobals.h"
#include <glib.h>
#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 <glib.h>
@@ -59,6 +60,9 @@ static void xtest_init_devices(void)
dixResetPrivates();
InitAtoms();
+ XkbInitPrivates();
+ XTestInitPrivates();
+
/* this also inits the xtest devices */
InitCoreDevices();