GNOME Bugzilla – Bug 627878
tests: Port to new introspection tests
Last modified: 2010-09-03 16:30:06 UTC
Everything is renamed "Regress", and both it and GIMarshallingTests are now in source form, so we compile them. The scanner now adds "static methods" to objects, structs, and unions, so update the test code to use those. In the tests, remove broken (inout) cases - the person writing these tests misunderstood the semantics of (inout). It's not acceptable for a C API to mutate e.g. a GSList* passed in, or unref an object. The invocation code needed to be updated for this - remove some broken hacks.
Created attachment 168675 [details] [review] tests: Port to new introspection tests
Comment on attachment 168675 [details] [review] tests: Port to new introspection tests Looks good, test pass. Feel free to commit once the gobject-introspect branch gets merged into master (using commit_after_freeze to denote this)
Created attachment 169135 [details] [review] remove reliance on _PyUnicode_AsString * _PyUnicode_AsString dumps the internal buffer of a PyUnicode object which is not garunteed to hold any values (it is a cache) * there is a reason why the method is prefixed with an underscore which marks it as internal * since unicode objects need to be converted to byte strings in order to get their underlying byte arrays we need to handle errors that might happen during the conversion process * because of the conversions process there is no easy way to map Python 2.x string method "AsString" to Python 3.x unicode methods so we must handle it with ifdefs
Comment on attachment 169135 [details] [review] remove reliance on _PyUnicode_AsString Did you mean to attach this patch here? Doesn't seem to have to do with this bug.
Pushed to master.
Created attachment 169440 [details] [review] use PyObject_SetAttrString, not PyDict_SetItemString when setting __gtype__ * When registering a gtype wrapper we used to set tp_dict directly. This works in python 2 but python 3 seems to handle attributes in a slightly different way where the tp_dict and attr get out of sync. By setting the attr directly we avoid this issue. * Note that there are many more places where we set __gtype__ using tp_dict however for objects which are not instantiated yet we have to set tp_dict directly. * Since this one change fixes a lot of failed tests, for now we ignore the other places where we set __gtype__. If we run into more issues dealing with __gtype__ we can take a closer look later.
doh, wrong bug # when using git-bz to push patches. That teaches me to rely on shell history.