[pygobject] fix tests to correctly construct a dummy Gtk.TargetEntry



commit beea7072a5a989be47a755ac46647380d4dbd6b4
Author: John (J5) Palmieri <johnp redhat com>
Date:   Thu Sep 15 00:11:09 2011 -0400

    fix tests to correctly construct a dummy Gtk.TargetEntry
    
    * structs are sometimes a pain in gi.  Simply constructing them using the
       the standard constructor (e.g. Gtk.TargetEntry()) will malloc the struct
       but not correctly initialize the fields which can cause a crash.
     * tests didn't crash before because they were sending in bogus data that
       somehow did not trigger the issue
     * now with the C struct array marshallers doing the right thing, the incorrect
       use of TargetEntry was causing a crash
    
    https://bugzilla.gnome.org/show_bug.cgi?id=627236

 tests/test_overrides.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 2f25121..8974273 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -1546,7 +1546,7 @@ class TestGtk(unittest.TestCase):
         widget.drag_dest_get_track_motion()
         widget.drag_dest_set_track_motion(True)
         widget.drag_dest_get_target_list()
-        widget.drag_dest_set_target_list(Gtk.TargetList.new([Gtk.TargetEntry()]))
+        widget.drag_dest_set_target_list(Gtk.TargetList.new([Gtk.TargetEntry.new('test',0, 0)]))
         widget.drag_dest_unset()
 
         widget.drag_highlight()
@@ -1561,7 +1561,7 @@ class TestGtk(unittest.TestCase):
         widget.drag_source_set_icon_pixbuf(GdkPixbuf.Pixbuf())
         widget.drag_source_set_icon_stock("")
         widget.drag_source_get_target_list()
-        widget.drag_source_set_target_list(Gtk.TargetList.new([Gtk.TargetEntry()]))
+        widget.drag_source_set_target_list(Gtk.TargetList.new([Gtk.TargetEntry.new('test', 0, 0)]))
         widget.drag_source_unset()
 
         # these methods cannot be called because they require a valid drag on



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]