Commit a3a35f91 authored by Stefan Behnel's avatar Stefan Behnel

fix char* coercion test

parent 3215d750
......@@ -22,13 +22,13 @@ def const_charptrs():
my_st = st
assert typeof(my_st) == "const_char *", typeof(my_st)
obj = my_st
assert obj == b'XYZ'
assert obj == b'XYZ', obj
assert typeof(ust) == "const_uchar *", typeof(ust)
my_ust = ust
assert typeof(my_ust) == "const_uchar *", typeof(my_ust)
obj = my_ust
assert obj == b'XYZ'
assert obj == b'XYZ', obj
ctypedef char mychar
ctypedef unsigned char myuchar
......@@ -41,17 +41,18 @@ def const_char_arrays():
cdef object obj
cdef mychar[4] st
cdef myuchar[4] ust
cdef char ch
i = 0
for ch in <char*>b'XYZ\0':
for ch in b'XYZ\0':
st[i] = ch
ust[i] = ch
ust[i] = <unsigned char>ch
i += 1
assert typeof(st) == "mychar [4]", typeof(st)
obj = st
assert obj == b'XYZ'
assert obj == b'XYZ', obj
assert typeof(ust) == "myuchar [4]", typeof(ust)
obj = ust
assert obj == b'XYZ'
assert obj == b'XYZ', obj
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment