Пример #1
0
 def test_get_events_issue_6(self):
     sdl2ext.init()
     SDL_FlushEvent(SDL_FIRSTEVENT, SDL_LASTEVENT)
     for x in range(12):
         event = SDL_Event()
         event.type = SDL_USEREVENT + x
         event.user = SDL_UserEvent(type=event.type, timestamp=0,
                                    windowID=0, code=0)
         SDL_PushEvent(event)
     results = sdl2ext.get_events()
     for idx, r in enumerate(results):
         self.assertEqual(idx, r.type - SDL_USEREVENT)
Пример #2
0
 def test_get_events(self):
     sdl2ext.init()
     SDL_FlushEvent(SDL_FIRSTEVENT, SDL_LASTEVENT)
     for x in range(10):
         event = SDL_Event()
         event.type = SDL_USEREVENT + 1
         event.user = SDL_UserEvent(type=event.type, timestamp=0,
                                    windowID=0, code=0)
         SDL_PushEvent(event)
     results = sdl2ext.get_events()
     self.assertEqual(len(results), 10)
     for ev in results:
         self.assertEqual(ev.type, (SDL_USEREVENT + 1))
Пример #3
0
 def test_get_events_issue_6(self):
     try:
         sdl2ext.init()
     except sdl2ext.SDLError:
         raise unittest.SkipTest('Video subsystem not supported')
     SDL_FlushEvent(SDL_FIRSTEVENT, SDL_LASTEVENT)
     for x in range(12):
         event = SDL_Event()
         event.type = SDL_USEREVENT + x
         event.user = SDL_UserEvent(type=event.type,
                                    timestamp=0,
                                    windowID=0,
                                    code=0)
         SDL_PushEvent(event)
     results = sdl2ext.get_events()
     for idx, r in enumerate(results):
         self.assertEqual(idx, r.type - SDL_USEREVENT)
Пример #4
0
 def test_get_events(self):
     try:
         sdl2ext.init()
     except sdl2ext.SDLError:
         raise unittest.SkipTest('Video subsystem not supported')
     SDL_FlushEvent(SDL_FIRSTEVENT, SDL_LASTEVENT)
     for x in range(10):
         event = SDL_Event()
         event.type = SDL_USEREVENT + 1
         event.user = SDL_UserEvent(type=event.type,
                                    timestamp=0,
                                    windowID=0,
                                    code=0)
         SDL_PushEvent(event)
     results = sdl2ext.get_events()
     self.assertEqual(len(results), 10)
     for ev in results:
         self.assertEqual(ev.type, (SDL_USEREVENT + 1))