diff options
author | Brian Curtin <brian@python.org> | 2012-12-27 20:12:43 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2012-12-27 20:12:43 (GMT) |
commit | 9eac6b3848d6f6a59187199520144709ddcb3567 (patch) | |
tree | 5de3a3e1be8be1e1811f2d1f123bec028b5feaaf /Lib | |
parent | 07e0e06f8a255a73d181e332dd8658814eb1ca50 (diff) | |
parent | 172e42295fa846bb253f698da10150906f723f52 (diff) | |
download | cpython-9eac6b3848d6f6a59187199520144709ddcb3567.zip cpython-9eac6b3848d6f6a59187199520144709ddcb3567.tar.gz cpython-9eac6b3848d6f6a59187199520144709ddcb3567.tar.bz2 |
Merge
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_winreg.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py index 68c12eb..a164d2f 100644 --- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -335,6 +335,23 @@ class LocalWinregTests(BaseWinregTests): finally: DeleteKey(HKEY_CURRENT_USER, test_key_name) + def test_queryvalueex_return_value(self): + # Test for Issue #16759, return unsigned int from QueryValueEx. + # Reg2Py, which gets called by QueryValueEx, was returning a value + # generated by PyLong_FromLong. The implmentation now uses + # PyLong_FromUnsignedLong to match DWORD's size. + try: + with CreateKey(HKEY_CURRENT_USER, test_key_name) as ck: + self.assertNotEqual(ck.handle, 0) + test_val = 0x80000000 + SetValueEx(ck, "test_name", None, REG_DWORD, test_val) + ret_val, ret_type = QueryValueEx(ck, "test_name") + self.assertEqual(ret_type, REG_DWORD) + self.assertEqual(ret_val, test_val) + finally: + DeleteKey(HKEY_CURRENT_USER, test_key_name) + + @unittest.skipUnless(REMOTE_NAME, "Skipping remote registry tests") class RemoteWinregTests(BaseWinregTests): |