From eff666b4d337e7d91b31462c48d438db2c7170ce Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Mon, 10 Aug 2020 11:56:47 +0200 Subject: [PATCH] tests: Add "constant and union" gir test to increase coverage --- tests/Makefile.am | 2 ++ tests/gir/constant.test | 22 ++++++++++++++++++++++ tests/gir/union.test | 20 ++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 tests/gir/constant.test create mode 100644 tests/gir/union.test diff --git a/tests/Makefile.am b/tests/Makefile.am index e1bfc0625..c2505dcba 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -647,6 +647,7 @@ TESTS = \ gir/async-result-pos.test \ gir/async-sync-out.test \ gir/class.test \ + gir/constant.test \ gir/delegate-alias-without-target.test \ gir/delegate-array-length-type.test \ gir/delegate-closure-destroy-index-conflict.test \ @@ -659,6 +660,7 @@ TESTS = \ gir/parameter-nullable-out-simple-type.test \ gir/property-non-readable.test \ gir/symbol-type-csuffix.test \ + gir/union.test \ annotations/deprecated.vala \ annotations/description.vala \ annotations/noaccessormethod.test \ diff --git a/tests/gir/constant.test b/tests/gir/constant.test new file mode 100644 index 000000000..196ae7577 --- /dev/null +++ b/tests/gir/constant.test @@ -0,0 +1,22 @@ +GIR + +Input: + + + + + + + + + + +Output: + +[CCode (cheader_filename = "test.h", cname = "TEST_FOO_CONSTANT")] +public const string FOO_CONSTANT; +[CCode (array_length = false, array_null_terminated = true, cheader_filename = "test.h", cname = "TEST_FOO_CONSTANT_ARRAY")] +public const string[] FOO_CONSTANT_ARRAY; diff --git a/tests/gir/union.test b/tests/gir/union.test new file mode 100644 index 000000000..51f118aa5 --- /dev/null +++ b/tests/gir/union.test @@ -0,0 +1,20 @@ +GIR + +Input: + + + + + + + + + + +Output: + +[CCode (cheader_filename = "test.h")] +public struct Foo { + public uint bar; + public int manam; +} -- 2.47.2