From: Rico Tzschichholz Date: Thu, 15 Nov 2018 09:23:55 +0000 (+0100) Subject: tests: Add enum/errordomain tests for GIR parser to increase coverage X-Git-Tag: 0.43.1~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8332c09f3f01626df67c26fd89bb05d5937bb2b4;p=thirdparty%2Fvala.git tests: Add enum/errordomain tests for GIR parser to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 2ceb6cb1f..2044a7a0a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -421,6 +421,8 @@ TESTS = \ gir/class.test \ gir/delegate-alias-without-target.test \ gir/delegate-closure-destroy-index-conflict.test \ + gir/enum.test \ + gir/errordomain.test \ gir/parameter-nullable-out-simple-type.test \ gir/property-non-readable.test \ annotations/deprecated.vala \ diff --git a/tests/gir/enum.test b/tests/gir/enum.test new file mode 100644 index 000000000..251981a8b --- /dev/null +++ b/tests/gir/enum.test @@ -0,0 +1,81 @@ +GIR + +Input: + + + + + + + + + + + + + + + + + + + + + + + + + + +Output: + +[CCode (cheader_filename = "test.h", cname = "Test", cprefix = "TEST_", has_type_id = false)] +public enum Test { + BAR, + FOO +} +[CCode (cheader_filename = "test.h", cname = "TestFlag", cprefix = "TEST_FLAG_", has_type_id = false)] +[Flags] +public enum TestFlag { + BAR, + FOO +} +[CCode (cheader_filename = "test.h", cname = "TestFlagWithType", cprefix = "TEST_FLAG_WITH_TYPE_", type_id = "test_flag_with_type_get_type ()")] +[Flags] +public enum TestFlagWithType { + BAR, + FOO +} +[CCode (cheader_filename = "test.h", cname = "TestWithType", cprefix = "TEST_WITH_TYPE_", type_id = "test_with_type_get_type ()")] +public enum TestWithType { + BAR, + FOO +} diff --git a/tests/gir/errordomain.test b/tests/gir/errordomain.test new file mode 100644 index 000000000..4ff318c79 --- /dev/null +++ b/tests/gir/errordomain.test @@ -0,0 +1,45 @@ +GIR + +Input: + + + + + + + + + + + + + + +Output: + +[CCode (cheader_filename = "test.h", cname = "TestError", cprefix = "TEST_ERROR_")] +public errordomain TestError { + BAR, + FOO +} +[CCode (cheader_filename = "test.h", cname = "TestErrorWithType", cprefix = "TEST_ERROR_WITH_TYPE_")] +public errordomain TestErrorWithType { + BAR, + FOO +}