[glib] tests: Don't assume that private data follows the instance data



commit edcabe1a4e55b3b541c2e0afcece3ba175b67dba
Author: Emanuele Aina <emanuele aina collabora com>
Date:   Tue May 28 22:45:03 2013 +0200

    tests: Don't assume that private data follows the instance data
    
    Commit 31fde56 changed the way the private data is laid out in memory by
    putting it *before* the instance data to keep the offsets fixed
    regardless of the number of many subclasses.
    
    This means that the invariant testgobject was verifying is no longer
    true and the failing tests can be safely dropped.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701156

 tests/gobject/testgobject.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
---
diff --git a/tests/gobject/testgobject.c b/tests/gobject/testgobject.c
index 9302278..391e018 100644
--- a/tests/gobject/testgobject.c
+++ b/tests/gobject/testgobject.c
@@ -206,7 +206,6 @@ test_object_init (TestObject *tobject)
   priv = TEST_OBJECT_GET_PRIVATE (tobject);
 
   g_assert (priv);
-  g_assert ((gchar *)priv >= (gchar *)tobject + sizeof (TestObject));
 
   priv->dummy1 = 54321;
 }
@@ -359,12 +358,10 @@ derived_object_init (DerivedObject *dobject)
   derived_priv = DERIVED_OBJECT_GET_PRIVATE (dobject);
 
   g_assert (derived_priv);
-  g_assert ((gchar *)derived_priv >= (gchar *)TEST_OBJECT_GET_PRIVATE (dobject) + sizeof 
(TestObjectPrivate));
 
   test_priv = TEST_OBJECT_GET_PRIVATE (dobject);
   
   g_assert (test_priv);
-  g_assert ((gchar *)test_priv >= (gchar *)dobject + sizeof (TestObject));
 
 }
 


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