{"action":"created","issue":{"url":"https://api.github.com/repos/IronLanguages/ironpython2/issues/399","repository_url":"https://api.github.com/repos/IronLanguages/ironpython2","labels_url":"https://api.github.com/repos/IronLanguages/ironpython2/issues/399/labels{/name}","comments_url":"https://api.github.com/repos/IronLanguages/ironpython2/issues/399/comments","events_url":"https://api.github.com/repos/IronLanguages/ironpython2/issues/399/events","html_url":"https://github.com/IronLanguages/ironpython2/issues/399","id":327359682,"node_id":"MDU6SXNzdWUzMjczNTk2ODI=","number":399,"title":"Issue in ctypes\\test\\test_win32.py","user":{"login":"slide","id":55871,"node_id":"MDQ6VXNlcjU1ODcx","avatar_url":"https://avatars2.githubusercontent.com/u/55871?v=4","gravatar_id":"","url":"https://api.github.com/users/slide","html_url":"https://github.com/slide","followers_url":"https://api.github.com/users/slide/followers","following_url":"https://api.github.com/users/slide/following{/other_user}","gists_url":"https://api.github.com/users/slide/gists{/gist_id}","starred_url":"https://api.github.com/users/slide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slide/subscriptions","organizations_url":"https://api.github.com/users/slide/orgs","repos_url":"https://api.github.com/users/slide/repos","events_url":"https://api.github.com/users/slide/events{/privacy}","received_events_url":"https://api.github.com/users/slide/received_events","type":"User","site_admin":false},"labels":[{"id":966164239,"node_id":"MDU6TGFiZWw5NjYxNjQyMzk=","url":"https://api.github.com/repos/IronLanguages/ironpython2/labels/ctypes","name":"ctypes","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-29T14:58:22Z","updated_at":"2018-07-13T13:20:23Z","closed_at":"2018-07-13T13:20:23Z","author_association":"MEMBER","body":"```python\r\ndef test_struct_by_value(self):\r\n        class POINT(Structure):\r\n            _fields_ = [(\"x\", c_long),\r\n                        (\"y\", c_long)]\r\n\r\n        class RECT(Structure):\r\n            _fields_ = [(\"left\", c_long),\r\n                        (\"top\", c_long),\r\n                        (\"right\", c_long),\r\n                        (\"bottom\", c_long)]\r\n\r\n        dll = CDLL(_ctypes_test.__file__)\r\n\r\n        pt = POINT(15, 25)\r\n        left = c_long.in_dll(dll, 'left')\r\n        top = c_long.in_dll(dll, 'top')\r\n        right = c_long.in_dll(dll, 'right')\r\n        bottom = c_long.in_dll(dll, 'bottom')\r\n        rect = RECT(left, top, right, bottom)\r\n        PointInRect = dll.PointInRect\r\n        PointInRect.argtypes = [POINTER(RECT), POINT]\r\n        self.assertEqual(1, PointInRect(byref(rect), pt))\r\n\r\n        ReturnRect = dll.ReturnRect\r\n        ReturnRect.argtypes = [c_int, RECT, POINTER(RECT), POINT, RECT,\r\n                               POINTER(RECT), POINT, RECT]\r\n        ReturnRect.restype = RECT\r\n        for i in range(4):\r\n            ret = ReturnRect(i, rect, pointer(rect), pt, rect,\r\n                         byref(rect), pt, rect)\r\n            # the c function will check and modify ret if something is\r\n            # passed in improperly\r\n            self.assertEqual(ret.left, left.value)\r\n            self.assertEqual(ret.right, right.value)\r\n            self.assertEqual(ret.top, top.value)\r\n            self.assertEqual(ret.bottom, bottom.value)\r\n\r\n        # to not leak references, we must clean _pointer_type_cache\r\n        from ctypes import _pointer_type_cache\r\n        del _pointer_type_cache[RECT]\r\n```\r\n\r\n```\r\n======================================================================\r\nFAIL: test_struct_by_value (__main__.Structures)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \".\\Src\\StdLib\\Lib\\ctypes\\test\\test_win32.py\", line 114, in test_struct_by_value\r\n    self.assertEqual(ret.left, left.value)\r\nAssertionError: 100 != 10\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/IronLanguages/ironpython2/issues/comments/404831422","html_url":"https://github.com/IronLanguages/ironpython2/issues/399#issuecomment-404831422","issue_url":"https://api.github.com/repos/IronLanguages/ironpython2/issues/399","id":404831422,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDgzMTQyMg==","user":{"login":"slide","id":55871,"node_id":"MDQ6VXNlcjU1ODcx","avatar_url":"https://avatars2.githubusercontent.com/u/55871?v=4","gravatar_id":"","url":"https://api.github.com/users/slide","html_url":"https://github.com/slide","followers_url":"https://api.github.com/users/slide/followers","following_url":"https://api.github.com/users/slide/following{/other_user}","gists_url":"https://api.github.com/users/slide/gists{/gist_id}","starred_url":"https://api.github.com/users/slide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slide/subscriptions","organizations_url":"https://api.github.com/users/slide/orgs","repos_url":"https://api.github.com/users/slide/repos","events_url":"https://api.github.com/users/slide/events{/privacy}","received_events_url":"https://api.github.com/users/slide/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T13:20:23Z","updated_at":"2018-07-13T13:20:23Z","author_association":"MEMBER","body":"Collected in #457"}}
{"actor":{"display_login":"slide"}}