示例#1
0
    def test_pygame2_sdl_base_was_init(self):

        # __doc__ (as of 2009-04-01) for pygame2.sdl.base.was_init:

        # was_init (flags) -> int
        #
        # Gets a bitwise OR'ed combination of the initialized SDL subsystems.
        #
        # Returns a bitwise combination of the currently initialized SDL
        # subsystems.
        base.init(constants.INIT_JOYSTICK)
        v = base.was_init(constants.INIT_JOYSTICK) & constants.INIT_JOYSTICK
        self.assertEqual(v, constants.INIT_JOYSTICK)
        base.quit()
示例#2
0
    def test_pygame2_sdl_base_init(self):

        # __doc__ (as of 2009-04-01) for pygame2.sdl.base.init:

        # init (flags) -> bool
        #
        # Initializes the underlying SDL library.
        #
        # Initializes the underlying SDL library using the passed SDL
        # flags. The flags indicate, which subsystems of SDL should be
        # initialized and can be a bitwise combination of the INIT_*
        # constants.  In case an error occured, False will be
        # returned. The detailled error can be received using
        # pygame2.sdl.get_error().
        self.assertEqual(base.init(constants.INIT_CDROM), True)
        self.assertEqual(base.init(constants.INIT_CDROM | constants.INIT_AUDIO), True)
        base.quit()