Added video_mode_ok() and its test. Fixed test list_modes better
[sdlgit/SDL_perl.git] / t / core_video.t
1 #!/usr/bin/perl -w
2 use strict;
3 use SDL;
4 use SDL::Surface;
5 use SDL::Config;
6 use Devel::Peek;
7 use Data::Dumper;
8 use Test::More;
9
10 plan ( tests => 7 );
11
12 use_ok( 'SDL::Video' ); 
13   
14 can_ok ('SDL::Video', qw/
15         get_video_surface
16         get_video_info
17         video_driver_name
18         list_modes
19         video_mode_ok
20         /);
21
22 #testing get_video_surface
23 SDL::Init(SDL_INIT_VIDEO);                                                                          
24                                                                                                     
25 my $display = SDL::SetVideoMode(640,480,32, SDL_SWSURFACE );
26
27 #diag('Testing SDL::Video');
28
29 isa_ok(SDL::Video::get_video_surface(), 'SDL::Surface', '[get_video_surface] Checking if we get a surface ref back'); 
30
31 isa_ok(SDL::Video::get_video_info(), 'SDL::VideoInfo', '[get_video_info] Checking if we get videoinfo ref back');
32
33 my $driver_name = SDL::Video::video_driver_name();
34
35 pass '[video_driver_name] This is your driver name: '.$driver_name;
36
37
38
39 is( ref( SDL::Video::list_modes( $display->format , SDL_SWSURFACE )), 'ARRAY', '[list_modes] Returned an ARRAY! ');
40
41 cmp_ok(SDL::Video::video_mode_ok( 100, 100, 16, SDL_SWSURFACE), '>=', 0, "[video_mode_ok] Checking if an integer was return");
42
43 pass "Are we still alive?";
44
45 =skip
46         video_mode_ok
47         set_video_mode
48         update_rect
49         update_rects
50         flip
51         set_colors
52         set_palette
53         set_gamma
54         get_gamma_ramp
55         set_gmmma_ramp
56         map_RGB
57         map_RGBA
58         get_RGB
59         get_RGBA
60         create_RGB_surface_from
61         lock_surface
62         unlock_surface
63         convert_surface
64         display_format
65         display_format_alpha
66         load_BMP
67         save_BMP
68         set_color_key
69         set_alpha
70         set_clip_rect
71         get_clip_rect
72         blit_surface
73         fill_rect
74         GL_load_library
75         GL_get_proc_address
76         GL_get_attribute
77         GL_set_attribute
78         GL_swap_buffers
79         GL_attr
80         lock_YUV_overlay
81         unlock_YUV_overlay
82         display_YUV_overlay
83         /);
84