diff options
author | Felix H. Dahlke <fhd@ubercode.de> | 2013-07-17 10:01:13 +0200 |
---|---|---|
committer | Felix H. Dahlke <fhd@ubercode.de> | 2013-07-17 10:01:13 +0200 |
commit | da350fac54cccf6f511aa4cbb4f8bedae6b606df (patch) | |
tree | 2427ab6b117a2e279b7f4a6df2bf0fa77e9680c5 /tests/sdl_surface_refcount.c | |
parent | f7a5c31270c96cf8fd28a0725460b33faa6b5db4 (diff) |
Fix SDL_surface refcount test and initialise refcount to 1
Diffstat (limited to 'tests/sdl_surface_refcount.c')
-rw-r--r-- | tests/sdl_surface_refcount.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/sdl_surface_refcount.c b/tests/sdl_surface_refcount.c index 4e9b4896..c4314ebf 100644 --- a/tests/sdl_surface_refcount.c +++ b/tests/sdl_surface_refcount.c @@ -1,14 +1,15 @@ #include <SDL.h> +#include <stdio.h> int main(int argc, char *argv[]) { - SDL_Init(SDL_INIT_VIDEO); - SDL_Surface *screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE); - SDL_Surface *reference = screen; + SDL_Surface* surface = SDL_CreateRGBSurface(SDL_SWSURFACE, 10, 10, 32, + 0, 0, 0, 0); + SDL_Surface *reference = surface; reference->refcount++; - SDL_FreeSurface(screen); + SDL_FreeSurface(surface); SDL_FreeSurface(reference); - int result = 1; + int result = surface->refcount; REPORT_RESULT(); return 0; } |