+
+AT_SETUP([private data members])
+
+AT_DATA([test.gob], [[%ctop{
+#include <config.h>
+%}
+class :Test from G:Object
+{
+ private int x = 42;
+
+ public int get_x(G:Object *go) { return TEST(go)->_priv->x; }
+ public void set_x(G:Object *go, int val) { TEST(go)->_priv->x = val; }
+}
+]])
+AT_CHECK([gob2 test.gob])
+AT_CHECK([$HAVE_GOBJECT_PRIVATES || exit 77])
+TEST_COMPILE_GOBJECT([test.c], [0], [], [ignore])
+
+AT_DATA([main.c], [[#include <config.h>
+#include <stdio.h>
+#include "test.h"
+
+int main(void)
+{
+ GObject *go = g_object_new(test_get_type(), NULL);
+
+ printf("%d\n", test_get_x(go));
+ printf("%d\n", (test_set_x(go, 123), test_get_x(go)));
+
+ return 0;
+}
+]])
+TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
+
+AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
+ test.o main.o])
+AT_CHECK([./main], [0], [42
+123
+])
+
+AT_CLEANUP
+
+AT_SETUP([private data members (dynamic)])
+
+AT_DATA([test.gob], [[%ctop{
+#include <config.h>
+%}
+class :Test from G:Object (dynamic)
+{
+ private int x = 54;
+
+ public int get_x(G:Object *go) { return TEST(go)->_priv->x; }
+ public void set_x(G:Object *go, int val) { TEST(go)->_priv->x = val; }
+}
+]])
+AT_CHECK([gob2 test.gob])
+AT_CHECK([$HAVE_GOBJECT_PRIVATES || exit 77])
+TEST_COMPILE_GOBJECT([test.c], [0], [], [ignore])
+
+TEST_TYPE_MODULE([:Test])
+
+AT_DATA([main.c], [[#include <config.h>
+#include <stdio.h>
+#include "test.h"
+#include "test-mod.h"
+
+int main(void)
+{
+ GObject *go;
+
+ g_type_module_use(g_object_new(test_mod_get_type(), NULL));
+ go = g_object_new(test_get_type(), NULL);
+
+ printf("%d\n", test_get_x(go));
+ printf("%d\n", (test_set_x(go, 123), test_get_x(go)));
+
+ return 0;
+}
+]])
+TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
+
+AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
+ test.o test-mod.o main.o])
+AT_CHECK([./main], [0], [54
+123
+])
+
+AT_CLEANUP