diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 3 | ||||
-rw-r--r-- | tests/sdl_surface_refcount.c | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 0efcce86..6daa9c36 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -13172,6 +13172,9 @@ Press any key to continue.''' def test_sdl_alloctext(self): 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') + def test_glbegin_points(self): shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png')) self.btest('glbegin_points.c', reference='glbegin_points.png', args=['--preload-file', 'screenshot.png']) diff --git a/tests/sdl_surface_refcount.c b/tests/sdl_surface_refcount.c new file mode 100644 index 00000000..4e9b4896 --- /dev/null +++ b/tests/sdl_surface_refcount.c @@ -0,0 +1,14 @@ +#include <SDL.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; + reference->refcount++; + SDL_FreeSurface(screen); + SDL_FreeSurface(reference); + int result = 1; + REPORT_RESULT(); + return 0; +} |