summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@async.com.br>2009-01-22 00:02:49 +0000
committerJohan Dahlin <johan@src.gnome.org>2009-01-22 00:02:49 +0000
commitf90b158f0563a23213678c8dabfbccc08aaa5fb5 (patch)
tree2c007c16f144af672e3e49b7f19f02fe8c9f9454 /tests
parent4aa4dacaffe4ea0fe78ac97d0437d0563e12aacd (diff)
downloadgobject-introspection-f90b158f0563a23213678c8dabfbccc08aaa5fb5.tar.gz
Bug 562622 – Errordomains missing
2009-01-21 Johan Dahlin <jdahlin@async.com.br> Bug 562622 – Errordomains missing * giscanner/girwriter.py: * giscanner/glibast.py: * giscanner/glibtransformer.py: * tests/scanner/Makefile.am: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.c (foo_error_get_type), (foo_error_quark): * tests/scanner/foo.h: svn path=/trunk/; revision=1057
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/Makefile.am11
-rw-r--r--tests/scanner/foo-1.0-expected.gir18
-rw-r--r--tests/scanner/foo-1.0-expected.tgir5
-rw-r--r--tests/scanner/foo.c22
-rw-r--r--tests/scanner/foo.h9
5 files changed, 61 insertions, 4 deletions
diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am
index 36fb772b..bc291b81 100644
--- a/tests/scanner/Makefile.am
+++ b/tests/scanner/Makefile.am
@@ -34,8 +34,8 @@ EXPECTEDGIRS = $(GIRS:.gir=-expected.gir)
TGIRS = $(GIRS:.gir=.tgir)
CHECKTGIRS = $(GIRS:.gir=.tgir.check)
EXPECTEDTGIRS = $(GIRS:.gir=-expected.tgir)
-CLEANFILES = $(TYPELIBS) $(GIRS) $(TGIRS)
-BUILT_SOURCES = $(TYPELIBS) $(GIRS)
+CLEANFILES = $(TYPELIBS) $(GIRS)
+BUILT_SOURCES = $(TYPELIBS) $(GIRS) $(TGIRS)
EXTRA_DIST = $(EXPECTEDGIRS) $(EXPECTEDTGIRS)
annotation-1.0.gir: libannotation.la annotation.c annotation.h utility-1.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
@@ -149,10 +149,13 @@ post-check:
$(DEBUG) $(top_builddir)/tools/g-ir-generate --includedir=. --includedir=$(top_builddir)/gir $< -o $@
%.tgir.check: %.tgir
- @diff -u -U 10 $(srcdir)/$*-expected.tgir $*.tgir && echo "* $*.tgir"
+ @diff -u -U 10 $(srcdir)/$*-expected.tgir $*.tgir; \
+ if test "$$?" = "0"; then \
+ echo "* $*.tgir"; \
+ rm -f $*.tgir; \
+ fi
check-local: pre-check
check-local: $(CHECKGIRS) $(CHECKTGIRS) $(TYPELIBS)
-CLEANFILES += $(TGIRS)
check-local: post-check
diff --git a/tests/scanner/foo-1.0-expected.gir b/tests/scanner/foo-1.0-expected.gir
index 11a3b4e0..d826a5d4 100644
--- a/tests/scanner/foo-1.0-expected.gir
+++ b/tests/scanner/foo-1.0-expected.gir
@@ -617,6 +617,24 @@ and/or use gtk-doc annotations. -->
</parameter>
</parameters>
</function>
+ <enumeration name="Error"
+ glib:type-name="FooError"
+ glib:get-type="foo_error_get_type"
+ c:type="FooError"
+ glib:error-quark="foo_error_quark">
+ <member name="good"
+ value="0"
+ c:identifier="FOO_ERROR_GOOD"
+ glib:nick="good"/>
+ <member name="bad"
+ value="1"
+ c:identifier="FOO_ERROR_BAD"
+ glib:nick="bad"/>
+ <member name="ugly"
+ value="2"
+ c:identifier="FOO_ERROR_UGLY"
+ glib:nick="ugly"/>
+ </enumeration>
<constant name="SUCCESS_INT" value="4408">
<type name="int"/>
</constant>
diff --git a/tests/scanner/foo-1.0-expected.tgir b/tests/scanner/foo-1.0-expected.tgir
index 59549192..614f6f84 100644
--- a/tests/scanner/foo-1.0-expected.tgir
+++ b/tests/scanner/foo-1.0-expected.tgir
@@ -485,6 +485,11 @@
</parameter>
</parameters>
</function>
+ <enumeration name="Error" glib:type-name="FooError" glib:get-type="foo_error_get_type">
+ <member name="good" value="0"/>
+ <member name="bad" value="1"/>
+ <member name="ugly" value="2"/>
+ </enumeration>
<constant name="SUCCESS_INT" value="4408">
<type name="int"/>
</constant>
diff --git a/tests/scanner/foo.c b/tests/scanner/foo.c
index 50b78c20..ea55e9d8 100644
--- a/tests/scanner/foo.c
+++ b/tests/scanner/foo.c
@@ -433,3 +433,25 @@ foo_hidden_get_type (void)
return our_type;
}
+GType
+foo_error_get_type (void)
+{
+ static GType etype = 0;
+ if (G_UNLIKELY(etype == 0)) {
+ static const GEnumValue values[] = {
+ { FOO_ERROR_GOOD, "FOO_ERROR_GOOD", "good" },
+ { FOO_ERROR_BAD, "FOO_ERROR_BAD", "bad" },
+ { FOO_ERROR_UGLY, "FOO_ERROR_UGLY", "ugly" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static (g_intern_static_string ("FooError"), values);
+ }
+ return etype;
+}
+
+GQuark
+foo_error_quark (void)
+{
+ return g_quark_from_static_string ("foo-error-quark");
+}
+
diff --git a/tests/scanner/foo.h b/tests/scanner/foo.h
index f08fc3c7..b3614f35 100644
--- a/tests/scanner/foo.h
+++ b/tests/scanner/foo.h
@@ -293,4 +293,13 @@ const FooStruct * foo_test_const_struct_retval (void);
void foo_test_const_char_param (const char * param);
void foo_test_const_struct_param (const FooStruct * param);
+typedef enum {
+ FOO_ERROR_GOOD,
+ FOO_ERROR_BAD,
+ FOO_ERROR_UGLY
+} FooError;
+GType foo_error_get_type (void);
+
+GQuark foo_error_quark (void);
+
#endif /* __FOO_OBJECT_H__ */