You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
1.1 KiB

  1. /*
  2. * all full libcaca API test
  3. * Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the Do What The Fuck You Want To
  10. * Public License, Version 2, as published by Sam Hocevar. See
  11. * http://sam.zoy.org/wtfpl/COPYING for more details.
  12. */
  13. #include "config.h"
  14. #include "common.h"
  15. #if !defined(__KERNEL__)
  16. # include <stdio.h>
  17. #endif
  18. #include "cucul.h"
  19. #include "caca.h"
  20. #define ITER 1000
  21. int main(int argc, char *argv[])
  22. {
  23. cucul_canvas_t *cv;
  24. unsigned int i, w, h;
  25. /* cucul_create_canvas */
  26. fprintf(stderr, "testing cucul_create_canvas()\n");
  27. for(i = 0; i < ITER; i++)
  28. {
  29. w = cucul_rand(1, 1000);
  30. h = cucul_rand(1, 1000);
  31. cv = cucul_create_canvas(w, h);
  32. cucul_put_char(cv, w - 1, h - 1, 'x');
  33. if(cucul_get_char(cv, w - 1, h - 1) != 'x')
  34. fprintf(stderr, " failed (%ux%u)\n", w, h);
  35. cucul_free_canvas(cv);
  36. }
  37. fprintf(stderr, "all tests passed\n");
  38. return 0;
  39. }