Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(89096)

Delta Between Two Patch Sets: Lib/ctypes/test/test_libc.py

Issue 23670: Modifications to support iOS as a development platform
Left Patch Set: Created 3 years, 8 months ago
Right Patch Set: Created 3 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Lib/ctypes/test/test_functions.py ('k') | Lib/ctypes/test/test_parameters.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(Both sides are equal)
1 import os 1 import os
2 import unittest 2 import unittest
3 3
4 from ctypes import * 4 from ctypes import *
5 import _ctypes_test 5 import _ctypes_test
6 6
7 lib = CDLL(getattr(_ctypes_test, '__file__', os.environ['TEST_EXECUTABLE'])) 7 lib = CDLL(getattr(_ctypes_test, '__file__', os.environ['TEST_EXECUTABLE']))
8 8
9 def three_way_cmp(x, y): 9 def three_way_cmp(x, y):
10 """Return -1 if x < y, 0 if x == y and 1 if x > y""" 10 """Return -1 if x < y, 0 if x == y and 1 if x > y"""
(...skipping 14 matching lines...) Expand all
25 25
26 def sort(a, b): 26 def sort(a, b):
27 return three_way_cmp(a[0], b[0]) 27 return three_way_cmp(a[0], b[0])
28 28
29 chars = create_string_buffer(b"spam, spam, and spam") 29 chars = create_string_buffer(b"spam, spam, and spam")
30 lib.my_qsort(chars, len(chars)-1, sizeof(c_char), comparefunc(sort)) 30 lib.my_qsort(chars, len(chars)-1, sizeof(c_char), comparefunc(sort))
31 self.assertEqual(chars.raw, b" ,,aaaadmmmnpppsss\x00") 31 self.assertEqual(chars.raw, b" ,,aaaadmmmnpppsss\x00")
32 32
33 if __name__ == "__main__": 33 if __name__ == "__main__":
34 unittest.main() 34 unittest.main()
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+