GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-97588: Failing tests to demonstrate the issue by matthiasgoergens · Pull Request #97589 · python/cpython

gh-97588: Failing tests to demonstrate the issue #97589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
matthiasgoergens wants to merge 18 commits into python:main from matthiasgoergens:bitfields

Uh oh!

There was an error while loading. Please reload this page.

Closed

gh-97588: Failing tests to demonstrate the issue #97589

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
992436d
gh-97588: Some tests to demonstrate the issue
matthiasgoergens Sep 27, 2022
8c8e615
Merge branch 'main' into bitfields
matthiasgoergens Sep 27, 2022
ee0d8ee
Merge branch 'main' into bitfields
matthiasgoergens Sep 27, 2022
90365da
Merge branch 'main' into bitfields
matthiasgoergens Sep 28, 2022
9c12c18
Merge remote-tracking branch 'origin/main' into bitfields
matthiasgoergens Sep 28, 2022
af33256
Merge remote-tracking branch 'matthias/bitfields' into bitfields
matthiasgoergens Sep 30, 2022
6a46883
Mark expected failure
matthiasgoergens Sep 30, 2022
3a03cb8
Mention the issue
matthiasgoergens Sep 30, 2022
0aa3a00
Doesn't fail on Windows
matthiasgoergens Sep 30, 2022
f41e7cc
Test for alignment boundary
matthiasgoergens Sep 30, 2022
a77b849
Rename variables
matthiasgoergens Sep 30, 2022
923d1ef
More failures
matthiasgoergens Sep 30, 2022
dd7ddd4
More failures
matthiasgoergens Sep 30, 2022
41a506f
Merge branch 'main' into bitfields
matthiasgoergens Sep 30, 2022
e5dfe88
📜🤖 Added by blurb_it.
blurb-it[bot] Sep 30, 2022
ed2e932
More failures
matthiasgoergens Sep 30, 2022
dee6b90
Merge remote-tracking branch 'matthias/bitfields' into bitfields
matthiasgoergens Sep 30, 2022
be065d5
Merge remote-tracking branch 'origin/main' into bitfields
matthiasgoergens Mar 14, 2023
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

74 changes: 74 additions & 0 deletions 74 Lib/test/test_ctypes/test_bitfields.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from test import support
import unittest
import os
import sys

import _ctypes_test

Expand Down Expand Up @@ -236,6 +237,79 @@ class X(Structure):
else:
self.assertEqual(sizeof(X), sizeof(c_int) * 2)

@unittest.skipIf(sys.platform == 'win32', "Doesn't fail on Windows")
@unittest.expectedFailure # gh-97588
def test_mixed_5(self):
class X(Structure):
_fields_ = [
('A', c_uint, 1),
('B', c_ushort, 16)]
a = X()
a.A = 0
a.B = 1
self.assertEqual(1, a.B)

@unittest.skipIf(sys.platform == 'win32', "Doesn't fail on Windows")
@unittest.expectedFailure # gh-97588
def test_mixed_6(self):
class X(Structure):
_fields_ = [
('A', c_ulonglong, 1),
('B', c_uint, 32)]
a = X()
a.A = 0
a.B = 1
self.assertEqual(1, a.B)

@unittest.skipIf(sys.platform == 'win32', "Doesn't fail on Windows")
@unittest.expectedFailure # gh-97588
def test_mixed_7(self):
class X(Structure):
_fields_ = [
("A", c_uint),
('B', c_uint, 20),
('C', c_ulonglong, 24)]
self.assertEqual(16, sizeof(X))

@unittest.skipIf(sys.platform == 'win32', "Doesn't fail on Windows")
@unittest.expectedFailure # gh-97588
def test_mixed_8(self):
class Foo(Structure):
_fields_ = [
("A", c_uint),
("B", c_uint, 32),
("C", c_ulonglong, 1),
]

class Bar(Structure):
_fields_ = [
("A", c_uint),
("B", c_uint),
("C", c_ulonglong, 1),
]
self.assertEqual(sizeof(Foo), sizeof(Bar))

@unittest.skipIf(sys.platform == 'win32', "Doesn't fail on Windows")
@unittest.expectedFailure # gh-97588
def test_mixed_9(self):
class X(Structure):
_fields_ = [
("A", c_uint8),
("B", c_uint, 1),
]
self.assertEqual(4, sizeof(X))

@unittest.skipIf(sys.platform == 'win32', "Doesn't fail on Windows")
@unittest.expectedFailure # gh-97588
def test_mixed_10(self):
class X(Structure):
_fields_ = [
("A", c_uint32, 1),
("B", c_uint64, 1),
]
self.assertEqual(8, alignment(X))
self.assertEqual(8, sizeof(X))

def test_anon_bitfields(self):
# anonymous bit-fields gave a strange error message
class X(Structure):
Expand Down
1 change: 1 addition & 0 deletions 1 Misc/NEWS.d/next/C API/2022-09-30-07-16-00.gh-issue-97588.yQFteB.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add failing tests to document problems with ctypes structs.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.