~ubuntu-branches/ubuntu/oneiric/python2.5/oneiric

« back to all changes in this revision

Viewing changes to Lib/ctypes/test/test_bitfields.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-12-21 08:57:49 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20081221085749-bijjr25h8na5jdsu
Tags: 2.5.3-0ubuntu1
* New upstream version.
* Regenerate the included documentation.
* Add an option --install-layout=deb, which is ignored for 2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
215
215
                        ("b", c_ubyte, 4)]
216
216
        self.failUnlessEqual(sizeof(X), sizeof(c_byte))
217
217
 
 
218
    def test_mixed_4(self):
 
219
        class X(Structure):
 
220
            _fields_ = [("a", c_short, 4),
 
221
                        ("b", c_short, 4),
 
222
                        ("c", c_int, 24),
 
223
                        ("d", c_short, 4),
 
224
                        ("e", c_short, 4),
 
225
                        ("f", c_int, 24)]
 
226
        # MSVC does NOT combine c_short and c_int into one field, GCC
 
227
        # does (unless GCC is run with '-mms-bitfields' which
 
228
        # produces code compatible with MSVC).
 
229
        if os.name in ("nt", "ce"):
 
230
            self.failUnlessEqual(sizeof(X), sizeof(c_int) * 4)
 
231
        else:
 
232
            self.failUnlessEqual(sizeof(X), sizeof(c_int) * 2)
 
233
 
218
234
    def test_anon_bitfields(self):
219
235
        # anonymous bit-fields gave a strange error message
220
236
        class X(Structure):