Commit Graph

6 Commits

Author SHA1 Message Date
f wasil
a987256be8 Fixed memory leak in tests 2024-11-05 03:39:54 +00:00
Søren Sandmann Pedersen
2f876cf867 test/trap-crasher.c: Add trapezoid that demonstrates a crash
This trapezoid causes a crash due to an underflow in the
pixman_trapezoid_valid().

Test case from Ritesh Khadgaray.
2013-11-01 20:24:27 -04:00
Andrea Canciani
97b9fa090c Use the ARRAY_LENGTH() macro when possible
This patch has been generated by the following Coccinelle semantic patch:

// Use the ARRAY_LENGTH() macro when possible
//
// Replace open-coded array length computations with the
// ARRAY_LENGTH() macro

@@
type T;
T[] E;
@@
- (sizeof(E)/sizeof(T))
+ ARRAY_LENGTH (E)
2011-11-09 09:17:00 +01:00
Andrea Canciani
06760f5cb0 test: Cleanup includes
All the tests are linked to libutil, hence it makes sence to always
include utils.h and reuse what it provides (config.h inclusion, access
to private pixman APIs, ARRAY_LENGTH, ...).
2011-11-09 09:17:00 +01:00
Andrea Canciani
11305b4ecd test: Fix tests for compilation on Windows
The Microsoft C compiler cannot handle subobject initialization and
Win32 does not provide snprintf.

Work around these limitations by using normal struct initialization
and using sprintf (a manual check shows that the buffer size is
sufficient).
2011-02-28 10:38:02 +01:00
Søren Sandmann Pedersen
880afeecc0 Add trap-crasher.c test program
Based off of Pavel Kankovsky's test case in bug 16560.
2009-04-24 21:39:33 -04:00