def test_surface_basic(): assert RSDL.Init(RSDL.INIT_VIDEO) >= 0 surface = RSDL.CreateRGBSurface(0, 150, 50, 32, r_uint(0x000000FF), r_uint(0x0000FF00), r_uint(0x00FF0000), r_uint(0xFF000000)) assert surface assert rffi.getintfield(surface, 'c_w') == 150 assert rffi.getintfield(surface, 'c_h') == 50 RSDL.FreeSurface(surface) RSDL.Quit()
def mainLoop(self): self.reset() self.is_running = True try: while self.is_running and self.handle_events(): self.emulate(constants.GAMEBOY_CLOCK >> 2) time.sleep(10 / 1000) except: self.is_running = False lltype.free(self.event, flavor='raw') RSDL.Quit() self.handle_execution_error() return 0
def test_sdl_init(): assert RSDL.Init(RSDL.INIT_VIDEO) >= 0 RSDL.Quit()
def test_delay_getticks(): assert RSDL.Init(RSDL.INIT_VIDEO) >= 0 RSDL.Delay(10) i = RSDL.GetTicks() assert i >= 10 RSDL.Quit()
def teardown_method(self, meth): RSDL.Quit()
def teardown_method(self, meth): RSDL.FreeSurface(self.src_surf) RSDL.FreeSurface(self.dst_surf) RSDL.Quit()