summaryrefslogtreecommitdiff
path: root/tests/regressextra.c
diff options
context:
space:
mode:
authorMikhail Fludkov <fludkov.me@gmail.com>2018-02-06 15:24:17 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-02-08 09:11:11 +0100
commit024ac583538976330b429b9b203d412fec0426e3 (patch)
treee4f3bd4e216ec73ae4f5699e118466ce330b3ad5 /tests/regressextra.c
parentee79fef18748ad660d3a0471ed9a18ea11410849 (diff)
downloadpygobject-024ac583538976330b429b9b203d412fec0426e3.tar.gz
tests: test_boxed_c_wrapper failing tests
Introduced here 1ec8d58
Diffstat (limited to 'tests/regressextra.c')
-rw-r--r--tests/regressextra.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/regressextra.c b/tests/regressextra.c
new file mode 100644
index 00000000..4df4eddc
--- /dev/null
+++ b/tests/regressextra.c
@@ -0,0 +1,51 @@
+#include "regress.h"
+#include "regressextra.h"
+
+#include <glib-object.h>
+
+struct _RegressTestBoxedCWrapper
+{
+ RegressTestBoxedC * cptr;
+};
+
+RegressTestBoxedCWrapper *
+regress_test_boxed_c_wrapper_new (void)
+{
+ RegressTestBoxedCWrapper *boxed;
+ boxed = g_slice_new (RegressTestBoxedCWrapper);
+ boxed->cptr = regress_test_boxed_c_new ();
+ return boxed;
+}
+
+RegressTestBoxedCWrapper *
+regress_test_boxed_c_wrapper_copy (RegressTestBoxedCWrapper *self)
+{
+ RegressTestBoxedCWrapper *ret_boxed;
+ ret_boxed = g_slice_new (RegressTestBoxedCWrapper);
+ ret_boxed->cptr = g_boxed_copy (regress_test_boxed_c_get_type(), self->cptr);
+ return ret_boxed;
+}
+
+static void
+regress_test_boxed_c_wrapper_free (RegressTestBoxedCWrapper *boxed)
+{
+ g_boxed_free (regress_test_boxed_c_get_type(), boxed->cptr);
+ g_slice_free (RegressTestBoxedCWrapper, boxed);
+}
+
+G_DEFINE_BOXED_TYPE(RegressTestBoxedCWrapper,
+ regress_test_boxed_c_wrapper,
+ regress_test_boxed_c_wrapper_copy,
+ regress_test_boxed_c_wrapper_free);
+
+/**
+ * regress_test_boxed_c_wrapper_get
+ * @self: a #RegressTestBoxedCWrapper objects
+ *
+ * Returns: (transfer none): associated #RegressTestBoxedC
+**/
+RegressTestBoxedC *
+regress_test_boxed_c_wrapper_get (RegressTestBoxedCWrapper *self)
+{
+ return self->cptr;
+}