Made the source tree a little nicer, added some info for Fedora users.
[umd.git] / tests / warp.c
blob9dd0522634012dbfd664d3fedc8bd9a742a8847e
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_Warp(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) {
35 fprintf(stderr, "Got\t%d\t%d\n", x, y);
36 fprintf(stderr, "Expected\t100\t100\n");
37 fprintf(stderr, "Test failed\n");
38 return 5;
41 printf("Test successful!\n");
43 return 0;