@@ -73,17 +73,9 @@ class WNDCLASS(Structure):
7373
7474 WNDPROC_2 = WINFUNCTYPE (c_long , c_int , c_int , c_int , c_int )
7575
76- # This is no longer true, now that WINFUNCTYPE caches created types internally.
77- ## # CFuncPtr subclasses are compared by identity, so this raises a TypeError:
78- ## self.assertRaises(TypeError, setattr, wndclass,
79- ## "lpfnWndProc", WNDPROC_2(wndproc))
80- # instead:
81-
8276 self .assertIs (WNDPROC , WNDPROC_2 )
83- # 'wndclass.lpfnWndProc' leaks 94 references. Why?
8477 self .assertEqual (wndclass .lpfnWndProc (1 , 2 , 3 , 4 ), 10 )
8578
86-
8779 f = wndclass .lpfnWndProc
8880
8981 del wndclass
@@ -92,24 +84,14 @@ class WNDCLASS(Structure):
9284 self .assertEqual (f (10 , 11 , 12 , 13 ), 46 )
9385
9486 def test_dllfunctions (self ):
95-
96- def NoNullHandle (value ):
97- if not value :
98- raise ctypes .WinError ()
99- return value
100-
10187 strchr = lib .my_strchr
10288 strchr .restype = c_char_p
10389 strchr .argtypes = (c_char_p , c_char )
10490 self .assertEqual (strchr (b"abcdefghi" , b"b" ), b"bcdefghi" )
10591 self .assertEqual (strchr (b"abcdefghi" , b"x" ), None )
10692
107-
10893 strtok = lib .my_strtok
10994 strtok .restype = c_char_p
110- # Neither of this does work: strtok changes the buffer it is passed
111- ## strtok.argtypes = (c_char_p, c_char_p)
112- ## strtok.argtypes = (c_string, c_char_p)
11395
11496 def c_string (init ):
11597 size = len (init ) + 1
@@ -118,10 +100,6 @@ def c_string(init):
118100 s = b"a\n b\n c"
119101 b = c_string (s )
120102
121- ## b = (c_char * (len(s)+1))()
122- ## b.value = s
123-
124- ## b = c_string(s)
125103 self .assertEqual (strtok (b , b"\n " ), b"a" )
126104 self .assertEqual (strtok (None , b"\n " ), b"b" )
127105 self .assertEqual (strtok (None , b"\n " ), b"c" )
0 commit comments