| 43 | } |
| 44 | |
| 45 | int main() { |
| 46 | SDL_Init(SDL_INIT_VIDEO); |
| 47 | SDL_Surface *screen = SDL_SetVideoMode(600, 450, 32, SDL_SWSURFACE); |
| 48 | |
| 49 | int result; |
| 50 | |
| 51 | result = testImage(screen, SCREENSHOT_DIRNAME "/" SCREENSHOT_BASENAME); // absolute path |
| 52 | assert(result == 600); |
| 53 | |
| 54 | chdir(SCREENSHOT_DIRNAME); |
| 55 | result = testImage(screen, "./" SCREENSHOT_BASENAME); // relative path |
| 56 | assert(result == 600); |
| 57 | |
| 58 | SDL_Flip(screen); |
| 59 | |
| 60 | printf("you should see an image.\n"); |
| 61 | |
| 62 | SDL_Quit(); |
| 63 | return 0; |
| 64 | } |
| 65 |