[gobject-introspection] remove the flat struct array test and replace with object pointer array test



commit dead144faeeef4c0cd547ca287ede994745dbe7d
Author: John (J5) Palmieri <johnp redhat com>
Date:   Sat Aug 13 09:18:18 2011 -0400

    remove the flat struct array test and replace with object pointer array test

 tests/gimarshallingtests.c |   22 ----------------------
 tests/scanner/regress.c    |   15 +++++++++++++++
 tests/scanner/regress.h    |    2 ++
 3 files changed, 17 insertions(+), 22 deletions(-)
---
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index 814a6c2..10330b9 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -1180,28 +1180,6 @@ gi_marshalling_tests_array_fixed_out (gint **ints)
 }
 
 /**
- * gi_marshalling_tests_array_fixed_out_struct:
- * @structs: (out) (array fixed-size=2) (transfer none):
- */
-void
-gi_marshalling_tests_array_fixed_out_struct (GIMarshallingTestsSimpleStruct **structs)
-{
-    static GIMarshallingTestsSimpleStruct *values;
-
-    if (values == NULL) {
-        values = g_new(GIMarshallingTestsSimpleStruct, 2);
-
-        values[0].long_ = 7;
-        values[0].int8 = 6;
-
-        values[1].long_ = 6;
-        values[1].int8 = 7;
-    }
-
-    *structs = values;
-}
-
-/**
  * gi_marshalling_tests_array_fixed_inout:
  * @ints: (inout) (array fixed-size=4) (transfer none):
  */
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index 86927a0..13db3a7 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -2308,6 +2308,21 @@ regress_test_obj_null_out (RegressTestObj **obj)
     *obj = NULL;
 }
 
+/**
+ * regress_test_array_fixed_out_objects:
+ * @objs: (out) (array fixed-size=2) (transfer full): An array of #RegressTestObj
+ */
+void
+regress_test_array_fixed_out_objects (RegressTestObj ***objs)
+{
+    RegressTestObj **values = g_new(gpointer, 2);
+
+    values[0] = regress_constructor();
+    values[1] = regress_constructor();
+
+    *objs = values;
+}
+
 typedef struct _CallbackInfo CallbackInfo;
 
 struct _CallbackInfo
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index 7b8d9de..4c74e09 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -341,6 +341,8 @@ int        regress_test_obj_instance_method (RegressTestObj *obj);
 double     regress_test_obj_static_method (int x);
 void       regress_forced_method (RegressTestObj *obj);
 
+void regress_test_array_fixed_out_objects (RegressTestObj ***objs);
+
 void regress_test_obj_torture_signature_0 (RegressTestObj    *obj,
                                    int        x,
                                    double     *y,



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