Lines Matching refs:test_attribute

80 def test_attribute(ob, attr_name, expected_init, new_value, new_value_really = None):
94 test_attribute(ob, attr_name, expected_init, "normal value")
100 test_attribute(ob, attr_name, expected_init, val, expected)
101 test_attribute(ob, attr_name, expected_init, "")
102 test_attribute(ob, attr_name, expected_init, really_big_string)
103 test_attribute(ob, attr_name, expected_init, u"normal unicode value")
109 test_attribute(ob, attr_name, expected_init, val, expected)
110 test_attribute(ob, attr_name, expected_init, u"")
111 test_attribute(ob, attr_name, expected_init, really_big_wstring)
113 test_attribute(ob, attr_name, expected_init, extended_unicode_string)
151 test_attribute(c, "boolean_value", 1, 0)
152 test_attribute(c, "boolean_value", 1, -1, 1) # Set a bool to anything, you should always get back 0 or 1
153 test_attribute(c, "boolean_value", 1, 4, 1) # Set a bool to anything, you should always get back 0 or 1
154 test_attribute(c, "boolean_value", 1, "1", 1) # This works by virtual of PyNumber_Int - not sure I agree, but...
158 test_attribute(c, "octet_value", 2, 5)
159 test_attribute(c, "octet_value", 2, 0)
160 test_attribute(c, "octet_value", 2, 128) # octet is unsigned 8 bit
161 test_attribute(c, "octet_value", 2, 255) # octet is unsigned 8 bit
162 test_attribute(c, "octet_value", 2, -1, 255) # octet is unsigned 8 bit
165 test_attribute(c, "short_value", 3, 10)
166 test_attribute(c, "short_value", 3, -1) # 16 bit signed
167 test_attribute(c, "short_value", 3, 0xFFFF, -1) # 16 bit signed
168 test_attribute(c, "short_value", 3, 0L)
169 test_attribute(c, "short_value", 3, 1L)
170 test_attribute(c, "short_value", 3, -1L)
171 test_attribute(c, "short_value", 3, 0xFFFFL, -1)
174 test_attribute(c, "ushort_value", 4, 5)
175 test_attribute(c, "ushort_value", 4, 0)
176 test_attribute(c, "ushort_value", 4, -1, 0xFFFF) # 16 bit signed
177 test_attribute(c, "ushort_value", 4, 0xFFFF) # 16 bit signed
178 test_attribute(c, "ushort_value", 4, 0L)
179 test_attribute(c, "ushort_value", 4, 1L)
180 test_attribute(c, "ushort_value", 4, -1L, 0xFFFF)
183 test_attribute(c, "long_value", 5, 7)
184 test_attribute(c, "long_value", 5, 0)
185 test_attribute(c, "long_value", 5, -1, -1) # 32 bit signed.
186 test_attribute(c, "long_value", 5, -1) # 32 bit signed.
187 test_attribute(c, "long_value", 5, 0L)
188 test_attribute(c, "long_value", 5, 1L)
189 test_attribute(c, "long_value", 5, -1L)
193 test_attribute(c, "ulong_value", 6, 7)
194 test_attribute(c, "ulong_value", 6, 0)
195 test_attribute(c, "ulong_value", 6, -1) # 32 bit signed.
198 test_attribute(c, "long_long_value", 7, 8)
199 test_attribute(c, "long_long_value", 7, 0)
200 test_attribute(c, "long_long_value", 7, -1)
201 test_attribute(c, "long_long_value", 7, 0xFFFF)
202 test_attribute(c, "long_long_value", 7, 0xFFFFL * 2)
206 test_attribute(c, "ulong_long_value", 8, 9)
207 test_attribute(c, "ulong_long_value", 8, 0)
211 test_attribute(c, "float_value", 9.0, 10.2)
212 test_attribute(c, "float_value", 9.0, 0)
213 test_attribute(c, "float_value", 9.0, -1)
214 test_attribute(c, "float_value", 9.0, 1L)
217 test_attribute(c, "double_value", 10.0, 9.0)
218 test_attribute(c, "double_value", 10.0, 0)
219 test_attribute(c, "double_value", 10.0, -1)
220 test_attribute(c, "double_value", 10.0, 1L)
223 test_attribute(c, "char_value", "a", "b")
224 test_attribute(c, "char_value", "a", "\0")
226 test_attribute(c, "char_value", "a", u"c")
227 test_attribute(c, "char_value", "a", u"\0")
230 test_attribute(c, "wchar_value", "b", "a")
231 test_attribute(c, "wchar_value", "b", "\0")
233 test_attribute(c, "wchar_value", "b", u"a")
234 test_attribute(c, "wchar_value", "b", u"\0")
244 test_attribute(c, "utf8string_value", "utf8string", extended_unicode_string.encode("utf8"), extended_unicode_string)
253 test_attribute(c, "iid_value", component_iid, new_iid)
254 test_attribute(c, "iid_value", component_iid, str(new_iid), new_iid)
255 test_attribute(c, "iid_value", component_iid, xpcom._xpcom.IID(new_iid))
259 test_attribute(c, "interface_value", None, c)
262 test_attribute(c, "isupports_value", None, c)
436 test_attribute(c, "domstring_value", "dom", "new dom")