diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2009-11-01 20:28:48 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2009-11-01 20:28:48 (GMT) |
commit | 63e64add92fef0649b64c39dc4e048d613bedf52 (patch) | |
tree | 35af01d86014074c70e950c2b8665ccd2e2ea56b /Lib/test/test_socket.py | |
parent | 743d8319ef71641a0b0efa53aad6590b6cd2835b (diff) | |
download | cpython-63e64add92fef0649b64c39dc4e048d613bedf52.zip cpython-63e64add92fef0649b64c39dc4e048d613bedf52.tar.gz cpython-63e64add92fef0649b64c39dc4e048d613bedf52.tar.bz2 |
Merged revisions 69519 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r69519 | gregory.p.smith | 2009-02-11 15:45:25 -0800 (Wed, 11 Feb 2009) | 3 lines
Issue #1008086: Fixes socket.inet_aton() to always return 4 bytes even
on LP64 platforms (most 64-bit Linux, bsd, unix systems).
........
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r-- | Lib/test/test_socket.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index dabdcfe..7380e3e 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -385,6 +385,14 @@ class GeneralModuleTests(unittest.TestCase): # Check that setting it to an invalid type raises TypeError self.assertRaises(TypeError, socket.setdefaulttimeout, "spam") + def testIPv4_inet_aton_fourbytes(self): + if not hasattr(socket, 'inet_aton'): + return # No inet_aton, nothing to check + # Test that issue1008086 and issue767150 are fixed. + # It must return 4 bytes. + self.assertEquals('\x00'*4, socket.inet_aton('0.0.0.0')) + self.assertEquals('\xff'*4, socket.inet_aton('255.255.255.255')) + def testIPv4toString(self): if not hasattr(socket, 'inet_pton'): return # No inet_pton() on this platform |