aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py2
-rw-r--r--tests/sdl_surface_refcount.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 6daa9c36..b2dff6f4 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -13173,7 +13173,7 @@ Press any key to continue.'''
self.btest('sdl_alloctext.c', expected='1', args=['-O2', '-s', 'TOTAL_MEMORY=' + str(1024*1024*8)])
def test_sdl_surface_refcount(self):
- self.btest('sdl_surface_refcount.c', expected='1')
+ self.btest('sdl_surface_refcount.c', expected='0')
def test_glbegin_points(self):
shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png'))
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;
}