From d137057fd13e83ec15ab416c7fe774741da06047 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 10 Jul 2012 14:56:29 +0200 Subject: fontconfig mesa xserver git update 10 Jul 2012 --- xorg-server/test/Makefile.am | 12 +++++++++++- xorg-server/test/input.c | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 3 deletions(-) (limited to 'xorg-server/test') diff --git a/xorg-server/test/Makefile.am b/xorg-server/test/Makefile.am index 15c51ed22..aa018c962 100644 --- a/xorg-server/test/Makefile.am +++ b/xorg-server/test/Makefile.am @@ -18,7 +18,8 @@ if XORG INCLUDES += -I$(top_srcdir)/hw/xfree86/parser \ -I$(top_srcdir)/hw/xfree86/ddc \ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ - -I$(top_srcdir)/hw/xfree86/ramdac + -I$(top_srcdir)/hw/xfree86/ramdac -I$(top_srcdir)/hw/xfree86/dri \ + -I$(top_srcdir)/hw/xfree86/dri2 endif TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) @@ -42,6 +43,7 @@ os_LDADD=$(TEST_LDADD) libxservertest_la_LIBADD = $(XSERVER_LIBS) if XORG + nodist_libxservertest_la_SOURCES = $(top_builddir)/hw/xfree86/sdksyms.c libxservertest_la_LIBADD += \ $(top_builddir)/hw/xfree86/loader/libloader.la \ @@ -56,6 +58,14 @@ libxservertest_la_LIBADD += \ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ @XORG_LIBS@ +if DRI +libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri/libdri.la +endif + +if DRI2 +libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri2/libdri2.la +endif + else nodist_libxservertest_la_SOURCES = \ ddxstubs.c \ diff --git a/xorg-server/test/input.c b/xorg-server/test/input.c index 90ab9aea3..191c81789 100644 --- a/xorg-server/test/input.c +++ b/xorg-server/test/input.c @@ -964,6 +964,19 @@ test_pad_to_int32(int i) assert(expected_bytes == pad_to_int32(i)); } +static void +test_padding_for_int32(int i) +{ + static const int padlength[4] = { 0, 3, 2, 1 }; + int expected_bytes = (((i + 3) / 4) * 4) - i; + + assert(padding_for_int32(i) >= 0); + assert(padding_for_int32(i) <= 3); + assert(padding_for_int32(i) == expected_bytes); + assert(padding_for_int32(i) == padlength[i & 3]); + assert((padding_for_int32(i) + i) == pad_to_int32(i)); +} + static void include_byte_padding_macros(void) { @@ -996,12 +1009,12 @@ include_byte_padding_macros(void) test_bytes_to_int32(INT_MAX - 4); test_bytes_to_int32(INT_MAX - 3); - printf("Testing pad_to_int32\n"); + printf("Testing pad_to_int32()\n"); - test_pad_to_int32(0); test_pad_to_int32(0); test_pad_to_int32(1); test_pad_to_int32(2); + test_pad_to_int32(3); test_pad_to_int32(7); test_pad_to_int32(8); test_pad_to_int32(0xFF); @@ -1012,6 +1025,23 @@ include_byte_padding_macros(void) test_pad_to_int32(0x1000000); test_pad_to_int32(INT_MAX - 4); test_pad_to_int32(INT_MAX - 3); + + printf("Testing padding_for_int32()\n"); + + test_padding_for_int32(0); + test_padding_for_int32(1); + test_padding_for_int32(2); + test_padding_for_int32(3); + test_padding_for_int32(7); + test_padding_for_int32(8); + test_padding_for_int32(0xFF); + test_padding_for_int32(0x100); + test_padding_for_int32(0xFFFF); + test_padding_for_int32(0x10000); + test_padding_for_int32(0xFFFFFF); + test_padding_for_int32(0x1000000); + test_padding_for_int32(INT_MAX - 4); + test_padding_for_int32(INT_MAX - 3); } static void -- cgit v1.2.3