infinite-loop.c 999 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include <assert.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include "utils.h"
  6. int
  7. main (int argc, char **argv)
  8. {
  9. #define SRC_WIDTH 16
  10. #define SRC_HEIGHT 12
  11. #define DST_WIDTH 7
  12. #define DST_HEIGHT 2
  13. static const pixman_transform_t transform = {
  14. { { 0x200017bd, 0x00000000, 0x000e6465 },
  15. { 0x00000000, 0x000a42fd, 0x000e6465 },
  16. { 0x00000000, 0x00000000, 0x00010000 },
  17. }
  18. };
  19. pixman_image_t *src, *dest;
  20. src = pixman_image_create_bits (
  21. PIXMAN_a8r8g8b8, SRC_WIDTH, SRC_HEIGHT, NULL, -1);
  22. dest = pixman_image_create_bits (
  23. PIXMAN_a8r8g8b8, DST_WIDTH, DST_HEIGHT, NULL, -1);
  24. pixman_image_set_transform (src, &transform);
  25. pixman_image_set_repeat (src, PIXMAN_REPEAT_NORMAL);
  26. pixman_image_set_filter (src, PIXMAN_FILTER_BILINEAR, NULL, 0);
  27. if (argc == 1 || strcmp (argv[1], "-nf") != 0)
  28. fail_after (1, "infinite loop detected");
  29. pixman_image_composite (
  30. PIXMAN_OP_OVER, src, NULL, dest, -3, -3, 0, 0, 0, 0, 6, 2);
  31. return 0;
  32. }