test: check from INT_MIN to INT_MAX for core type conversion

ErrorF is link-wrapped to reduce the run-time of the test.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2009-06-04 11:40:14 +10:00
parent d8471bc7a1
commit d979f44394
2 changed files with 31 additions and 26 deletions

View File

@ -10,6 +10,7 @@ TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLIB_LIBS)
xkb_LDADD=$(TEST_LDADD) xkb_LDADD=$(TEST_LDADD)
input_LDADD=$(TEST_LDADD) input_LDADD=$(TEST_LDADD)
input_CFLAGS=$(AM_CFLAGS) -Wl,-wrap,ErrorF
libxservertest_la_LIBADD = \ libxservertest_la_LIBADD = \
$(XSERVER_LIBS) \ $(XSERVER_LIBS) \

View File

@ -40,6 +40,10 @@
#include <glib.h> #include <glib.h>
void __wrap_ErrorF(const char *f, ...)
{
}
/** /**
* Init a device with axes. * Init a device with axes.
* Verify values set on the device. * Verify values set on the device.
@ -254,36 +258,36 @@ static void dix_event_to_core_conversion(void)
{ {
DeviceEvent ev; DeviceEvent ev;
xEvent core; xEvent core;
int rc; int rc, i;
ev.header = 0xFF; ev.header = 0xFF;
ev.length = sizeof(DeviceEvent); ev.length = sizeof(DeviceEvent);
ev.type = 0; for (i = INT_MIN; i < INT_MAX; i++)
rc = EventToCore((InternalEvent*)&ev, &core); {
g_assert(rc == BadImplementation); switch(i)
{
ev.type = 1; case ET_KeyPress:
rc = EventToCore((InternalEvent*)&ev, &core); case ET_KeyRelease:
g_assert(rc == BadImplementation); case ET_ButtonPress:
case ET_ButtonRelease:
ev.type = ET_ProximityOut + 1; case ET_Motion:
rc = EventToCore((InternalEvent*)&ev, &core); dix_event_to_core(i);
g_assert(rc == BadImplementation); break;
case ET_Raw:
ev.type = ET_ProximityIn; case ET_ProximityIn:
case ET_ProximityOut:
ev.type = i;
rc = EventToCore((InternalEvent*)&ev, &core); rc = EventToCore((InternalEvent*)&ev, &core);
g_assert(rc == BadMatch); g_assert(rc == BadMatch);
break;
ev.type = ET_ProximityOut; default:
ev.type = i;
rc = EventToCore((InternalEvent*)&ev, &core); rc = EventToCore((InternalEvent*)&ev, &core);
g_assert(rc == BadMatch); g_assert(rc == BadImplementation);
break;
dix_event_to_core(ET_KeyPress); }
dix_event_to_core(ET_KeyRelease); }
dix_event_to_core(ET_ButtonPress);
dix_event_to_core(ET_ButtonRelease);
dix_event_to_core(ET_Motion);
} }
static void xi2_struct_sizes(void) static void xi2_struct_sizes(void)