Commit Graph

33 Commits

Author SHA1 Message Date
Søren Sandmann Pedersen
3ae717f71a test: Move do_composite() function from composite.c to utils.c
So that it can be used in other tests.
2013-02-13 02:18:01 -05:00
Søren Sandmann Pedersen
b527a0e615 test: Use operator_name() and format_name() in composite.c
With the operator_name() and format_name() functions there is no
longer any reason for composite.c to have its own table of format and
operator names.
2013-01-23 12:24:31 -05:00
Siarhei Siamashka
309e66f047 test: Search/replace 'lcg_*' -> 'prng_*'
The 'lcg' prefix is going to be misleading if we replace
PRNG algorithm.
2012-12-06 17:20:31 +02:00
Antti S. Lankila
72ba0b9555 Add tests to validate new sRGB behavior
Composite checks random combinations of operations that now also have
sRGB sources, masks and destinations, and stress-test validates the
read/write primitives.
2012-07-30 15:44:38 -04:00
Antti S. Lankila
1dcca0f7ae Remove unnecessary dst initialization
The initialization work is already performed correctly in image_init().
2012-07-29 11:01:11 -04:00
Siarhei Siamashka
40a0d10eea test: OpenMP 2.5 requires signed loop iteration variables
Unsigned loop variables are only supported since version 3.0
of OpenMP specification. Changing loop variables to use int32_t
type fixes pixman build problems with path64 compiler.
2012-06-12 04:21:07 +03:00
Søren Sandmann Pedersen
1e59e18d73 test: Composite with solid images instead of using pixman_image_fill_*
There is a couple of places where the test suite uses the
pixman_image_fill_* functions to initialize images. These functions
can fail, and will do so if the "fast" implementation is disabled.

So to make sure the test suite passes even using
PIXMAN_DISABLE="fast", use pixman_image_composite32() with a solid
image instead of pixman_image_fill_*.
2012-05-24 15:30:41 -04:00
Søren Sandmann Pedersen
86ce180882 test: Port composite test over to use new pixel_checker_t object.
Also make some tweaks to the way the errors are printed.
2012-01-10 09:04:45 -05:00
Søren Sandmann Pedersen
0053a9f869 Rename color_correct() to round_color()
And do the rounding from float to int in the same way cairo does: by
multiplying with (1 << width), then subtracting one when the input was 1.0.
2012-01-10 09:04:45 -05:00
Søren Sandmann Pedersen
55a010bf31 Move the color_correct() function from composite.c to utils.c 2012-01-10 09:04:45 -05: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
479d094485 test: Do not include config.h unless HAVE_CONFIG_H is defined
The win32 build system does not generate config.h and correctly runs
the compiler without defining HAVE_CONFIG_H. Nevertheless some files
include config.h without checking for its availability, breaking the
build from a clean directory:

test\utils.h(2) : fatal error C1083: Cannot open include file:
'config.h': No such file or directory
...
2011-09-14 07:03:35 -07:00
Andrea Canciani
0f6a4d4588 test: Fix compilation on win32
MSVC complains about uint32_t being used as an expression:

composite.c(902) : error C2275: 'uint32_t' : illegal use of this type
as an expression
2011-05-17 00:29:55 +02:00
Søren Sandmann Pedersen
ad3cbfb073 test: Fix infinite loop in composite
When run in PIXMAN_RANDOMIZE_TESTS mode, this test would go into an
infinite loop because the loop started at 'seed' but the stop
condition was still N_TESTS.
2011-03-22 13:43:29 -04:00
Alexandros Frantzis
b514e63cfc Add support for the r8g8b8a8 and r8g8b8x8 formats to the tests. 2011-03-22 13:43:29 -04:00
Søren Sandmann Pedersen
7eb0abb5e8 test: Randomize some tests if PIXMAN_RANDOMIZE_TESTS is set
This patch makes so that composite and stress-test will start from a
random seed if the PIXMAN_RANDOMIZE_TESTS environment variable is
set. Running the test suite in this mode is useful to get more test
coverage.

Also, in stress-test.c make it so that setting the initial seed causes
threads to be turned off. This makes it much easier to see when
something fails.
2011-03-19 08:51:35 -04:00
Andrea Canciani
9ebde285fa test: Silence MSVC warnings
MSVC does not notice non-returning functions (abort() / assert(0))
and warns about paths which end with them in non-void functions:

c:\cygwin\home\ranma42\code\fdo\pixman\test\fetch-test.c(114) :
warning C4715: 'reader' : not all control paths return a value
c:\cygwin\home\ranma42\code\fdo\pixman\test\stress-test.c(133) :
warning C4715: 'real_reader' : not all control paths return a value
c:\cygwin\home\ranma42\code\fdo\pixman\test\composite.c(431) :
warning C4715: 'calc_op' : not all control paths return a value

These warnings can be silenced by adding a return after the
termination call.
2011-02-28 10:38:02 +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
a2afcc9ba4 test: Make composite test use some existing macros instead of defining its own
Also move the ARRAY_LENGTH macro into utils.h so it can be used elsewhere.
2010-12-17 16:57:18 -05:00
Søren Sandmann Pedersen
233b27257b test: Add some more colors to the color table in composite.c
Specifically, add transparent black and superluminescent white with
alpha = 0.
2010-10-11 12:06:20 -04:00
Søren Sandmann Pedersen
3f7da59352 test: Parallize composite.c with OpenMP
Each test uses the test number as the random number seed; if it
didn't, all the threads would run the same tests since they would all
start from the same seed.
2010-10-11 12:06:20 -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
Søren Sandmann Pedersen
55e4065cbb test: Fix eval_diff() so that it provides useful error values.
Previously, this function would evaluate the error under the
assumption that the format was 565 or wider. This patch changes it to
take the actual format into account.

With that fixed, we can turn on testing for the rest of the formats.

Cc: chris@chris-wilson.co.uk
2010-10-11 12:06:20 -04:00
Søren Sandmann Pedersen
fe411cf2ac test: Fix bug in color_correct() in composite.c
This function was using the number of bits in a channel as if it were
a mask, which lead to many spurious errors. With that fixed, we can
turn on testing for all formats where all channels have 5 or more
bits.

Cc: chris@chris-wilson.co.uk
2010-10-11 12:06:20 -04:00
Søren Sandmann Pedersen
e29d9dfcb5 Silence some warnings about uninitialized variables
Neither were real problems, but GCC was complaining about them.
2010-09-08 19:16:21 -04:00
Søren Sandmann Pedersen
b8898d77d0 Define PIXMAN_USE_INTERNAL_API in pixman-private.h
Instead of mucking around with CFLAGS in configure.ac, preventing
users from setting their own CFLAGS, just define the
PIXMAN_USE_INTERNAL_API and PIXMAN_DISABLE_DEPRECATED in
pixman-private.h
2009-11-07 14:47:22 -05:00
Benjamin Otte
fa49ef81f7 Add default cases for all switch statements
Fixes compilation with -Wswitch-default. Compilation with -Wswitch-enums
works fine as is.
2009-10-20 00:40:40 +02:00
Andrea Canciani
f135f74ff3 Fix composite on big-endian systems.
Data narrower than 32bpp is padded to an unsigned long and on
big-endian systems this shifts the value by the padding bits.
2009-09-27 09:35:02 -04:00
Søren Sandmann Pedersen
02d7099888 Add missing break in composite.c 2009-09-25 07:53:32 -04:00
Søren Sandmann Pedersen
59e877cffe In the compositing test, Don't try to use component alpha with solid fills.
It's not supported yet.
2009-09-24 08:10:00 -04:00
Søren Sandmann Pedersen
1b5269a585 Reformat test/composite.c to follow the standard coding style. 2009-09-14 07:32:54 -04:00
Chris Wilson
0431a0af6c [test] Exercise repeating patterns for composite. 2009-09-13 18:02:10 +01: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