PageRenderTime 50ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 1ms

/t/core_events.t

http://github.com/PerlGameDev/SDL
Perl | 1031 lines | 952 code | 73 blank | 6 comment | 42 complexity | b7fb50b29d242365ac5c394f2ded7f8f MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0
  1. #!/usr/bin/perl -w
  2. use strict;
  3. use warnings;
  4. use SDL;
  5. use SDL::Event;
  6. use SDL::Events;
  7. use SDL::Surface;
  8. use SDL::Video;
  9. use Devel::Peek;
  10. use Test::More;
  11. use lib 't/lib';
  12. use SDL::TestTool;
  13. my $videodriver = $ENV{SDL_VIDEODRIVER};
  14. $ENV{SDL_VIDEODRIVER} = 'dummy' unless $ENV{SDL_RELEASE_TESTING};
  15. if ( !SDL::TestTool->init(SDL_INIT_VIDEO) ) {
  16. plan( skip_all => 'Failed to init video' );
  17. }
  18. my @done = qw/
  19. pump_events
  20. peep_events
  21. push_event
  22. poll_event
  23. wait_event
  24. set_event_filter
  25. event_state
  26. get_key_state
  27. get_key_name
  28. get_mod_state
  29. set_mod_state
  30. enable_unicode
  31. enable_key_repeat
  32. get_mouse_state
  33. get_relative_mouse_state
  34. get_app_state
  35. joystick_event_state
  36. /;
  37. my @done_event = qw/
  38. type
  39. active
  40. key
  41. motion
  42. button
  43. jaxis
  44. jball
  45. jhat
  46. jbutton
  47. resize
  48. expose
  49. quit
  50. user
  51. syswm
  52. /;
  53. can_ok( 'SDL::Events', @done );
  54. can_ok( 'SDL::Event', @done_event );
  55. is( SDL_ACTIVEEVENT, 1, 'SDL_ACTIVEEVENT should be imported' );
  56. is( SDL_ACTIVEEVENT(), 1, 'SDL_ACTIVEEVENT() should also be available' );
  57. is( SDL_ACTIVEEVENTMASK,
  58. SDL_EVENTMASK(SDL_ACTIVEEVENT),
  59. 'SDL_ACTIVEVENTMASK should be imported'
  60. );
  61. is( SDL_ACTIVEEVENTMASK(),
  62. SDL_EVENTMASK(SDL_ACTIVEEVENT),
  63. 'SDL_ACTIVEVENTMASK() should also be available'
  64. );
  65. is( SDL_ADDEVENT, 0, 'SDL_ADDEVENT should be imported' );
  66. is( SDL_ADDEVENT(), 0, 'SDL_ADDEVENT() should also be available' );
  67. is( SDL_ALLEVENTS, 0xFFFFFFFF, 'SDL_ALLEVENTS should be imported' );
  68. is( SDL_ALLEVENTS(), 0xFFFFFFFF, 'SDL_ALLEVENTS() should also be available' );
  69. is( SDL_APPACTIVE, 4, 'SDL_APPACTIVE should be imported' );
  70. is( SDL_APPACTIVE(), 4, 'SDL_APPACTIVE() should also be available' );
  71. is( SDL_APPINPUTFOCUS, 2, 'SDL_APPINPUTFOCUS should be imported' );
  72. is( SDL_APPINPUTFOCUS(), 2, 'SDL_APPINPUTFOCUS() should also be available' );
  73. is( SDL_APPMOUSEFOCUS, 1, 'SDL_APPMOUSEFOCUS should be imported' );
  74. is( SDL_APPMOUSEFOCUS(), 1, 'SDL_APPMOUSEFOCUS() should also be available' );
  75. is( SDL_BUTTON_LEFT, 1, 'SDL_BUTTON_LEFT should be imported' );
  76. is( SDL_BUTTON_LEFT(), 1, 'SDL_BUTTON_LEFT() should also be available' );
  77. is( SDL_BUTTON_MIDDLE, 2, 'SDL_BUTTON_MIDDLE should be imported' );
  78. is( SDL_BUTTON_MIDDLE(), 2, 'SDL_BUTTON_MIDDLE() should also be available' );
  79. is( SDL_BUTTON_RIGHT, 3, 'SDL_BUTTON_RIGHT should be imported' );
  80. is( SDL_BUTTON_RIGHT(), 3, 'SDL_BUTTON_RIGHT() should also be available' );
  81. is( SDL_BUTTON_WHEELUP, 4, 'SDL_BUTTON_WHEELUP should be imported' );
  82. is( SDL_BUTTON_WHEELUP(), 4, 'SDL_BUTTON_WHEELUP() should also be available' );
  83. is( SDL_BUTTON_WHEELDOWN, 5, 'SDL_BUTTON_WHEELDOWN should be imported' );
  84. is( SDL_BUTTON_WHEELDOWN(), 5,
  85. 'SDL_BUTTON_WHEELDOWN() should also be available'
  86. );
  87. is( SDL_DISABLE, 0, 'SDL_DISABLE should be imported' );
  88. is( SDL_DISABLE(), 0, 'SDL_DISABLE() should also be available' );
  89. is( SDL_ENABLE, 1, 'SDL_ENABLE should be imported' );
  90. is( SDL_ENABLE(), 1, 'SDL_ENABLE() should also be available' );
  91. is( SDL_GETEVENT, 2, 'SDL_GETEVENT should be imported' );
  92. is( SDL_GETEVENT(), 2, 'SDL_GETEVENT() should also be available' );
  93. is( SDL_HAT_CENTERED, 0, 'SDL_HAT_CENTERED should be imported' );
  94. is( SDL_HAT_CENTERED(), 0, 'SDL_HAT_CENTERED() should also be available' );
  95. is( SDL_HAT_DOWN, 4, 'SDL_HAT_DOWN should be imported' );
  96. is( SDL_HAT_DOWN(), 4, 'SDL_HAT_DOWN() should also be available' );
  97. is( SDL_HAT_LEFT, 8, 'SDL_HAT_LEFT should be imported' );
  98. is( SDL_HAT_LEFT(), 8, 'SDL_HAT_LEFT() should also be available' );
  99. is( SDL_HAT_LEFTDOWN, 12, 'SDL_HAT_LEFTDOWN should be imported' );
  100. is( SDL_HAT_LEFTDOWN(), 12, 'SDL_HAT_LEFTDOWN() should also be available' );
  101. is( SDL_HAT_LEFTUP, 9, 'SDL_HAT_LEFTUP should be imported' );
  102. is( SDL_HAT_LEFTUP(), 9, 'SDL_HAT_LEFTUP() should also be available' );
  103. is( SDL_HAT_RIGHT, 2, 'SDL_HAT_RIGHT should be imported' );
  104. is( SDL_HAT_RIGHT(), 2, 'SDL_HAT_RIGHT() should also be available' );
  105. is( SDL_HAT_RIGHTDOWN, 6, 'SDL_HAT_RIGHTDOWN should be imported' );
  106. is( SDL_HAT_RIGHTDOWN(), 6, 'SDL_HAT_RIGHTDOWN() should also be available' );
  107. is( SDL_HAT_RIGHTUP, 3, 'SDL_HAT_RIGHTUP should be imported' );
  108. is( SDL_HAT_RIGHTUP(), 3, 'SDL_HAT_RIGHTUP() should also be available' );
  109. is( SDL_HAT_UP, 1, 'SDL_HAT_UP should be imported' );
  110. is( SDL_HAT_UP(), 1, 'SDL_HAT_UP() should also be available' );
  111. is( SDL_IGNORE, 0, 'SDL_IGNORE should be imported' );
  112. is( SDL_IGNORE(), 0, 'SDL_IGNORE() should also be available' );
  113. is( SDL_JOYAXISMOTION, 7, 'SDL_JOYAXISMOTION should be imported' );
  114. is( SDL_JOYAXISMOTION(), 7, 'SDL_JOYAXISMOTION() should also be available' );
  115. is( SDL_JOYBALLMOTION, 8, 'SDL_JOYBALLMOTION should be imported' );
  116. is( SDL_JOYBALLMOTION(), 8, 'SDL_JOYBALLMOTION() should also be available' );
  117. is( SDL_JOYBUTTONDOWN, 10, 'SDL_JOYBUTTONDOWN should be imported' );
  118. is( SDL_JOYBUTTONDOWN(), 10, 'SDL_JOYBUTTONDOWN() should also be available' );
  119. is( SDL_JOYBUTTONUP, 11, 'SDL_JOYBUTTONUP should be imported' );
  120. is( SDL_JOYBUTTONUP(), 11, 'SDL_JOYBUTTONUP() should also be available' );
  121. is( SDL_JOYHATMOTION, 9, 'SDL_JOYHATMOTION should be imported' );
  122. is( SDL_JOYHATMOTION(), 9, 'SDL_JOYHATMOTION() should also be available' );
  123. is( SDL_JOYAXISMOTIONMASK,
  124. SDL_EVENTMASK(SDL_JOYAXISMOTION),
  125. 'SDL_JOYAXISMOTIONMASK should be imported'
  126. );
  127. is( SDL_JOYAXISMOTIONMASK(),
  128. SDL_EVENTMASK(SDL_JOYAXISMOTION),
  129. 'SDL_JOYAXISMOTIONMASK() should also be available'
  130. );
  131. is( SDL_JOYBALLMOTIONMASK,
  132. SDL_EVENTMASK(SDL_JOYBALLMOTION),
  133. 'SDL_JOYBALLMOTIONMASK should be imported'
  134. );
  135. is( SDL_JOYBALLMOTIONMASK(),
  136. SDL_EVENTMASK(SDL_JOYBALLMOTION),
  137. 'SDL_JOYBALLMOTIONMASK() should also be available'
  138. );
  139. is( SDL_JOYHATMOTIONMASK,
  140. SDL_EVENTMASK(SDL_JOYHATMOTION),
  141. 'SDL_JOYHATMOTIONMASK should be imported'
  142. );
  143. is( SDL_JOYHATMOTIONMASK(),
  144. SDL_EVENTMASK(SDL_JOYHATMOTION),
  145. 'SDL_JOYHATMOTIONMASK() should also be available'
  146. );
  147. is( SDL_JOYBUTTONDOWNMASK,
  148. SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
  149. 'SDL_JOYBUTTONDOWNMASK should be imported'
  150. );
  151. is( SDL_JOYBUTTONDOWNMASK(),
  152. SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
  153. 'SDL_JOYBUTTONDOWNMASK() should also be available'
  154. );
  155. is( SDL_JOYBUTTONUPMASK,
  156. SDL_EVENTMASK(SDL_JOYBUTTONUP),
  157. 'SDL_JOYBUTTONUPMASK should be imported'
  158. );
  159. is( SDL_JOYBUTTONUPMASK(),
  160. SDL_EVENTMASK(SDL_JOYBUTTONUP),
  161. 'SDL_JOYBUTTONUPMASK() should also be available'
  162. );
  163. is( SDL_JOYEVENTMASK,
  164. SDL_EVENTMASK(SDL_JOYAXISMOTION) | SDL_EVENTMASK(SDL_JOYBALLMOTION) |
  165. SDL_EVENTMASK(SDL_JOYHATMOTION) | SDL_EVENTMASK(SDL_JOYBUTTONDOWN) |
  166. SDL_EVENTMASK(SDL_JOYBUTTONUP),
  167. 'SDL_JOYEVENTMASK should be imported'
  168. );
  169. is( SDL_JOYEVENTMASK(),
  170. SDL_EVENTMASK(SDL_JOYAXISMOTION) | SDL_EVENTMASK(SDL_JOYBALLMOTION) |
  171. SDL_EVENTMASK(SDL_JOYHATMOTION) | SDL_EVENTMASK(SDL_JOYBUTTONDOWN) |
  172. SDL_EVENTMASK(SDL_JOYBUTTONUP),
  173. 'SDL_JOYEVENTMASK() should also be available'
  174. );
  175. is( SDL_KEYDOWN, 2, 'SDL_KEYDOWN should be imported' );
  176. is( SDL_KEYDOWN(), 2, 'SDL_KEYDOWN() should also be available' );
  177. is( SDL_KEYUP, 3, 'SDL_KEYUP should be imported' );
  178. is( SDL_KEYUP(), 3, 'SDL_KEYUP() should also be available' );
  179. is( SDL_KEYDOWNMASK,
  180. SDL_EVENTMASK(SDL_KEYDOWN),
  181. 'SDL_KEYDOWNMASK should be imported'
  182. );
  183. is( SDL_KEYDOWNMASK(),
  184. SDL_EVENTMASK(SDL_KEYDOWN),
  185. 'SDL_KEYDOWNMASK() should also be available'
  186. );
  187. is( SDL_KEYUPMASK,
  188. SDL_EVENTMASK(SDL_KEYUP),
  189. 'SDL_KEYUPMASK should be imported'
  190. );
  191. is( SDL_KEYUPMASK(),
  192. SDL_EVENTMASK(SDL_KEYUP),
  193. 'SDL_KEYUPMASK() should also be available'
  194. );
  195. is( SDL_KEYEVENTMASK,
  196. SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP),
  197. 'SDL_KEYEVENTMASK should be imported'
  198. );
  199. is( SDL_KEYEVENTMASK(),
  200. SDL_EVENTMASK(SDL_KEYDOWN) | SDL_EVENTMASK(SDL_KEYUP),
  201. 'SDL_KEYEVENTMASK() should also be available'
  202. );
  203. is( SDL_MOUSEBUTTONDOWN, 5, 'SDL_MOUSEBUTTONDOWN should be imported' );
  204. is( SDL_MOUSEBUTTONDOWN(), 5,
  205. 'SDL_MOUSEBUTTONDOWN() should also be available'
  206. );
  207. is( SDL_MOUSEBUTTONUP, 6, 'SDL_MOUSEBUTTONUP should be imported' );
  208. is( SDL_MOUSEBUTTONUP(), 6, 'SDL_MOUSEBUTTONUP() should also be available' );
  209. is( SDL_MOUSEMOTION, 4, 'SDL_MOUSEMOTION should be imported' );
  210. is( SDL_MOUSEMOTION(), 4, 'SDL_MOUSEMOTION() should also be available' );
  211. is( SDL_MOUSEMOTIONMASK,
  212. SDL_EVENTMASK(SDL_MOUSEMOTION),
  213. 'SDL_MOUSEMOTIONMASK should be imported'
  214. );
  215. is( SDL_MOUSEMOTIONMASK(),
  216. SDL_EVENTMASK(SDL_MOUSEMOTION),
  217. 'SDL_MOUSEMOTIONMASK() should also be available'
  218. );
  219. is( SDL_MOUSEBUTTONDOWNMASK,
  220. SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
  221. 'SDL_MOUSEBUTTONDOWNMASK should be imported'
  222. );
  223. is( SDL_MOUSEBUTTONDOWNMASK(),
  224. SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
  225. 'SDL_MOUSEBUTTONDOWNMASK() should also be available'
  226. );
  227. is( SDL_MOUSEBUTTONUPMASK,
  228. SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
  229. 'SDL_MOUSEBUTTONUPMASK should be imported'
  230. );
  231. is( SDL_MOUSEBUTTONUPMASK(),
  232. SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
  233. 'SDL_MOUSEBUTTONUPMASK() should also be available'
  234. );
  235. is( SDL_MOUSEEVENTMASK,
  236. SDL_EVENTMASK(SDL_MOUSEMOTION) | SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) |
  237. SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
  238. 'SDL_MOUSEEVENTMASK should be imported'
  239. );
  240. is( SDL_MOUSEEVENTMASK(),
  241. SDL_EVENTMASK(SDL_MOUSEMOTION) | SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN) |
  242. SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
  243. 'SDL_MOUSEEVENTMASK() should also be available'
  244. );
  245. is( SDL_NUMEVENTS, 32, 'SDL_NUMEVENTS should be imported' );
  246. is( SDL_NUMEVENTS(), 32, 'SDL_NUMEVENTS() should also be available' );
  247. is( SDL_PEEKEVENT, 1, 'SDL_PEEKEVENT should be imported' );
  248. is( SDL_PEEKEVENT(), 1, 'SDL_PEEKEVENT() should also be available' );
  249. is( SDL_PRESSED, 1, 'SDL_PRESSED should be imported' );
  250. is( SDL_PRESSED(), 1, 'SDL_PRESSED() should also be available' );
  251. is( SDL_QUERY, -1, 'SDL_QUERY should be imported' );
  252. is( SDL_QUERY(), -1, 'SDL_QUERY() should also be available' );
  253. is( SDL_QUIT, 12, 'SDL_QUIT should be imported' );
  254. is( SDL_QUIT(), 12, 'SDL_QUIT() should also be available' );
  255. is( SDL_QUITMASK, SDL_EVENTMASK(SDL_QUIT), 'SDL_QUITMASK should be imported' );
  256. is( SDL_QUITMASK(), SDL_EVENTMASK(SDL_QUIT),
  257. 'SDL_QUITMASK() should also be available'
  258. );
  259. is( SDL_RELEASED, 0, 'SDL_RELEASED should be imported' );
  260. is( SDL_RELEASED(), 0, 'SDL_RELEASED() should also be available' );
  261. is( SDL_SYSWMEVENT, 13, 'SDL_SYSWMEVENT should be imported' );
  262. is( SDL_SYSWMEVENT(), 13, 'SDL_SYSWMEVENT() should also be available' );
  263. is( SDL_SYSWMEVENTMASK,
  264. SDL_EVENTMASK(SDL_SYSWMEVENT),
  265. 'SDL_SYSWMEVENTMASK should be imported'
  266. );
  267. is( SDL_SYSWMEVENTMASK(),
  268. SDL_EVENTMASK(SDL_SYSWMEVENT),
  269. 'SDL_SYSWMEVENTMASK() should also be available'
  270. );
  271. is( SDL_USEREVENT, 24, 'SDL_USEREVENT should be imported' );
  272. is( SDL_USEREVENT(), 24, 'SDL_USEREVENT() should also be available' );
  273. is( SDL_VIDEOEXPOSE, 17, 'SDL_VIDEOEXPOSE should be imported' );
  274. is( SDL_VIDEOEXPOSE(), 17, 'SDL_VIDEOEXPOSE() should also be available' );
  275. is( SDL_VIDEOEXPOSEMASK,
  276. SDL_EVENTMASK(SDL_VIDEOEXPOSE),
  277. 'SDL_VIDEOEXPOSEMASK should be imported'
  278. );
  279. is( SDL_VIDEOEXPOSEMASK(),
  280. SDL_EVENTMASK(SDL_VIDEOEXPOSE),
  281. 'SDL_VIDEOEXPOSEMASK() should also be available'
  282. );
  283. is( SDL_VIDEORESIZE, 16, 'SDL_VIDEORESIZE should be imported' );
  284. is( SDL_VIDEORESIZE(), 16, 'SDL_VIDEORESIZE() should also be available' );
  285. is( SDL_VIDEORESIZEMASK,
  286. SDL_EVENTMASK(SDL_VIDEORESIZE),
  287. 'SDL_VIDEORESIZEMASK should be imported'
  288. );
  289. is( SDL_VIDEORESIZEMASK(),
  290. SDL_EVENTMASK(SDL_VIDEORESIZE),
  291. 'SDL_VIDEORESIZEMASK() should also be available'
  292. );
  293. is( KMOD_ALT, 768, 'KMOD_ALT should be imported' );
  294. is( KMOD_ALT(), 768, 'KMOD_ALT() should also be available' );
  295. is( KMOD_CAPS, 8192, 'KMOD_CAPS should be imported' );
  296. is( KMOD_CAPS(), 8192, 'KMOD_CAPS() should also be available' );
  297. is( KMOD_CTRL, 192, 'KMOD_CTRL should be imported' );
  298. is( KMOD_CTRL(), 192, 'KMOD_CTRL() should also be available' );
  299. is( KMOD_LALT, 256, 'KMOD_LALT should be imported' );
  300. is( KMOD_LALT(), 256, 'KMOD_LALT() should also be available' );
  301. is( KMOD_LCTRL, 64, 'KMOD_LCTRL should be imported' );
  302. is( KMOD_LCTRL(), 64, 'KMOD_LCTRL() should also be available' );
  303. is( KMOD_LMETA, 0x0400, 'KMOD_LMETA should be imported' );
  304. is( KMOD_LMETA(), 0x0400, 'KMOD_LMETA() should also be available' );
  305. is( KMOD_LSHIFT, 1, 'KMOD_LSHIFT should be imported' );
  306. is( KMOD_LSHIFT(), 1, 'KMOD_LSHIFT() should also be available' );
  307. is( KMOD_META, 0x0400 | 0x0800, 'KMOD_META should be imported' );
  308. is( KMOD_META(), 0x0400 | 0x0800, 'KMOD_META() should also be available' );
  309. is( KMOD_MODE, 0x4000, 'KMOD_MODE should be imported' );
  310. is( KMOD_MODE(), 0x4000, 'KMOD_MODE() should also be available' );
  311. is( KMOD_NONE, 0, 'KMOD_NONE should be imported' );
  312. is( KMOD_NONE(), 0, 'KMOD_NONE() should also be available' );
  313. is( KMOD_NUM, 4096, 'KMOD_NUM should be imported' );
  314. is( KMOD_NUM(), 4096, 'KMOD_NUM() should also be available' );
  315. is( KMOD_RESERVED, 0x8000, 'KMOD_RESERVED should be imported' );
  316. is( KMOD_RESERVED(), 0x8000, 'KMOD_RESERVED() should also be available' );
  317. is( KMOD_RALT, 512, 'KMOD_RALT should be imported' );
  318. is( KMOD_RALT(), 512, 'KMOD_RALT() should also be available' );
  319. is( KMOD_RCTRL, 128, 'KMOD_RCTRL should be imported' );
  320. is( KMOD_RCTRL(), 128, 'KMOD_RCTRL() should also be available' );
  321. is( KMOD_RMETA, 0x0800, 'KMOD_RMETA should be imported' );
  322. is( KMOD_RMETA(), 0x0800, 'KMOD_RMETA() should also be available' );
  323. is( KMOD_RSHIFT, 2, 'KMOD_RSHIFT should be imported' );
  324. is( KMOD_RSHIFT(), 2, 'KMOD_RSHIFT() should also be available' );
  325. is( KMOD_SHIFT, 3, 'KMOD_SHIFT should be imported' );
  326. is( KMOD_SHIFT(), 3, 'KMOD_SHIFT() should also be available' );
  327. is( SDLK_0, 48, 'SDLK_0 should be imported' );
  328. is( SDLK_0(), 48, 'SDLK_0() should also be available' );
  329. is( SDLK_1, 49, 'SDLK_1 should be imported' );
  330. is( SDLK_1(), 49, 'SDLK_1() should also be available' );
  331. is( SDLK_2, 50, 'SDLK_2 should be imported' );
  332. is( SDLK_2(), 50, 'SDLK_2() should also be available' );
  333. is( SDLK_3, 51, 'SDLK_3 should be imported' );
  334. is( SDLK_3(), 51, 'SDLK_3() should also be available' );
  335. is( SDLK_4, 52, 'SDLK_4 should be imported' );
  336. is( SDLK_4(), 52, 'SDLK_4() should also be available' );
  337. is( SDLK_5, 53, 'SDLK_5 should be imported' );
  338. is( SDLK_5(), 53, 'SDLK_5() should also be available' );
  339. is( SDLK_6, 54, 'SDLK_6 should be imported' );
  340. is( SDLK_6(), 54, 'SDLK_6() should also be available' );
  341. is( SDLK_7, 55, 'SDLK_7 should be imported' );
  342. is( SDLK_7(), 55, 'SDLK_7() should also be available' );
  343. is( SDLK_8, 56, 'SDLK_8 should be imported' );
  344. is( SDLK_8(), 56, 'SDLK_8() should also be available' );
  345. is( SDLK_9, 57, 'SDLK_9 should be imported' );
  346. is( SDLK_9(), 57, 'SDLK_9() should also be available' );
  347. is( SDLK_AMPERSAND, 38, 'SDLK_AMPERSAND should be imported' );
  348. is( SDLK_AMPERSAND(), 38, 'SDLK_AMPERSAND() should also be available' );
  349. is( SDLK_ASTERISK, 42, 'SDLK_ASTERISK should be imported' );
  350. is( SDLK_ASTERISK(), 42, 'SDLK_ASTERISK() should also be available' );
  351. is( SDLK_AT, 64, 'SDLK_AT should be imported' );
  352. is( SDLK_AT(), 64, 'SDLK_AT() should also be available' );
  353. is( SDLK_BACKQUOTE, 96, 'SDLK_BACKQUOTE should be imported' );
  354. is( SDLK_BACKQUOTE(), 96, 'SDLK_BACKQUOTE() should also be available' );
  355. is( SDLK_BACKSLASH, 92, 'SDLK_BACKSLASH should be imported' );
  356. is( SDLK_BACKSLASH(), 92, 'SDLK_BACKSLASH() should also be available' );
  357. is( SDLK_BACKSPACE, 8, 'SDLK_BACKSPACE should be imported' );
  358. is( SDLK_BACKSPACE(), 8, 'SDLK_BACKSPACE() should also be available' );
  359. is( SDLK_BREAK, 318, 'SDLK_BREAK should be imported' );
  360. is( SDLK_BREAK(), 318, 'SDLK_BREAK() should also be available' );
  361. is( SDLK_CAPSLOCK, 301, 'SDLK_CAPSLOCK should be imported' );
  362. is( SDLK_CAPSLOCK(), 301, 'SDLK_CAPSLOCK() should also be available' );
  363. is( SDLK_CARET, 94, 'SDLK_CARET should be imported' );
  364. is( SDLK_CARET(), 94, 'SDLK_CARET() should also be available' );
  365. is( SDLK_CLEAR, 12, 'SDLK_CLEAR should be imported' );
  366. is( SDLK_CLEAR(), 12, 'SDLK_CLEAR() should also be available' );
  367. is( SDLK_COLON, 58, 'SDLK_COLON should be imported' );
  368. is( SDLK_COLON(), 58, 'SDLK_COLON() should also be available' );
  369. is( SDLK_COMMA, 44, 'SDLK_COMMA should be imported' );
  370. is( SDLK_COMMA(), 44, 'SDLK_COMMA() should also be available' );
  371. is( SDLK_COMPOSE, 314, 'SDLK_COMPOSE should be imported' );
  372. is( SDLK_COMPOSE(), 314, 'SDLK_COMPOSE() should also be available' );
  373. is( SDLK_DELETE, 127, 'SDLK_DELETE should be imported' );
  374. is( SDLK_DELETE(), 127, 'SDLK_DELETE() should also be available' );
  375. is( SDLK_DOLLAR, 36, 'SDLK_DOLLAR should be imported' );
  376. is( SDLK_DOLLAR(), 36, 'SDLK_DOLLAR() should also be available' );
  377. is( SDLK_DOWN, 274, 'SDLK_DOWN should be imported' );
  378. is( SDLK_DOWN(), 274, 'SDLK_DOWN() should also be available' );
  379. is( SDLK_END, 279, 'SDLK_END should be imported' );
  380. is( SDLK_END(), 279, 'SDLK_END() should also be available' );
  381. is( SDLK_EQUALS, 61, 'SDLK_EQUALS should be imported' );
  382. is( SDLK_EQUALS(), 61, 'SDLK_EQUALS() should also be available' );
  383. is( SDLK_ESCAPE, 27, 'SDLK_ESCAPE should be imported' );
  384. is( SDLK_ESCAPE(), 27, 'SDLK_ESCAPE() should also be available' );
  385. is( SDLK_EURO, 321, 'SDLK_EURO should be imported' );
  386. is( SDLK_EURO(), 321, 'SDLK_EURO() should also be available' );
  387. is( SDLK_EXCLAIM, 33, 'SDLK_EXCLAIM should be imported' );
  388. is( SDLK_EXCLAIM(), 33, 'SDLK_EXCLAIM() should also be available' );
  389. is( SDLK_F1, 282, 'SDLK_F1 should be imported' );
  390. is( SDLK_F1(), 282, 'SDLK_F1() should also be available' );
  391. is( SDLK_F10, 291, 'SDLK_F10 should be imported' );
  392. is( SDLK_F10(), 291, 'SDLK_F10() should also be available' );
  393. is( SDLK_F11, 292, 'SDLK_F11 should be imported' );
  394. is( SDLK_F11(), 292, 'SDLK_F11() should also be available' );
  395. is( SDLK_F12, 293, 'SDLK_F12 should be imported' );
  396. is( SDLK_F12(), 293, 'SDLK_F12() should also be available' );
  397. is( SDLK_F13, 294, 'SDLK_F13 should be imported' );
  398. is( SDLK_F13(), 294, 'SDLK_F13() should also be available' );
  399. is( SDLK_F14, 295, 'SDLK_F14 should be imported' );
  400. is( SDLK_F14(), 295, 'SDLK_F14() should also be available' );
  401. is( SDLK_F15, 296, 'SDLK_F15 should be imported' );
  402. is( SDLK_F15(), 296, 'SDLK_F15() should also be available' );
  403. is( SDLK_F2, 283, 'SDLK_F2 should be imported' );
  404. is( SDLK_F2(), 283, 'SDLK_F2() should also be available' );
  405. is( SDLK_F3, 284, 'SDLK_F3 should be imported' );
  406. is( SDLK_F3(), 284, 'SDLK_F3() should also be available' );
  407. is( SDLK_F4, 285, 'SDLK_F4 should be imported' );
  408. is( SDLK_F4(), 285, 'SDLK_F4() should also be available' );
  409. is( SDLK_F5, 286, 'SDLK_F5 should be imported' );
  410. is( SDLK_F5(), 286, 'SDLK_F5() should also be available' );
  411. is( SDLK_F6, 287, 'SDLK_F6 should be imported' );
  412. is( SDLK_F6(), 287, 'SDLK_F6() should also be available' );
  413. is( SDLK_F7, 288, 'SDLK_F7 should be imported' );
  414. is( SDLK_F7(), 288, 'SDLK_F7() should also be available' );
  415. is( SDLK_F8, 289, 'SDLK_F8 should be imported' );
  416. is( SDLK_F8(), 289, 'SDLK_F8() should also be available' );
  417. is( SDLK_F9, 290, 'SDLK_F9 should be imported' );
  418. is( SDLK_F9(), 290, 'SDLK_F9() should also be available' );
  419. is( SDLK_FIRST, 0, 'SDLK_FIRST should be imported' );
  420. is( SDLK_FIRST(), 0, 'SDLK_FIRST() should also be available' );
  421. is( SDLK_GREATER, 62, 'SDLK_GREATER should be imported' );
  422. is( SDLK_GREATER(), 62, 'SDLK_GREATER() should also be available' );
  423. is( SDLK_HASH, 35, 'SDLK_HASH should be imported' );
  424. is( SDLK_HASH(), 35, 'SDLK_HASH() should also be available' );
  425. is( SDLK_HELP, 315, 'SDLK_HELP should be imported' );
  426. is( SDLK_HELP(), 315, 'SDLK_HELP() should also be available' );
  427. is( SDLK_HOME, 278, 'SDLK_HOME should be imported' );
  428. is( SDLK_HOME(), 278, 'SDLK_HOME() should also be available' );
  429. is( SDLK_INSERT, 277, 'SDLK_INSERT should be imported' );
  430. is( SDLK_INSERT(), 277, 'SDLK_INSERT() should also be available' );
  431. is( SDLK_KP0, 256, 'SDLK_KP0 should be imported' );
  432. is( SDLK_KP0(), 256, 'SDLK_KP0() should also be available' );
  433. is( SDLK_KP1, 257, 'SDLK_KP1 should be imported' );
  434. is( SDLK_KP1(), 257, 'SDLK_KP1() should also be available' );
  435. is( SDLK_KP2, 258, 'SDLK_KP2 should be imported' );
  436. is( SDLK_KP2(), 258, 'SDLK_KP2() should also be available' );
  437. is( SDLK_KP3, 259, 'SDLK_KP3 should be imported' );
  438. is( SDLK_KP3(), 259, 'SDLK_KP3() should also be available' );
  439. is( SDLK_KP4, 260, 'SDLK_KP4 should be imported' );
  440. is( SDLK_KP4(), 260, 'SDLK_KP4() should also be available' );
  441. is( SDLK_KP5, 261, 'SDLK_KP5 should be imported' );
  442. is( SDLK_KP5(), 261, 'SDLK_KP5() should also be available' );
  443. is( SDLK_KP6, 262, 'SDLK_KP6 should be imported' );
  444. is( SDLK_KP6(), 262, 'SDLK_KP6() should also be available' );
  445. is( SDLK_KP7, 263, 'SDLK_KP7 should be imported' );
  446. is( SDLK_KP7(), 263, 'SDLK_KP7() should also be available' );
  447. is( SDLK_KP8, 264, 'SDLK_KP8 should be imported' );
  448. is( SDLK_KP8(), 264, 'SDLK_KP8() should also be available' );
  449. is( SDLK_KP9, 265, 'SDLK_KP9 should be imported' );
  450. is( SDLK_KP9(), 265, 'SDLK_KP9() should also be available' );
  451. is( SDLK_KP_DIVIDE, 267, 'SDLK_KP_DIVIDE should be imported' );
  452. is( SDLK_KP_DIVIDE(), 267, 'SDLK_KP_DIVIDE() should also be available' );
  453. is( SDLK_KP_ENTER, 271, 'SDLK_KP_ENTER should be imported' );
  454. is( SDLK_KP_ENTER(), 271, 'SDLK_KP_ENTER() should also be available' );
  455. is( SDLK_KP_EQUALS, 272, 'SDLK_KP_EQUALS should be imported' );
  456. is( SDLK_KP_EQUALS(), 272, 'SDLK_KP_EQUALS() should also be available' );
  457. is( SDLK_KP_MINUS, 269, 'SDLK_KP_MINUS should be imported' );
  458. is( SDLK_KP_MINUS(), 269, 'SDLK_KP_MINUS() should also be available' );
  459. is( SDLK_KP_MULTIPLY, 268, 'SDLK_KP_MULTIPLY should be imported' );
  460. is( SDLK_KP_MULTIPLY(), 268, 'SDLK_KP_MULTIPLY() should also be available' );
  461. is( SDLK_KP_PERIOD, 266, 'SDLK_KP_PERIOD should be imported' );
  462. is( SDLK_KP_PERIOD(), 266, 'SDLK_KP_PERIOD() should also be available' );
  463. is( SDLK_KP_PLUS, 270, 'SDLK_KP_PLUS should be imported' );
  464. is( SDLK_KP_PLUS(), 270, 'SDLK_KP_PLUS() should also be available' );
  465. is( SDLK_LALT, 308, 'SDLK_LALT should be imported' );
  466. is( SDLK_LALT(), 308, 'SDLK_LALT() should also be available' );
  467. is( SDLK_LCTRL, 306, 'SDLK_LCTRL should be imported' );
  468. is( SDLK_LCTRL(), 306, 'SDLK_LCTRL() should also be available' );
  469. is( SDLK_LEFT, 276, 'SDLK_LEFT should be imported' );
  470. is( SDLK_LEFT(), 276, 'SDLK_LEFT() should also be available' );
  471. is( SDLK_LEFTBRACKET, 91, 'SDLK_LEFTBRACKET should be imported' );
  472. is( SDLK_LEFTBRACKET(), 91, 'SDLK_LEFTBRACKET() should also be available' );
  473. is( SDLK_LEFTPAREN, 40, 'SDLK_LEFTPAREN should be imported' );
  474. is( SDLK_LEFTPAREN(), 40, 'SDLK_LEFTPAREN() should also be available' );
  475. is( SDLK_LESS, 60, 'SDLK_LESS should be imported' );
  476. is( SDLK_LESS(), 60, 'SDLK_LESS() should also be available' );
  477. is( SDLK_LMETA, 310, 'SDLK_LMETA should be imported' );
  478. is( SDLK_LMETA(), 310, 'SDLK_LMETA() should also be available' );
  479. is( SDLK_LSHIFT, 304, 'SDLK_LSHIFT should be imported' );
  480. is( SDLK_LSHIFT(), 304, 'SDLK_LSHIFT() should also be available' );
  481. is( SDLK_LSUPER, 311, 'SDLK_LSUPER should be imported' );
  482. is( SDLK_LSUPER(), 311, 'SDLK_LSUPER() should also be available' );
  483. is( SDLK_MENU, 319, 'SDLK_MENU should be imported' );
  484. is( SDLK_MENU(), 319, 'SDLK_MENU() should also be available' );
  485. is( SDLK_MINUS, 45, 'SDLK_MINUS should be imported' );
  486. is( SDLK_MINUS(), 45, 'SDLK_MINUS() should also be available' );
  487. is( SDLK_MODE, 313, 'SDLK_MODE should be imported' );
  488. is( SDLK_MODE(), 313, 'SDLK_MODE() should also be available' );
  489. is( SDLK_NUMLOCK, 300, 'SDLK_NUMLOCK should be imported' );
  490. is( SDLK_NUMLOCK(), 300, 'SDLK_NUMLOCK() should also be available' );
  491. is( SDLK_PAGEDOWN, 281, 'SDLK_PAGEDOWN should be imported' );
  492. is( SDLK_PAGEDOWN(), 281, 'SDLK_PAGEDOWN() should also be available' );
  493. is( SDLK_PAGEUP, 280, 'SDLK_PAGEUP should be imported' );
  494. is( SDLK_PAGEUP(), 280, 'SDLK_PAGEUP() should also be available' );
  495. is( SDLK_PAUSE, 19, 'SDLK_PAUSE should be imported' );
  496. is( SDLK_PAUSE(), 19, 'SDLK_PAUSE() should also be available' );
  497. is( SDLK_PERIOD, 46, 'SDLK_PERIOD should be imported' );
  498. is( SDLK_PERIOD(), 46, 'SDLK_PERIOD() should also be available' );
  499. is( SDLK_PLUS, 43, 'SDLK_PLUS should be imported' );
  500. is( SDLK_PLUS(), 43, 'SDLK_PLUS() should also be available' );
  501. is( SDLK_POWER, 320, 'SDLK_POWER should be imported' );
  502. is( SDLK_POWER(), 320, 'SDLK_POWER() should also be available' );
  503. is( SDLK_PRINT, 316, 'SDLK_PRINT should be imported' );
  504. is( SDLK_PRINT(), 316, 'SDLK_PRINT() should also be available' );
  505. is( SDLK_QUESTION, 63, 'SDLK_QUESTION should be imported' );
  506. is( SDLK_QUESTION(), 63, 'SDLK_QUESTION() should also be available' );
  507. is( SDLK_QUOTE, 39, 'SDLK_QUOTE should be imported' );
  508. is( SDLK_QUOTE(), 39, 'SDLK_QUOTE() should also be available' );
  509. is( SDLK_QUOTEDBL, 34, 'SDLK_QUOTEDBL should be imported' );
  510. is( SDLK_QUOTEDBL(), 34, 'SDLK_QUOTEDBL() should also be available' );
  511. is( SDLK_RALT, 307, 'SDLK_RALT should be imported' );
  512. is( SDLK_RALT(), 307, 'SDLK_RALT() should also be available' );
  513. is( SDLK_RCTRL, 305, 'SDLK_RCTRL should be imported' );
  514. is( SDLK_RCTRL(), 305, 'SDLK_RCTRL() should also be available' );
  515. is( SDLK_RETURN, 13, 'SDLK_RETURN should be imported' );
  516. is( SDLK_RETURN(), 13, 'SDLK_RETURN() should also be available' );
  517. is( SDLK_RIGHT, 275, 'SDLK_RIGHT should be imported' );
  518. is( SDLK_RIGHT(), 275, 'SDLK_RIGHT() should also be available' );
  519. is( SDLK_RIGHTBRACKET, 93, 'SDLK_RIGHTBRACKET should be imported' );
  520. is( SDLK_RIGHTBRACKET(), 93, 'SDLK_RIGHTBRACKET() should also be available' );
  521. is( SDLK_RIGHTPAREN, 41, 'SDLK_RIGHTPAREN should be imported' );
  522. is( SDLK_RIGHTPAREN(), 41, 'SDLK_RIGHTPAREN() should also be available' );
  523. is( SDLK_RMETA, 309, 'SDLK_RMETA should be imported' );
  524. is( SDLK_RMETA(), 309, 'SDLK_RMETA() should also be available' );
  525. is( SDLK_RSHIFT, 303, 'SDLK_RSHIFT should be imported' );
  526. is( SDLK_RSHIFT(), 303, 'SDLK_RSHIFT() should also be available' );
  527. is( SDLK_RSUPER, 312, 'SDLK_RSUPER should be imported' );
  528. is( SDLK_RSUPER(), 312, 'SDLK_RSUPER() should also be available' );
  529. is( SDLK_SCROLLOCK, 302, 'SDLK_SCROLLOCK should be imported' );
  530. is( SDLK_SCROLLOCK(), 302, 'SDLK_SCROLLOCK() should also be available' );
  531. is( SDLK_SEMICOLON, 59, 'SDLK_SEMICOLON should be imported' );
  532. is( SDLK_SEMICOLON(), 59, 'SDLK_SEMICOLON() should also be available' );
  533. is( SDLK_SLASH, 47, 'SDLK_SLASH should be imported' );
  534. is( SDLK_SLASH(), 47, 'SDLK_SLASH() should also be available' );
  535. is( SDLK_SPACE, 32, 'SDLK_SPACE should be imported' );
  536. is( SDLK_SPACE(), 32, 'SDLK_SPACE() should also be available' );
  537. is( SDLK_SYSREQ, 317, 'SDLK_SYSREQ should be imported' );
  538. is( SDLK_SYSREQ(), 317, 'SDLK_SYSREQ() should also be available' );
  539. is( SDLK_TAB, 9, 'SDLK_TAB should be imported' );
  540. is( SDLK_TAB(), 9, 'SDLK_TAB() should also be available' );
  541. is( SDLK_UNDERSCORE, 95, 'SDLK_UNDERSCORE should be imported' );
  542. is( SDLK_UNDERSCORE(), 95, 'SDLK_UNDERSCORE() should also be available' );
  543. is( SDLK_UNDO, 322, 'SDLK_UNDO should be imported' );
  544. is( SDLK_UNDO(), 322, 'SDLK_UNDO() should also be available' );
  545. is( SDLK_UNKNOWN, 0, 'SDLK_WORLD_95 should be imported' );
  546. is( SDLK_UNKNOWN(), 0, 'SDLK_WORLD_95() should also be available' );
  547. is( SDLK_UP, 273, 'SDLK_UP should be imported' );
  548. is( SDLK_UP(), 273, 'SDLK_UP() should also be available' );
  549. is( SDLK_WORLD_0, 160, 'SDLK_WORLD_0 should be imported' );
  550. is( SDLK_WORLD_0(), 160, 'SDLK_WORLD_0() should also be available' );
  551. is( SDLK_WORLD_1, 161, 'SDLK_WORLD_1 should be imported' );
  552. is( SDLK_WORLD_1(), 161, 'SDLK_WORLD_1() should also be available' );
  553. is( SDLK_WORLD_2, 162, 'SDLK_WORLD_2 should be imported' );
  554. is( SDLK_WORLD_2(), 162, 'SDLK_WORLD_2() should also be available' );
  555. is( SDLK_WORLD_3, 163, 'SDLK_WORLD_3 should be imported' );
  556. is( SDLK_WORLD_3(), 163, 'SDLK_WORLD_3() should also be available' );
  557. is( SDLK_WORLD_4, 164, 'SDLK_WORLD_4 should be imported' );
  558. is( SDLK_WORLD_4(), 164, 'SDLK_WORLD_4() should also be available' );
  559. is( SDLK_WORLD_5, 165, 'SDLK_WORLD_5 should be imported' );
  560. is( SDLK_WORLD_5(), 165, 'SDLK_WORLD_5() should also be available' );
  561. is( SDLK_WORLD_6, 166, 'SDLK_WORLD_6 should be imported' );
  562. is( SDLK_WORLD_6(), 166, 'SDLK_WORLD_6() should also be available' );
  563. is( SDLK_WORLD_7, 167, 'SDLK_WORLD_7 should be imported' );
  564. is( SDLK_WORLD_7(), 167, 'SDLK_WORLD_7() should also be available' );
  565. is( SDLK_WORLD_8, 168, 'SDLK_WORLD_8 should be imported' );
  566. is( SDLK_WORLD_8(), 168, 'SDLK_WORLD_8() should also be available' );
  567. is( SDLK_WORLD_9, 169, 'SDLK_WORLD_9 should be imported' );
  568. is( SDLK_WORLD_9(), 169, 'SDLK_WORLD_9() should also be available' );
  569. is( SDLK_WORLD_10, 170, 'SDLK_WORLD_10 should be imported' );
  570. is( SDLK_WORLD_10(), 170, 'SDLK_WORLD_10() should also be available' );
  571. is( SDLK_WORLD_11, 171, 'SDLK_WORLD_11 should be imported' );
  572. is( SDLK_WORLD_11(), 171, 'SDLK_WORLD_11() should also be available' );
  573. is( SDLK_WORLD_12, 172, 'SDLK_WORLD_12 should be imported' );
  574. is( SDLK_WORLD_12(), 172, 'SDLK_WORLD_12() should also be available' );
  575. is( SDLK_WORLD_13, 173, 'SDLK_WORLD_13 should be imported' );
  576. is( SDLK_WORLD_13(), 173, 'SDLK_WORLD_13() should also be available' );
  577. is( SDLK_WORLD_14, 174, 'SDLK_WORLD_14 should be imported' );
  578. is( SDLK_WORLD_14(), 174, 'SDLK_WORLD_14() should also be available' );
  579. is( SDLK_WORLD_15, 175, 'SDLK_WORLD_15 should be imported' );
  580. is( SDLK_WORLD_15(), 175, 'SDLK_WORLD_15() should also be available' );
  581. is( SDLK_WORLD_16, 176, 'SDLK_WORLD_16 should be imported' );
  582. is( SDLK_WORLD_16(), 176, 'SDLK_WORLD_16() should also be available' );
  583. is( SDLK_WORLD_17, 177, 'SDLK_WORLD_17 should be imported' );
  584. is( SDLK_WORLD_17(), 177, 'SDLK_WORLD_17() should also be available' );
  585. is( SDLK_WORLD_18, 178, 'SDLK_WORLD_18 should be imported' );
  586. is( SDLK_WORLD_18(), 178, 'SDLK_WORLD_18() should also be available' );
  587. is( SDLK_WORLD_19, 179, 'SDLK_WORLD_19 should be imported' );
  588. is( SDLK_WORLD_19(), 179, 'SDLK_WORLD_19() should also be available' );
  589. is( SDLK_WORLD_20, 180, 'SDLK_WORLD_20 should be imported' );
  590. is( SDLK_WORLD_20(), 180, 'SDLK_WORLD_20() should also be available' );
  591. is( SDLK_WORLD_21, 181, 'SDLK_WORLD_21 should be imported' );
  592. is( SDLK_WORLD_21(), 181, 'SDLK_WORLD_21() should also be available' );
  593. is( SDLK_WORLD_22, 182, 'SDLK_WORLD_22 should be imported' );
  594. is( SDLK_WORLD_22(), 182, 'SDLK_WORLD_22() should also be available' );
  595. is( SDLK_WORLD_23, 183, 'SDLK_WORLD_23 should be imported' );
  596. is( SDLK_WORLD_23(), 183, 'SDLK_WORLD_23() should also be available' );
  597. is( SDLK_WORLD_24, 184, 'SDLK_WORLD_24 should be imported' );
  598. is( SDLK_WORLD_24(), 184, 'SDLK_WORLD_24() should also be available' );
  599. is( SDLK_WORLD_25, 185, 'SDLK_WORLD_25 should be imported' );
  600. is( SDLK_WORLD_25(), 185, 'SDLK_WORLD_25() should also be available' );
  601. is( SDLK_WORLD_26, 186, 'SDLK_WORLD_26 should be imported' );
  602. is( SDLK_WORLD_26(), 186, 'SDLK_WORLD_26() should also be available' );
  603. is( SDLK_WORLD_27, 187, 'SDLK_WORLD_27 should be imported' );
  604. is( SDLK_WORLD_27(), 187, 'SDLK_WORLD_27() should also be available' );
  605. is( SDLK_WORLD_28, 188, 'SDLK_WORLD_28 should be imported' );
  606. is( SDLK_WORLD_28(), 188, 'SDLK_WORLD_28() should also be available' );
  607. is( SDLK_WORLD_29, 189, 'SDLK_WORLD_29 should be imported' );
  608. is( SDLK_WORLD_29(), 189, 'SDLK_WORLD_29() should also be available' );
  609. is( SDLK_WORLD_30, 190, 'SDLK_WORLD_30 should be imported' );
  610. is( SDLK_WORLD_30(), 190, 'SDLK_WORLD_30() should also be available' );
  611. is( SDLK_WORLD_31, 191, 'SDLK_WORLD_31 should be imported' );
  612. is( SDLK_WORLD_31(), 191, 'SDLK_WORLD_31() should also be available' );
  613. is( SDLK_WORLD_32, 192, 'SDLK_WORLD_32 should be imported' );
  614. is( SDLK_WORLD_32(), 192, 'SDLK_WORLD_32() should also be available' );
  615. is( SDLK_WORLD_33, 193, 'SDLK_WORLD_33 should be imported' );
  616. is( SDLK_WORLD_33(), 193, 'SDLK_WORLD_33() should also be available' );
  617. is( SDLK_WORLD_34, 194, 'SDLK_WORLD_34 should be imported' );
  618. is( SDLK_WORLD_34(), 194, 'SDLK_WORLD_34() should also be available' );
  619. is( SDLK_WORLD_35, 195, 'SDLK_WORLD_35 should be imported' );
  620. is( SDLK_WORLD_35(), 195, 'SDLK_WORLD_35() should also be available' );
  621. is( SDLK_WORLD_36, 196, 'SDLK_WORLD_36 should be imported' );
  622. is( SDLK_WORLD_36(), 196, 'SDLK_WORLD_36() should also be available' );
  623. is( SDLK_WORLD_37, 197, 'SDLK_WORLD_37 should be imported' );
  624. is( SDLK_WORLD_37(), 197, 'SDLK_WORLD_37() should also be available' );
  625. is( SDLK_WORLD_38, 198, 'SDLK_WORLD_38 should be imported' );
  626. is( SDLK_WORLD_38(), 198, 'SDLK_WORLD_38() should also be available' );
  627. is( SDLK_WORLD_39, 199, 'SDLK_WORLD_39 should be imported' );
  628. is( SDLK_WORLD_39(), 199, 'SDLK_WORLD_39() should also be available' );
  629. is( SDLK_WORLD_40, 200, 'SDLK_WORLD_40 should be imported' );
  630. is( SDLK_WORLD_40(), 200, 'SDLK_WORLD_40() should also be available' );
  631. is( SDLK_WORLD_41, 201, 'SDLK_WORLD_41 should be imported' );
  632. is( SDLK_WORLD_41(), 201, 'SDLK_WORLD_41() should also be available' );
  633. is( SDLK_WORLD_42, 202, 'SDLK_WORLD_42 should be imported' );
  634. is( SDLK_WORLD_42(), 202, 'SDLK_WORLD_42() should also be available' );
  635. is( SDLK_WORLD_43, 203, 'SDLK_WORLD_43 should be imported' );
  636. is( SDLK_WORLD_43(), 203, 'SDLK_WORLD_43() should also be available' );
  637. is( SDLK_WORLD_44, 204, 'SDLK_WORLD_44 should be imported' );
  638. is( SDLK_WORLD_44(), 204, 'SDLK_WORLD_44() should also be available' );
  639. is( SDLK_WORLD_45, 205, 'SDLK_WORLD_45 should be imported' );
  640. is( SDLK_WORLD_45(), 205, 'SDLK_WORLD_45() should also be available' );
  641. is( SDLK_WORLD_46, 206, 'SDLK_WORLD_46 should be imported' );
  642. is( SDLK_WORLD_46(), 206, 'SDLK_WORLD_46() should also be available' );
  643. is( SDLK_WORLD_47, 207, 'SDLK_WORLD_47 should be imported' );
  644. is( SDLK_WORLD_47(), 207, 'SDLK_WORLD_47() should also be available' );
  645. is( SDLK_WORLD_48, 208, 'SDLK_WORLD_48 should be imported' );
  646. is( SDLK_WORLD_48(), 208, 'SDLK_WORLD_48() should also be available' );
  647. is( SDLK_WORLD_49, 209, 'SDLK_WORLD_49 should be imported' );
  648. is( SDLK_WORLD_49(), 209, 'SDLK_WORLD_49() should also be available' );
  649. is( SDLK_WORLD_50, 210, 'SDLK_WORLD_50 should be imported' );
  650. is( SDLK_WORLD_50(), 210, 'SDLK_WORLD_50() should also be available' );
  651. is( SDLK_WORLD_51, 211, 'SDLK_WORLD_51 should be imported' );
  652. is( SDLK_WORLD_51(), 211, 'SDLK_WORLD_51() should also be available' );
  653. is( SDLK_WORLD_52, 212, 'SDLK_WORLD_52 should be imported' );
  654. is( SDLK_WORLD_52(), 212, 'SDLK_WORLD_52() should also be available' );
  655. is( SDLK_WORLD_53, 213, 'SDLK_WORLD_53 should be imported' );
  656. is( SDLK_WORLD_53(), 213, 'SDLK_WORLD_53() should also be available' );
  657. is( SDLK_WORLD_54, 214, 'SDLK_WORLD_54 should be imported' );
  658. is( SDLK_WORLD_54(), 214, 'SDLK_WORLD_54() should also be available' );
  659. is( SDLK_WORLD_55, 215, 'SDLK_WORLD_55 should be imported' );
  660. is( SDLK_WORLD_55(), 215, 'SDLK_WORLD_55() should also be available' );
  661. is( SDLK_WORLD_56, 216, 'SDLK_WORLD_56 should be imported' );
  662. is( SDLK_WORLD_56(), 216, 'SDLK_WORLD_56() should also be available' );
  663. is( SDLK_WORLD_57, 217, 'SDLK_WORLD_57 should be imported' );
  664. is( SDLK_WORLD_57(), 217, 'SDLK_WORLD_57() should also be available' );
  665. is( SDLK_WORLD_58, 218, 'SDLK_WORLD_58 should be imported' );
  666. is( SDLK_WORLD_58(), 218, 'SDLK_WORLD_58() should also be available' );
  667. is( SDLK_WORLD_59, 219, 'SDLK_WORLD_59 should be imported' );
  668. is( SDLK_WORLD_59(), 219, 'SDLK_WORLD_59() should also be available' );
  669. is( SDLK_WORLD_60, 220, 'SDLK_WORLD_60 should be imported' );
  670. is( SDLK_WORLD_60(), 220, 'SDLK_WORLD_60() should also be available' );
  671. is( SDLK_WORLD_61, 221, 'SDLK_WORLD_61 should be imported' );
  672. is( SDLK_WORLD_61(), 221, 'SDLK_WORLD_61() should also be available' );
  673. is( SDLK_WORLD_62, 222, 'SDLK_WORLD_62 should be imported' );
  674. is( SDLK_WORLD_62(), 222, 'SDLK_WORLD_62() should also be available' );
  675. is( SDLK_WORLD_63, 223, 'SDLK_WORLD_63 should be imported' );
  676. is( SDLK_WORLD_63(), 223, 'SDLK_WORLD_63() should also be available' );
  677. is( SDLK_WORLD_64, 224, 'SDLK_WORLD_64 should be imported' );
  678. is( SDLK_WORLD_64(), 224, 'SDLK_WORLD_64() should also be available' );
  679. is( SDLK_WORLD_65, 225, 'SDLK_WORLD_65 should be imported' );
  680. is( SDLK_WORLD_65(), 225, 'SDLK_WORLD_65() should also be available' );
  681. is( SDLK_WORLD_66, 226, 'SDLK_WORLD_66 should be imported' );
  682. is( SDLK_WORLD_66(), 226, 'SDLK_WORLD_66() should also be available' );
  683. is( SDLK_WORLD_67, 227, 'SDLK_WORLD_67 should be imported' );
  684. is( SDLK_WORLD_67(), 227, 'SDLK_WORLD_67() should also be available' );
  685. is( SDLK_WORLD_68, 228, 'SDLK_WORLD_68 should be imported' );
  686. is( SDLK_WORLD_68(), 228, 'SDLK_WORLD_68() should also be available' );
  687. is( SDLK_WORLD_69, 229, 'SDLK_WORLD_69 should be imported' );
  688. is( SDLK_WORLD_69(), 229, 'SDLK_WORLD_69() should also be available' );
  689. is( SDLK_WORLD_70, 230, 'SDLK_WORLD_70 should be imported' );
  690. is( SDLK_WORLD_70(), 230, 'SDLK_WORLD_70() should also be available' );
  691. is( SDLK_WORLD_71, 231, 'SDLK_WORLD_71 should be imported' );
  692. is( SDLK_WORLD_71(), 231, 'SDLK_WORLD_71() should also be available' );
  693. is( SDLK_WORLD_72, 232, 'SDLK_WORLD_72 should be imported' );
  694. is( SDLK_WORLD_72(), 232, 'SDLK_WORLD_72() should also be available' );
  695. is( SDLK_WORLD_73, 233, 'SDLK_WORLD_73 should be imported' );
  696. is( SDLK_WORLD_73(), 233, 'SDLK_WORLD_73() should also be available' );
  697. is( SDLK_WORLD_74, 234, 'SDLK_WORLD_74 should be imported' );
  698. is( SDLK_WORLD_74(), 234, 'SDLK_WORLD_74() should also be available' );
  699. is( SDLK_WORLD_75, 235, 'SDLK_WORLD_75 should be imported' );
  700. is( SDLK_WORLD_75(), 235, 'SDLK_WORLD_75() should also be available' );
  701. is( SDLK_WORLD_76, 236, 'SDLK_WORLD_76 should be imported' );
  702. is( SDLK_WORLD_76(), 236, 'SDLK_WORLD_76() should also be available' );
  703. is( SDLK_WORLD_77, 237, 'SDLK_WORLD_77 should be imported' );
  704. is( SDLK_WORLD_77(), 237, 'SDLK_WORLD_77() should also be available' );
  705. is( SDLK_WORLD_78, 238, 'SDLK_WORLD_78 should be imported' );
  706. is( SDLK_WORLD_78(), 238, 'SDLK_WORLD_78() should also be available' );
  707. is( SDLK_WORLD_79, 239, 'SDLK_WORLD_79 should be imported' );
  708. is( SDLK_WORLD_79(), 239, 'SDLK_WORLD_79() should also be available' );
  709. is( SDLK_WORLD_80, 240, 'SDLK_WORLD_80 should be imported' );
  710. is( SDLK_WORLD_80(), 240, 'SDLK_WORLD_80() should also be available' );
  711. is( SDLK_WORLD_81, 241, 'SDLK_WORLD_81 should be imported' );
  712. is( SDLK_WORLD_81(), 241, 'SDLK_WORLD_81() should also be available' );
  713. is( SDLK_WORLD_82, 242, 'SDLK_WORLD_82 should be imported' );
  714. is( SDLK_WORLD_82(), 242, 'SDLK_WORLD_82() should also be available' );
  715. is( SDLK_WORLD_83, 243, 'SDLK_WORLD_83 should be imported' );
  716. is( SDLK_WORLD_83(), 243, 'SDLK_WORLD_83() should also be available' );
  717. is( SDLK_WORLD_84, 244, 'SDLK_WORLD_84 should be imported' );
  718. is( SDLK_WORLD_84(), 244, 'SDLK_WORLD_84() should also be available' );
  719. is( SDLK_WORLD_85, 245, 'SDLK_WORLD_85 should be imported' );
  720. is( SDLK_WORLD_85(), 245, 'SDLK_WORLD_85() should also be available' );
  721. is( SDLK_WORLD_86, 246, 'SDLK_WORLD_86 should be imported' );
  722. is( SDLK_WORLD_86(), 246, 'SDLK_WORLD_86() should also be available' );
  723. is( SDLK_WORLD_87, 247, 'SDLK_WORLD_87 should be imported' );
  724. is( SDLK_WORLD_87(), 247, 'SDLK_WORLD_87() should also be available' );
  725. is( SDLK_WORLD_88, 248, 'SDLK_WORLD_88 should be imported' );
  726. is( SDLK_WORLD_88(), 248, 'SDLK_WORLD_88() should also be available' );
  727. is( SDLK_WORLD_89, 249, 'SDLK_WORLD_89 should be imported' );
  728. is( SDLK_WORLD_89(), 249, 'SDLK_WORLD_89() should also be available' );
  729. is( SDLK_WORLD_90, 250, 'SDLK_WORLD_90 should be imported' );
  730. is( SDLK_WORLD_90(), 250, 'SDLK_WORLD_90() should also be available' );
  731. is( SDLK_WORLD_91, 251, 'SDLK_WORLD_91 should be imported' );
  732. is( SDLK_WORLD_91(), 251, 'SDLK_WORLD_91() should also be available' );
  733. is( SDLK_WORLD_92, 252, 'SDLK_WORLD_92 should be imported' );
  734. is( SDLK_WORLD_92(), 252, 'SDLK_WORLD_92() should also be available' );
  735. is( SDLK_WORLD_93, 253, 'SDLK_WORLD_93 should be imported' );
  736. is( SDLK_WORLD_93(), 253, 'SDLK_WORLD_93() should also be available' );
  737. is( SDLK_WORLD_94, 254, 'SDLK_WORLD_94 should be imported' );
  738. is( SDLK_WORLD_94(), 254, 'SDLK_WORLD_94() should also be available' );
  739. is( SDLK_WORLD_95, 255, 'SDLK_WORLD_95 should be imported' );
  740. is( SDLK_WORLD_95(), 255, 'SDLK_WORLD_95() should also be available' );
  741. is( SDLK_a, 97, 'SDLK_a should be imported' );
  742. is( SDLK_a(), 97, 'SDLK_a() should also be available' );
  743. is( SDLK_b, 98, 'SDLK_b should be imported' );
  744. is( SDLK_b(), 98, 'SDLK_b() should also be available' );
  745. is( SDLK_c, 99, 'SDLK_c should be imported' );
  746. is( SDLK_c(), 99, 'SDLK_c() should also be available' );
  747. is( SDLK_d, 100, 'SDLK_d should be imported' );
  748. is( SDLK_d(), 100, 'SDLK_d() should also be available' );
  749. is( SDLK_e, 101, 'SDLK_e should be imported' );
  750. is( SDLK_e(), 101, 'SDLK_e() should also be available' );
  751. is( SDLK_f, 102, 'SDLK_f should be imported' );
  752. is( SDLK_f(), 102, 'SDLK_f() should also be available' );
  753. is( SDLK_g, 103, 'SDLK_g should be imported' );
  754. is( SDLK_g(), 103, 'SDLK_g() should also be available' );
  755. is( SDLK_h, 104, 'SDLK_h should be imported' );
  756. is( SDLK_h(), 104, 'SDLK_h() should also be available' );
  757. is( SDLK_i, 105, 'SDLK_i should be imported' );
  758. is( SDLK_i(), 105, 'SDLK_i() should also be available' );
  759. is( SDLK_j, 106, 'SDLK_j should be imported' );
  760. is( SDLK_j(), 106, 'SDLK_j() should also be available' );
  761. is( SDLK_k, 107, 'SDLK_k should be imported' );
  762. is( SDLK_k(), 107, 'SDLK_k() should also be available' );
  763. is( SDLK_l, 108, 'SDLK_l should be imported' );
  764. is( SDLK_l(), 108, 'SDLK_l() should also be available' );
  765. is( SDLK_m, 109, 'SDLK_m should be imported' );
  766. is( SDLK_m(), 109, 'SDLK_m() should also be available' );
  767. is( SDLK_n, 110, 'SDLK_n should be imported' );
  768. is( SDLK_n(), 110, 'SDLK_n() should also be available' );
  769. is( SDLK_o, 111, 'SDLK_o should be imported' );
  770. is( SDLK_o(), 111, 'SDLK_o() should also be available' );
  771. is( SDLK_p, 112, 'SDLK_p should be imported' );
  772. is( SDLK_p(), 112, 'SDLK_p() should also be available' );
  773. is( SDLK_q, 113, 'SDLK_q should be imported' );
  774. is( SDLK_q(), 113, 'SDLK_q() should also be available' );
  775. is( SDLK_r, 114, 'SDLK_r should be imported' );
  776. is( SDLK_r(), 114, 'SDLK_r() should also be available' );
  777. is( SDLK_s, 115, 'SDLK_s should be imported' );
  778. is( SDLK_s(), 115, 'SDLK_s() should also be available' );
  779. is( SDLK_t, 116, 'SDLK_t should be imported' );
  780. is( SDLK_t(), 116, 'SDLK_t() should also be available' );
  781. is( SDLK_u, 117, 'SDLK_u should be imported' );
  782. is( SDLK_u(), 117, 'SDLK_u() should also be available' );
  783. is( SDLK_v, 118, 'SDLK_v should be imported' );
  784. is( SDLK_v(), 118, 'SDLK_v() should also be available' );
  785. is( SDLK_w, 119, 'SDLK_w should be imported' );
  786. is( SDLK_w(), 119, 'SDLK_w() should also be available' );
  787. is( SDLK_x, 120, 'SDLK_x should be imported' );
  788. is( SDLK_x(), 120, 'SDLK_x() should also be available' );
  789. is( SDLK_y, 121, 'SDLK_y should be imported' );
  790. is( SDLK_y(), 121, 'SDLK_y() should also be available' );
  791. is( SDLK_z, 122, 'SDLK_z should be imported' );
  792. is( SDLK_z(), 122, 'SDLK_z() should also be available' );
  793. my $display = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE );
  794. is( SDL::Events::pump_events(), undef, '[pump_events] Returns undef' );
  795. my $event = SDL::Event->new();
  796. my $aevent = SDL::Event->new();
  797. $aevent->type(SDL_ACTIVEEVENT);
  798. $aevent->active_gain(1);
  799. $aevent->active_state(SDL_APPINPUTFOCUS);
  800. my $userdata = SDL::Event->new();
  801. $userdata->type(SDL_USEREVENT);
  802. my @udata = ( 0 .. 10 );
  803. $userdata->user_data1( \@udata );
  804. SDL::Events::push_event($aevent);
  805. pass '[push_event] Event can be pushed';
  806. SDL::Events::push_event($userdata);
  807. SDL::Events::pump_events();
  808. pass '[pump_events] pumping events';
  809. my $got_event = 0;
  810. while (1) {
  811. SDL::Events::pump_events();
  812. my $ret = SDL::Events::poll_event($event);
  813. my $r;
  814. if ( $event->type == SDL_ACTIVEEVENT
  815. && $event->active_gain == 1
  816. && $event->active_state == SDL_APPINPUTFOCUS )
  817. {
  818. $got_event = 1;
  819. is( $got_event, 1, '[poll_event] Got an Active event back out' );
  820. is( $event->active_gain(), 1, '[poll_event] Got right active->gain' );
  821. is( $event->active_state(), SDL_APPINPUTFOCUS,
  822. '[poll_event] Got right active->state'
  823. );
  824. }
  825. if ( $event->type == SDL_USEREVENT ) {
  826. $r = $event->user_data1();
  827. is( @{$r}, 11, '[user_events] can hold user data now' );
  828. }
  829. last if $r && $got_event;
  830. last if ( $ret == 0 );
  831. }
  832. SDL::Events::push_event($aevent);
  833. pass '[push_event] ran';
  834. SDL::Events::pump_events();
  835. my $value = SDL::Events::wait_event($event);
  836. is( $value, 1, '[wait_event] waited for event' );
  837. my $num_peep_events = SDL::Events::peep_events( $event, 127, SDL_PEEKEVENT, SDL_ALLEVENTS );
  838. is( $num_peep_events >= 0,
  839. 1, '[peep_events] Size of event queue is ' . $num_peep_events
  840. );
  841. my $callback = sub { return 1; };
  842. SDL::Events::set_event_filter($callback);
  843. pass '[set_event_filter] takes a callback';
  844. my $array = SDL::Events::get_key_state();
  845. isa_ok( $array, 'ARRAY', '[get_key_state] returned and array' );
  846. my @mods = (
  847. KMOD_NONE, KMOD_LSHIFT, KMOD_RSHIFT, KMOD_LCTRL,
  848. KMOD_RCTRL, KMOD_LALT, KMOD_RALT, KMOD_LMETA,
  849. KMOD_RMETA, KMOD_NUM, KMOD_CAPS, KMOD_MODE,
  850. );
  851. foreach (@mods) {
  852. SDL::Events::set_mod_state($_);
  853. pass '[set_mod_state] set the mod properly';
  854. is( SDL::Events::get_mod_state(),
  855. $_, '[get_mod_state] got the mod properly'
  856. );
  857. }
  858. #SDL::quit();
  859. #SDL::init(SDL_INIT_VIDEO);
  860. $display = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE );
  861. SDL::Video::get_video_info();
  862. is( SDL::Events::get_key_name(SDLK_ESCAPE),
  863. 'escape', '[get_key_name] Gets name of key_sym back'
  864. );
  865. SDL::Events::push_event($aevent);
  866. my $nevent = SDL::Event->new();
  867. SDL::Events::event_state( SDL_ACTIVEEVENT, SDL_IGNORE );
  868. SDL::Events::pump_events();
  869. my $got = 0;
  870. while ( SDL::Events::poll_event($nevent) ) {
  871. $got = 1 if $nevent->type == SDL_ACTIVEEVENT;
  872. }
  873. is( $got, 0, '[event_state] works with SDL_IGNORE on SDL_ACTIVEEVENT' );
  874. SDL::Events::event_state( SDL_ACTIVEEVENT, SDL_ENABLE );
  875. SDL::Events::push_event($aevent);
  876. SDL::Events::pump_events();
  877. my $atleast = 0;
  878. while ( SDL::Events::poll_event($nevent) ) {
  879. $atleast = 1 if $nevent->type == SDL_ACTIVEEVENT;
  880. }
  881. is( $atleast, 1, '[event_state] works with SDL_ENABLE on SDL_ACTIVEEVENT' );
  882. is( SDL::Events::enable_unicode(1), 0, '[enable_unicode] return 0 took 1' );
  883. is( SDL::Events::enable_unicode(-1), 1, '[enable_unicode] return 1 took -1' );
  884. is( SDL::Events::enable_unicode(0), 1, '[enable_unicode] return 1 took 0' );
  885. is( SDL::Events::enable_unicode(-1), 0, '[enable_unicode] return 1 took -1' );
  886. #my $kr = SDL::Events::enable_key_repeat( SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
  887. my $kr = SDL::Events::enable_key_repeat( 10, 10 );
  888. is( ( $kr == -1 || $kr == 0 ),
  889. 1, '[enable_key_repeat] returned expeceted values'
  890. );
  891. SDL::Events::pump_events();
  892. my $ms = SDL::Events::get_mouse_state();
  893. isa_ok(
  894. $ms, 'ARRAY',
  895. '[get_mouse_state] got back array size of ' . @{$ms} . ' '
  896. );
  897. $ms = SDL::Events::get_relative_mouse_state();
  898. isa_ok(
  899. $ms, 'ARRAY',
  900. '[get_relative_mouse_state] got back array size of ' . @{$ms} . ' '
  901. );
  902. $ms = SDL::Events::get_app_state();
  903. is( ( $ms >= SDL_APPACTIVE || SDL_APPINPUTFOCUS && $ms <= SDL_APPMOUSEFOCUS ),
  904. 1, '[get_app_state] Returns value within parameter ' . $ms
  905. );
  906. is( SDL::Events::joystick_event_state(SDL_ENABLE),
  907. SDL_ENABLE, '[joystick_event_state] return SDL_IGNORE correctly'
  908. );
  909. is( SDL::Events::joystick_event_state(SDL_QUERY),
  910. SDL_ENABLE, '[joystick_event_state] return SDL_ENABLE took SDL_QUERY'
  911. );
  912. is( SDL::Events::joystick_event_state(SDL_IGNORE),
  913. SDL_IGNORE, '[joystick_event_state] return SDL_IGNORE correctly'
  914. );
  915. is( SDL::Events::joystick_event_state(SDL_QUERY),
  916. SDL_IGNORE, '[joystick_event_state] return SDL_IGNORE took SDL_QUERY '
  917. );
  918. SKIP:
  919. {
  920. skip "Turn SDL_GUI_TEST on", 1 unless $ENV{'SDL_GUI_TEST'};
  921. SDL::quit();
  922. SDL::init(SDL_INIT_VIDEO);
  923. $display = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE );
  924. $event = SDL::Event->new();
  925. #This filters out all ActiveEvents
  926. my $filter = sub {
  927. if ( $_[0]->type == SDL_ACTIVEEVENT ) { return 0 }
  928. else { return 1; }
  929. };
  930. my $filtered = 1;
  931. SDL::Events::set_event_filter($filter);
  932. while (1) {
  933. SDL::Events::pump_events();
  934. if ( SDL::Events::poll_event($event) ) {
  935. if ( $event->type == SDL_ACTIVEEVENT ) {
  936. diag 'We should not be in here. The next test will fail!';
  937. $filtered = 0; #we got a problem!
  938. print "Hello Mouse!!!\n"
  939. if ( $event->active_gain
  940. && ( $event->active_state == SDL_APPMOUSEFOCUS ) );
  941. print "Bye Mouse!!!\n"
  942. if ( !$event->active_gain
  943. && ( $event->active_state == SDL_APPMOUSEFOCUS ) );
  944. }
  945. last if ( $event->type == SDL_QUIT );
  946. }
  947. }
  948. is( $filtered, 1, '[set_event_filter] Properly filtered SDL_ACTIVEEVENT' );
  949. }
  950. if ($videodriver) {
  951. $ENV{SDL_VIDEODRIVER} = $videodriver;
  952. } else {
  953. delete $ENV{SDL_VIDEODRIVER};
  954. }
  955. #SDL::quit();
  956. pass 'Are we still alive? Checking for segfaults';
  957. done_testing;
  958. sleep(2);