summaryrefslogtreecommitdiff
path: root/tests/glibext/objhole.py
blob: 6a7c2e8a421fcce488a134b81916a00da9f8ae23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

from chrysacase import ChrysalideTestCase
from pychrysalide.glibext import ThickObject


class TestWorks(ChrysalideTestCase):
    """TestCase for pychrysalide.glibext.BinaryPortion"""

    def testExtraAccess(self):
        """Access to various definitions of the extra data for ThickObject."""

        obj = ThickObject()

        self.assertEqual(obj.extra, 0)

        obj.extra = 0xffffffe0

        self.assertEqual(obj.extra, 0xffffffe0)

        obj.extra = 0x00123000

        self.assertEqual(obj.extra, 0x00123000)


    def testRservedBits(self):
        """Check space leaved as available by the GLib."""

        obj = ThickObject()

        self.assertTrue(obj._GOBJECT_RESERVED_EXTRA_BITS > 0)
        self.assertTrue(obj._GOBJECT_RESERVED_EXTRA_BITS < 32)