]> git.draconx.ca Git - gob-dx.git/blobdiff - tests/general.at
Minor testsuite cleanup.
[gob-dx.git] / tests / general.at
index 97b59da387cfc43b50b2add4ce9e4377fcbbe574..6643d4d7b5642160b6385b49706eab440a157a7c 100644 (file)
@@ -115,31 +115,20 @@ class :Test from G:Object (dynamic)
   }
 }
 ]])
+AT_CHECK([gob2 test.gob])
+TEST_COMPILE_GOBJECT([test.c], [0], [], [ignore])
 
-AT_DATA([mod.gob],
-[[%{
-#include "test.h"
-%}
-class :Mod from G:Type:Module
-{
-  override (G:Type:Module) gboolean load(G:Type:Module *m)
-  {
-    test_register_type(m);
-    return TRUE;
-  }
-}
-]])
+TEST_TYPE_MODULE([:Test])
 
 AT_DATA([main.c],
 [[#include <stdlib.h>
-#include "mod.h"
 #include "test.h"
+#include "test-mod.h"
 
 void devnull(const char *a, GLogLevelFlags b, const char *c, gpointer d) { }
 
 int main(void)
 {
-  GTypeModule *m = g_object_new(mod_get_type(), NULL);
   guint handler;
   Test *t;
 
@@ -150,7 +139,9 @@ int main(void)
     return EXIT_FAILURE;
   g_log_remove_handler("GLib-GObject", handler);
 
-  g_type_module_use(m);
+  /* Register dynamic type */
+  g_type_module_use(g_object_new(test_mod_get_type(), NULL));
+
   /* should work now */
   t = g_object_new(test_get_type(), "s", "Hello, World", (char *)NULL);
   if (!t)
@@ -160,13 +151,10 @@ int main(void)
   return EXIT_SUCCESS;
 }
 ]])
-
-AT_CHECK([gob2 mod.gob])
-AT_CHECK([gob2 test.gob])
-TEST_COMPILE_GOBJECT([mod.c], [0], [], [ignore])
-TEST_COMPILE_GOBJECT([test.c], [0], [], [ignore])
 TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main mod.o test.o main.o])
+
+AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
+  test.o test-mod.o main.o])
 AT_CHECK([./main], [0], [Hello, World
 ])