X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/6bec6738ec9d978036dcc64a7008c86b95bed5c0..9e15b38133dbce39d340806433ea84f995753717:/tests/interface.at diff --git a/tests/interface.at b/tests/interface.at index 9c368b6..3307c3d 100644 --- a/tests/interface.at +++ b/tests/interface.at @@ -3,31 +3,6 @@ dnl License GPLv2+: GNU General Public License version 2 or any later version. dnl This is free software: you are free to change and redistribute it. dnl There is NO WARRANTY, to the extent permitted by law. -dnl TEST_TYPE_MODULE(Class:Name) -dnl Create a GTypeModule (Class:Name:Mod) which registers the dynamic -dnl type indiciated by Class:Name. -m4_define([TEST_TYPE_MODULE], -[TEST_TYPE_MODULE_([$1], m4_translit([[$1]], [:A-Z], [_a-z]), - m4_translit([[$1]], [:A-Z], [-a-z]))]) - -m4_define([TEST_TYPE_MODULE_], -[AT_KEYWORDS([dynamic])dnl - -AT_DATA([$3-mod.gob], [[%{ -#include "$3.h" -%} -class $1:Mod from G:Type:Module -{ - override (G:Type:Module) gboolean load(G:Type:Module *m) - { - $2_register_type(m); - return TRUE; - } -} -]]) -AT_CHECK([gob2 $3-mod.gob]) -TEST_COMPILE_GOBJECT([$3-mod.c], [0], [], [ignore])]) - dnl Create the Test:Fooable interface with the following interface method: dnl dnl int foo(G:Object *obj); @@ -41,8 +16,8 @@ TEST_COMPILE_GOBJECT([test-fooable.c], [0], [], [ignore])]) dnl TEST_FOOABLE_IMPL(Class:Name, Parent:Class, foo_body) dnl TEST_FOOABLE_IMPL_DYN(Class:Name, Parent:Class, foo_body) m4_define([TEST_FOOABLE_IMPL], - [TEST_FOOABLE_IMPL_([$1], m4_translit([[$1]], [:A-Z], [-a-z]), - [$2], m4_translit([[$2]], [:A-Z], [-a-z]), + [TEST_FOOABLE_IMPL_([$1], TEST_CLASSNAME_REPLACE_SEP([$1], [-]), + [$2], TEST_CLASSNAME_REPLACE_SEP([$2], [-]), [$3], [$4])]) m4_define([TEST_FOOABLE_IMPL_DYN], @@ -50,7 +25,10 @@ m4_define([TEST_FOOABLE_IMPL_DYN], TEST_TYPE_MODULE([$1])]) m4_define([TEST_FOOABLE_IMPL_], -[AT_DATA([$2.gob], [[%{ +[AT_DATA([$2.gob], [[%ctop{ +#include +%} +%{ #include #include #include "test-fooable.h" @@ -83,7 +61,8 @@ TEST_FOOABLE_IFACE() TEST_FOOABLE_IMPL([Test:A], [G:Object], [return 42;]) AT_DATA([main.c], -[[#include +[[#include +#include #include #include "test-fooable.h" #include "test-a.h" @@ -116,7 +95,8 @@ TEST_FOOABLE_IFACE() TEST_FOOABLE_IMPL_DYN([Test:A], [G:Object], [return 54;]) AT_DATA([main.c], -[[#include +[[#include +#include #include #include "test-fooable.h" #include "test-a.h" @@ -156,7 +136,8 @@ TEST_FOOABLE_IMPL([Test:B], [Test:A], [puts("Test:B foo called"); return 54;]) AT_DATA([main.c], -[[#include +[[#include +#include #include #include "test-fooable.h" #include "test-a.h" @@ -203,7 +184,8 @@ TEST_FOOABLE_IMPL_DYN([Test:B], [Test:A], [puts("Test:B foo called"); return 54;]) AT_DATA([main.c], -[[#include +[[#include +#include #include #include "test-fooable.h" #include "test-a.h" @@ -254,7 +236,8 @@ TEST_FOOABLE_IMPL_DYN([Test:B], [Test:A], [puts("Test:B foo called"); return 54;]) AT_DATA([main.c], -[[#include +[[#include +#include #include #include "test-fooable.h" #include "test-a.h" @@ -307,7 +290,8 @@ TEST_FOOABLE_IMPL([Test:C], [Test:B], [puts("Test:C foo called"); return PARENT_HANDLER(go);]) AT_DATA([main.c], -[[#include +[[#include +#include #include #include "test-fooable.h" #include "test-a.h" @@ -351,7 +335,8 @@ TEST_FOOABLE_IMPL_DYN([Test:C], [Test:B], [puts("Test:C foo called"); return PARENT_HANDLER(go);]) AT_DATA([main.c], -[[#include +[[#include +#include #include #include "test-fooable.h" #include "test-a.h"