Made the source tree a little nicer, added some info for Fedora users.
[umd.git] / tests / click.c
bloba9da19a1fd957316ca640e0dd408c9c1ba4e68a8
1 #include "umd.h"
2 #include <stdio.h>
3 #include <unistd.h>
4 #include "util.h"
6 int main(int argc, char **argv)
8 int x = 0, y = 0, button = 0;
10 int status = VideoInit();
12 if (status != 0)
13 return status;
15 if (UMD_Init() < 0) {
16 fprintf(stderr, "%s\n", UMD_GetError());
17 return 1;
20 if (UMD_SingleClickAt(UMD_RIGHT, 100, 100) < 0) {
21 fprintf(stderr, "%s\n", UMD_GetError());
22 return 3;
25 CollectInput(&x, &y, &button);
27 if (UMD_Quit() < 0) {
28 fprintf(stderr, "%s\n", UMD_GetError());
29 return 2;
32 VideoQuit();
34 if (x != 100 || y != 100 || button != 1) {
35 fprintf(stderr, "Got\t%d\t%d\t%d\n", x, y, button);
36 fprintf(stderr, "Expected\t100\t100\t1\n");
37 fprintf(stderr, "Test failed\n");
38 return 5;
41 printf("Test successful!\n");
43 return 0;