X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/e0a8c2a5c8250c7d906532c2d510c8d330125387..0c92ab0b40d0c819fe88edd88db5dbf4f609d6da:/t/test-fooable.c diff --git a/t/test-fooable.c b/t/test-fooable.c new file mode 100644 index 0000000..d4b2d30 --- /dev/null +++ b/t/test-fooable.c @@ -0,0 +1,38 @@ +/* + * Copyright © 2020 Nick Bowler + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "test-fooable.h" + +GType test_fooable_get_type(void) +{ + static const GTypeInfo info = { sizeof (TestFooableIface), 0, 0 }; + static GType type = 0; + + if (!type) { + type = g_type_register_static(G_TYPE_INTERFACE, + "TestFooable", &info, 0); + } + + return type; +} + +int test_foo(GObject *go) +{ + g_return_val_if_fail(TEST_IS_FOOABLE(go), -1); + + return TEST_FOOABLE_GET_INTERFACE(go)->foo(go); +}