summaryrefslogtreecommitdiff
path: root/test/xtest.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-04-15 14:51:06 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-04-21 13:43:43 +1000
commit196d679bed2e9959d2fca89d4ee4bbc551681d0b (patch)
treeabcabc5615512cc1824de33ce090d658603b45ea /test/xtest.c
parent071a6ac4d0c347aa7fc6efe37f4f6992524d7ef1 (diff)
test: remove glib dependency
The few features from the glib test suite we used can be replaced with assert and printf. This patch is a simple replacement for these two g_assert → assert g_test_message → printf g_test_init is removed and so is g_test_bug_base. g_test_run replaced with a simple return 0. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Tiago Vignatti <tiago.vignatti@nokia.com> Acked-by: Gaetan Nadon <memsize@videotron.ca>
Diffstat (limited to 'test/xtest.c')
-rw-r--r--test/xtest.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/test/xtest.c b/test/xtest.c
index 6ea6862f7..2ab46505f 100644
--- a/test/xtest.c
+++ b/test/xtest.c
@@ -33,8 +33,6 @@
#include "xkbsrv.h"
#include "xserver-properties.h"
-#include <glib.h>
-
/**
*/
@@ -65,14 +63,14 @@ static void xtest_init_devices(void)
/* this also inits the xtest devices */
InitCoreDevices();
- g_assert(xtestpointer);
- g_assert(xtestkeyboard);
- g_assert(IsXTestDevice(xtestpointer, NULL));
- g_assert(IsXTestDevice(xtestkeyboard, NULL));
- g_assert(IsXTestDevice(xtestpointer, inputInfo.pointer));
- g_assert(IsXTestDevice(xtestkeyboard, inputInfo.keyboard));
- g_assert(GetXTestDevice(inputInfo.pointer) == xtestpointer);
- g_assert(GetXTestDevice(inputInfo.keyboard) == xtestkeyboard);
+ assert(xtestpointer);
+ assert(xtestkeyboard);
+ assert(IsXTestDevice(xtestpointer, NULL));
+ assert(IsXTestDevice(xtestkeyboard, NULL));
+ assert(IsXTestDevice(xtestpointer, inputInfo.pointer));
+ assert(IsXTestDevice(xtestkeyboard, inputInfo.keyboard));
+ assert(GetXTestDevice(inputInfo.pointer) == xtestpointer);
+ assert(GetXTestDevice(inputInfo.keyboard) == xtestkeyboard);
}
/**
@@ -87,32 +85,29 @@ static void xtest_properties(void)
Atom xtest_prop = XIGetKnownProperty(XI_PROP_XTEST_DEVICE);
rc = XIGetDeviceProperty(xtestpointer, xtest_prop, &prop);
- g_assert(rc == Success);
- g_assert(prop);
+ assert(rc == Success);
+ assert(prop);
rc = XIGetDeviceProperty(xtestkeyboard, xtest_prop, &prop);
- g_assert(rc == Success);
- g_assert(prop != NULL);
+ assert(rc == Success);
+ assert(prop != NULL);
rc = XIChangeDeviceProperty(xtestpointer, xtest_prop,
XA_INTEGER, 8, PropModeReplace, 1, &value, FALSE);
- g_assert(rc == BadAccess);
+ assert(rc == BadAccess);
rc = XIChangeDeviceProperty(xtestkeyboard, xtest_prop,
XA_INTEGER, 8, PropModeReplace, 1, &value, FALSE);
- g_assert(rc == BadAccess);
+ assert(rc == BadAccess);
}
int main(int argc, char** argv)
{
- g_test_init(&argc, &argv,NULL);
- g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
-
- g_test_add_func("/dix/xtest/init", xtest_init_devices);
- g_test_add_func("/dix/xtest/properties", xtest_properties);
+ xtest_init_devices();
+ xtest_properties();
- return g_test_run();
+ return 0;
}