summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-03-07Add XtReallocArray() for overflow checking of multiplied argsAlan Coopersmith
Uses reallocarray() if available, otherwise checks for overflow itself, if overflow is possible (i.e. in ILP32 & ILP64 environments, but not LP64 with 32-bit ints). Includes unit tests and XtMallocArray() helper macro. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-07test: Add unit tests for XtMalloc, XtCalloc, & XtReallocAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-17tests: Replace g_assert() calls with g_assert_*() callsAlan Coopersmith
https://docs.gtk.org/glib/testing.html warns against using g_assert() in test cases, since it is a no-op when compiling with G_DISABLE_ASSERT. The replacement calls also give more detailed messages on failures. Raises the minimum required glib version for building unit tests from 2.16 (released March 2008) to 2.40 (released March 2014) to get support for g_assert_nonnull(). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-17tests: update g_test_bug_base url from bugzilla to gitlabAlan Coopersmith
Also adds a call to g_test_bug() for the one existing testcase associated with a bug in a public bug tracker. Otherwise this is mostly a placeholder for now, as no other tests call g_test_bug() yet to report what bugs they test for. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-12Use AM_CPPFLAGS instead of INCLUDESThierry Reding
Recent versions of automake deprecate the INCLUDES variable. The same effect can be achieved by using AM_CPPFLAGS instead, which is also automake's recommendation. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-03Strip trailing whitespaceAlan Coopersmith
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-18Add test case for XtCvtIntToPixmap fix in commit 16d9941f3aa38Alan Coopersmith
Expanded from original Sun test case for Solaris bug 4163152. Verified that with commit 16d9941f3aa38 reverted, this test case fails on amd64, with it present, this test case passes. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-03-18Add test case for XtAppMainLoop bug 34715Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-03-18Add test framework similar to xserver and use it to test XtAsprintfAlan Coopersmith
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>