diff --git a/tests/Imakefile b/tests/Imakefile index 1067a7c..7194905 100644 --- a/tests/Imakefile +++ b/tests/Imakefile @@ -25,7 +25,9 @@ ScannerTarget(12to11-test) OBJS1 = $(COMMONOBJS) simple_test.o SRCS2 = $(COMMONSRCS) damage_test.c OBJS2 = $(COMMONOBJS) damage_test.o - PROGRAMS = simple_test damage_test + SRCS3 = $(COMMONSRCS) transform_test.c + OBJS3 = $(COMMONSRCS) transform_test.o + PROGRAMS = simple_test damage_test transform_test /* Make all objects depend on HEADER. */ $(OBJS1): $(HEADER) @@ -35,6 +37,7 @@ depend:: $(HEADER) $(SRCS1) NormalProgramTarget(simple_test,$(OBJS1),NullParameter,$(LOCAL_LIBRARIES),NullParameter) NormalProgramTarget(damage_test,$(OBJS2),NullParameter,$(LOCAL_LIBRARIES),NullParameter) -DependTarget3($(SRCS1),$(SRCS2),NullParameter) +NormalProgramTarget(transform_test,$(OBJS3),NullParameter,$(LOCAL_LIBRARIES),NullParameter) +DependTarget3($(SRCS1),$(SRCS2),$(SRCS3)) all:: $(PROGRAMS) diff --git a/tests/README b/tests/README index d9d7407..3ba59b7 100644 --- a/tests/README +++ b/tests/README @@ -12,5 +12,10 @@ When tests are being run, the tester must be very careful to not interfere with the test operation by moving or resizing the test window. A compositing manager should be running along with the test. +These tests are supposed to test the functionality of the protocol +translator by connecting to a running instance and validating the +results of various high-level requests. In modern parlance, they +would be ``integration tests''. + Most likely, you do not want to run these tests manually, as the `run_tests.sh' script does all the setup for you. diff --git a/tests/damage_test.c b/tests/damage_test.c index 742c2cc..40f15a9 100644 --- a/tests/damage_test.c +++ b/tests/damage_test.c @@ -30,7 +30,7 @@ static const char *test_names[] = { "map_window", "basic_test_card_image", - "basic_damage" + "basic_damage", }; #define LAST_TEST BASIC_DAMAGE_KIND diff --git a/tests/run_tests.sh b/tests/run_tests.sh index ea6e770..b5c18d1 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -18,7 +18,7 @@ # along with 12to11. If not, see . pushd "$(dirname $0)" -declare -a standard_tests=( simple_test damage_test ) +declare -a standard_tests=( simple_test damage_test transform_test ) make -C . "${standard_tests[@]}" diff --git a/tests/svnignore.txt b/tests/svnignore.txt index 65d94fe..87e34f0 100644 --- a/tests/svnignore.txt +++ b/tests/svnignore.txt @@ -3,5 +3,6 @@ vgcore* simple_test damage_test +transform_test Makefile Makefile.bak diff --git a/tests/test_harness.c b/tests/test_harness.c index fc3319a..ad55f9d 100644 --- a/tests/test_harness.c +++ b/tests/test_harness.c @@ -586,7 +586,7 @@ load_image_data (const char *filename, struct image_data_header *header) bpp = bytes_per_pixel_for_format (header->format); - if (!bpp || header->stride < header->height * bpp) + if (!bpp || header->stride < header->width * bpp) goto error_1; buffer = malloc (header->stride * header->height); diff --git a/tests/test_harness.h b/tests/test_harness.h index 0ca48bd..98d201c 100644 --- a/tests/test_harness.h +++ b/tests/test_harness.h @@ -91,3 +91,9 @@ extern void test_init (void); extern void test_complete (void) __attribute__ ((noreturn)); #define ARRAYELTS(arr) (sizeof (arr) / sizeof (arr)[0]) + +#if __GNUC__ >= 7 +#define FALLTHROUGH __attribute__ ((fallthrough)) +#else +#define FALLTHROUGH ((void) 0) +#endif