Commit Graph

52 Commits

Author SHA1 Message Date
Siarhei Siamashka
0df43b8ae5 test: check correctness of 'bilinear_pad_repeat_get_scanline_bounds'
Individual correctness check for the new bilinear scaling related
supplementary function. This test program uses a bit wider range
of input arguments, not covered by other tests.
2011-02-28 15:29:23 +02:00
Søren Sandmann Pedersen
4e6dd4928d Add a test program for pixman_composite_trapezoids().
A CRC32 based test program to check that pixman_composite_trapezoids()
actually works.
2011-02-15 09:25:18 -05:00
Søren Sandmann Pedersen
1feaf6bea7 test/Makefile.am: Move all the TEST_LDADD into a new global LDADD.
This gets rid of a bunch of replicated *_LDADD clauses
2011-02-15 09:25:17 -05:00
Søren Sandmann Pedersen
1237fd9bc8 Add @TESTPROGS_EXTRA_LDFLAGS@ to AM_LDFLAGS
Instead of explicitly adding it to each test program.
2011-02-15 09:25:17 -05:00
Søren Sandmann Pedersen
7dfe845786 Move all the GTK+ based test programs to a new subdir, "demos"
This separates the test suite from the random gtk+ using test
programs. "demos" is somewhat misleading because the programs there
are not particularly exciting (with the possible exception of
composite-test which shows off all the compositing operators).
2011-02-15 09:25:17 -05:00
Andrea Canciani
2ac4ae1ae2 Add a test for radial gradients
radial-test is a port of the radial-gradient test from the cairo test
suite. It has been modified so that some pixels have 0 in both the a
and b coefficients of the quadratic equation solved by the rasterizer,
to expose a division by zero in the original implementation.
2011-01-19 13:17:03 +01:00
Siarhei Siamashka
2bbd553bd2 A new configure option --enable-static-testprogs
This option can be used for building fully static binaries of the test
programs so that they can be easily run using qemu-user. With binfmt-misc
configured, 'make check' works fine for crosscompiled pixman builds.
2011-01-16 23:40:34 +02:00
Søren Sandmann Pedersen
3479050216 Add a test compositing with the various PDF operators.
The test has floating point exceptions enabled, and currently fails
with a divide-by-zero.
2010-12-20 19:37:11 -05:00
Cyril Brulebois
45a2d01077 Fix linking issues when HAVE_FEENABLEEXCEPT is set.
All objects using test/util.c fail to link:
|   CCLD   region-test
| /usr/bin/ld: utils.o: in function enable_fp_exceptions:utils.c(.text+0x939): error: undefined reference to 'feenableexcept'

There's indeed no explicit dependency on -lm, and if HAVE_FEENABLEEXCEPT
happens to be set, test/util.c uses feenableexcept(), which is nowhere
to be found while linking.

Fix this by adding -lm to TEST_LDADD, although two alternatives could be
thought of:
 - Only specifying -lm for objects using util.c.
 - Introducing a conditional to add -lm only when configure detects
   have_feenableexcept=yes.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2010-12-20 09:55:07 -05:00
Søren Sandmann Pedersen
f914cf4486 Add a stress-test program.
This test program tries to use as many rarely-used features as
possible, including alpha maps, accessor functions, oddly-sized
images, strange transformations, conical gradients, etc.

The hope is to provoke crashes or irregular behavior in pixman.
2010-12-17 17:03:29 -05:00
Søren Sandmann Pedersen
2444b2265a Extend gradient-crash-test
Test the gradients with various transformations, and test cases where
the gradients are specified with two identical points.
2010-12-17 16:57:38 -05:00
Søren Sandmann Pedersen
9c19a85b00 Remove workaround for a bug in the 1.6 X server.
There used to be a bug in the X server where it would rely on
out-of-bounds accesses when it was asked to composite with a
window as the source. It would create a pixman image pointing
to some bogus position in memory, but then set a clip region
to the position where the actual bits were.

Due to a bug in old versions of pixman, where it would not clip
against the image bounds when a clip region was set, this would
actually work. So when the pixman bug was fixed, a workaround was
added to allow certain out-of-bound accesses.

However, the 1.6 X server is so old now that we can remove this
workaround. This does mean that if you update pixman to 0.22 or later,
you will need to use a 1.7 X server or later.
2010-11-04 21:03:38 -04:00
Søren Sandmann Pedersen
a10ccc9f30 test: Change composite so that it tests randomly generated images
Previously this test would try to exhaustively test all combinations
of formats and operators, which meant that it would take hours to run.
Instead, generate images randomly and test compositing those.

Cc: chris@chris-wilson.co.uk
2010-10-11 12:06:20 -04:00
Jonathan Morton
7cd4f2fa20 Add a lowlevel blitter benchmark
This test is a modified version of Siarhei's compositor throughput
benchmark.  It's expanded with explicit reporting of memory bandwidth
consumption for the M-test, and with an additional 8x8-random test
intended to determine peak ops/sec capability.  There are also quite a
lot more operations tested for.
2010-09-21 08:50:18 -04:00
Søren Sandmann Pedersen
6d1e10a8b5 test: Add affine-test
This test tests compositing with various affine transformations. It is
almost identical to scaling-test, except that it also applies a random
rotation in addition to the random scaling and translation.
2010-09-21 08:31:09 -04:00
Søren Sandmann Pedersen
ae77548f0d Update and extend the alphamap test
- Test many more combinations of formats

- Test destination alpha maps

- Test various different alpha origins

Also add a transformation to the destination, but comment it out
because it is actually broken at the moment (and pretty difficult to
fix).
2010-09-21 08:28:55 -04:00
Benjamin Otte
4d8fb1bc01 region: Add a new test region-translate
This test exercises a bug in pixman_region32_translate(). The function
clips the region to int16 coordinates SHRT_MIN/SHRT_MAX.
2010-08-24 12:17:18 +02:00
Søren Sandmann Pedersen
9fe7d32c4b Add alpha-loop test program
This tests what happens if you attempt to make an image with an alpha
map that has the image as its alpha map. This results in an infinite
loop in _pixman_image_validate(), so the test sets up a SIGALRM to
exit if it runs for more than five seconds.
2010-08-15 21:57:18 -04:00
Siarhei Siamashka
af3eeaeb13 test: 'scaling-crash-test' added
This test tries to exploit some corner cases and previously known
bugs in nearest neighbor scaling fast path code, attempting to
crash pixman or cause some other nasty effect.
2010-07-27 16:07:07 +03:00
Andrea Canciani
445eb6385f test: verify that gradients do not crash pixman
Test gradients under particular conditions (no stops, all the stops
at the same offset) to check that pixman does not misbehave.
2010-06-09 17:30:41 +02:00
Siarhei Siamashka
cfc4e38852 test: added OpenMP support for better utilization of multiple CPU cores
Some of the tests are quite heavy CPU users and may benefit from
using multiple CPU cores, so the programs from 'test' directory
are now built with OpenMP support. OpenMP is easy to use, portable
and also takes care of making a decision about how many threads
to spawn.
2010-05-13 21:04:55 +03:00
Søren Sandmann Pedersen
526132fa65 Remove alphamap from the GTK+ part of tests/Makefile.am
It doesn't use GTK+ and it was already listed in the non-GTK+ part.
2010-04-22 12:14:23 -04:00
Søren Sandmann Pedersen
16ef3ab230 Add a1-trap-test
When a trapezoid sample point is exactly on a polygon edge, the rule
is that it is considered inside the trapezoid if the edge is a top or
left edge, but outside for bottom and right edges.

This program tests that for a1 trapezoids.
2010-02-24 21:01:24 -05:00
Alexander Larsson
f32d585069 Test pixman_region32_init_from_image in region-test 2010-02-19 11:25:41 +01:00
Søren Sandmann Pedersen
042f978b04 test: Add new alphamap test program.
This program demonstrates three bugs relating to alpha maps:

- When fetching from an alpha map into 32 bit intermediates, we use
  the fetcher from the image, and not the one from the alpha map.

- For 64 bit intermediates we call fetch_pixel_generic_lossy_32()
  which then calls fetch_pixel_raw_64, which is NULL because alpha
  images are never validated.

- The alpha map should be used *in place* of any existing alpha
  channel, but we are actually multiplying it onto the image.
2010-01-17 16:47:15 -05:00
Søren Sandmann Pedersen
b3afacf9c9 Reorder tests so that they fastest ones run first. 2009-12-16 15:27:50 -05:00
Marvin Schmidt
bbc5108bf8 Build tests and run non-GTK+ ones on make check
Setting TESTS will run the tests on `make check`

Bug 25131
2009-12-16 15:24:36 -05:00
Søren Sandmann Pedersen
cc34554652 test: In scaling-test use the crc32 from utils.c 2009-11-17 00:32:03 -05:00
Søren Sandmann Pedersen
b465b8b79d test: Move CRC32 code from blitters-test to new files utils.[ch] 2009-11-17 00:32:03 -05:00
Søren Sandmann Pedersen
56bd913401 test: Rename utils.[ch] to gtk-utils.[ch] 2009-11-17 00:32:03 -05:00
Chris Wilson
8f2daa7ca2 [test] Add composite test from rendercheck
Iterate over all destination formats for dst, src and composite and
compare the result of all oprators with a selection of colours.
2009-09-13 16:33:01 +01:00
Siarhei Siamashka
67769ad5bf Test program for stressing the use of different formats and operators
The code and overall method is mostly based on scaling-test. This one
focuses on trying to stress as many different color formats and types
of composition operations as possible.

This is an initial implementation which may need more tuning. Also
not all color format and operator combinations are actually used.

When cpu specific optimizations are disabled, this test provides
identical deterministic results on x86, PPC and ARM.

Script blitters-test-bisect.rb now works in non-stop mode, until
it finds any problem. This allows to run it for example overnight
in order to test a lot more variants of pixman calls and increase
chances of detecting problems in pixman. Just like with scaling-test,
running blitters-test binary alone with no command line arguments
runs a small predefined number of tests and compares checksum
with a reference value for quick verification.
2009-08-08 18:50:41 -04:00
Søren Sandmann Pedersen
dfdb8509e2 Add test case for bug 22844. 2009-07-21 01:27:46 -04:00
Søren Sandmann Pedersen
bcf01c21d7 Fix a couple of problems with the tests when HAVE_GTK is not defined.
- Make sure the non-gtk+ test programs are added to noinst_PROGRAMS
  when HAVE_GTK is not set.

- Don't include glib.h in oob-test.c
2009-07-09 01:47:19 -04:00
Søren Sandmann Pedersen
bed9c378ff Add test case for out-of-bounds memory access. 2009-06-24 10:37:07 -04:00
Søren Sandmann Pedersen
905856f43d Add convolution-test.c program 2009-06-23 16:37:35 -04:00
Søren Sandmann Pedersen
e3a94e8928 Add screen-test.c test program 2009-06-23 14:42:37 -04:00
Søren Sandmann Pedersen
85b390cadf Fix alpha map computation in pixman_compute_composite_region()
According to the RENDER spec, the origin of the alpha map is
interpreted relative to the origin of the drawable of the image, not
the origin of the drawable of the alpha map.

This commit fixes that and adds an alpha-test.c test program.

The only use of alpha maps I have been able to find is in Qt and they
don't use a non-zero alpha origin.
2009-05-21 18:25:57 -04:00
Søren Sandmann Pedersen
81b94d7258 Add test that shows difference in clipping with transformed vs untransformed 2009-05-13 13:09:45 -04:00
Søren Sandmann Pedersen
f98c800fba Mention utils.h in test/Makefile.am so that make dist will pick it up
Pointed out by Julien Cristau.
2009-05-04 18:54:27 -04:00
Søren Sandmann Pedersen
e047f605e2 Move all the GTK+ test code into its own file, utils.c 2009-05-04 18:34:54 -04: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
Søren Sandmann Pedersen
fb8e9b16d5 Add a new trap-test test program.
Also some tweaks to the build system in the test directory to make it
build non-gtk+-using application when use of gtk+ is disabled.
2009-04-04 06:03:20 -04:00
Siarhei Siamashka
a9adae3dc3 Image scaling regression test script
This test script can help in finding regressions in image scaling
fastpath implementations. It uses test program compiled with
and without fastpath code and can compare results of execution
for different pseudorandom compositing operations involving scaling.

Signed-off-by: Søren Sandmann Pedersen <sandmann@redhat.com>
2009-03-31 21:30:03 -04:00
Søren Sandmann Pedersen
00f3d6ef22 Fix bug in pixman_image_is_opaque()
Non-repeating gradient images would be reported as opaque. Also add
new test program to test source clipping.
2008-09-06 23:49:25 -04:00
Søren Sandmann
85bad33380 Add infinite loop test 2008-06-09 00:51:28 -04:00
Aaron Plattner
0c3547bad4 Fix test build when srcdir != builddir.
The tests were including pixman.h, but pixman.h couldn't find pixman-version.h
because it was in $(top_builddir)/pixman rather than $(top_srcdir)/pixman.
2008-03-28 12:16:07 -07:00
José Fonseca
469dd84cf8 New test for image fetching. 2007-09-07 10:47:15 +01:00
Søren Sandmann Pedersen
7b3c9cef49 Change the library name to pixman-1
Set the soname to something based on the library version.
2007-08-06 17:24:44 -04:00
Soren Sandmann Pedersen
ffbb4a6b1f Don't build GTK+ test programs if GTK+ is not available 2007-05-15 11:08:24 -04:00