~raharper/qa-regression-testing/scripts-test-qemu-fixups

« back to all changes in this revision

Viewing changes to scripts/sdl-image1.2/sdl-image-load.c

  • Committer: Kees Cook
  • Date: 2008-03-25 21:56:23 UTC
  • Revision ID: kees.cook@canonical.com-20080325215623-kmm0lvsq014ngv3r
sdl-image1.2 tests, with "well formed" images

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2008 Canonical Ltd
 
3
 * Author: Kees Cook <kees@canonical.com>
 
4
 * License: GPLv3
 
5
 *
 
6
 * gcc -o sdl-image-load -lSDL_image sdl-image-load.c
 
7
 *
 
8
 */
 
9
#include <stdio.h>
 
10
#include <stdlib.h>
 
11
#include <unistd.h>
 
12
#include <stdint.h>
 
13
#include <string.h>
 
14
#include <stdint.h>
 
15
#include <inttypes.h>
 
16
#include <SDL/SDL_image.h>
 
17
 
 
18
int main(int argc, char * argv[])
 
19
{
 
20
    if (argc<2) {
 
21
        fprintf(stderr,"Usage: %s IMAGE\n",argv[0]);
 
22
        return 1;
 
23
    }
 
24
    SDL_Surface *surface = IMG_Load_RW(SDL_RWFromFile(argv[1], "rb"), 1);
 
25
    if (!surface) {
 
26
        fprintf(stderr,"Failed to load image: %s\n", IMG_GetError());
 
27
        return 1;
 
28
    }
 
29
 
 
30
    return 0;
 
31
}