diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-03-10 14:23:44 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-03-18 19:06:40 -0700 |
commit | 4bf003a824577b5a46a59b3b3e91687b530ee48f (patch) | |
tree | a5b2fbba15a63612c8f8ca487ea5a37f6063b033 /test/Makefile.am | |
parent | 42c611d9f8c80528f6e36ceb0ce245b06e8b1e8e (diff) |
Add test framework similar to xserver and use it to test XtAsprintf
Only two simple test cases to start with:
- compares the results of snprintf of a short string to a static buffer
with the new buffer returned by XtAsprintf.
- compare the results of using XtAsprintf to replicate a portion of a
very long string with the original string.
Uses malloc debugging flags for various platforms to try to catch errors
with uninitialized memory (such as the recently fixed failure to terminate
the string).
Requires xorg-macros 1.13 for XORG_ENABLE_UNIT_TESTS and XORG_WITH_GLIB.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Diffstat (limited to 'test/Makefile.am')
-rw-r--r-- | test/Makefile.am | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..8c0a4c3 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,14 @@ +if ENABLE_UNIT_TESTS +if HAVE_GLIB +check_PROGRAMS = Alloc + +TESTS=$(check_PROGRAMS) + +AM_CFLAGS = $(CWARNFLAGS) $(XT_CFLAGS) $(GLIB_CFLAGS) +INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include +LDADD= $(top_builddir)/src/libXt.la $(GLIB_LIBS) + +TESTS_ENVIRONMENT = $(MALLOC_DEBUG_ENV) + +endif HAVE_GLIB +endif ENABLE_UNIT_TESTS |