[PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Alan Coopersmith
Simple test case just compares the results of snprintf to a static buffer with the new buffer returned by XtAsprintf. Test run currently fails due to correctly detecting the bug in null terminating the XtAsprintf returned string. Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com ---

Re: [PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Cyril Brulebois
Alan Coopersmith alan.coopersm...@oracle.com (08/03/2011): Simple test case just compares the results of snprintf to a static buffer with the new buffer returned by XtAsprintf. Good idea. I think you should also have another test, with a bigger string to hit the second code path (the vsnprintf

Re: [PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Gaetan Nadon
On Tue, 2011-03-08 at 13:07 -0800, Alan Coopersmith wrote: Simple test case just compares the results of snprintf to a static buffer with the new buffer returned by XtAsprintf. Test run currently fails due to correctly detecting the bug in null terminating the XtAsprintf returned string.

Re: [PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Cyril Brulebois
Gaetan Nadon mems...@videotron.ca (08/03/2011): Tests are only executed when running make check, is the --enable-unit-tests really needed? I could understand why people wouldn't want glib to be pulled in unconditionally when building libxt. As a package maintainer, I'm happy to declare through

Re: [PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Alan Coopersmith
On 03/ 8/11 03:23 PM, Gaetan Nadon wrote: +int snlen, aslen; Whitespace error Will fix. Would it be the time to provide some common support for unit testing? We will soon end-up in a situation where every package does it differently, making it difficult to add test cases in multiple

Re: [PATCH:libXt] Add test framework similar to xserver and use it to test XtAsprintf

2011-03-08 Thread Gaetan Nadon
On Wed, 2011-03-09 at 00:39 +0100, Cyril Brulebois wrote: I could understand why people wouldn't want glib to be pulled in unconditionally when building libxt. As a package maintainer, I'm happy to declare through a configure option that I want to enable unit tests, and make configure fail if