]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "nested namespace" girwriter test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 10 Aug 2020 11:18:08 +0000 (13:18 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 10 Aug 2020 12:03:59 +0000 (14:03 +0200)
See https://gitlab.gnome.org/GNOME/vala/issues/1059

tests/girwriter/GirTest-1.0.gir-expected
tests/girwriter/girtest.vala
tests/girwriter/girtest.vapi-expected

index 0e499d9f1b708f2807da3d413b0e595577f0f4d7..673bc7003632c4b7980fdad9ddbfed78bb709bfe 100644 (file)
@@ -5,6 +5,11 @@
 <package name="girtest"/>
 <c:include name="girtest.h"/>
 <namespace name="GirTest" version="1.0" shared-library="girtest" c:prefix="GirTest" c:identifier-prefixes="GirTest" c:symbol-prefix="gir_test">
+       <function name="nested_function" c:identifier="gir_test_nested_function">
+               <return-value transfer-ownership="full">
+                       <type name="none" c:type="void"/>
+               </return-value>
+       </function>
        <enumeration name="EnumTest" c:type="GirTestEnumTest" glib:type-name="GirTestEnumTest" glib:get-type="gir_test_enum_test_get_type">
                <member name="value1" c:identifier="GIR_TEST_ENUM_TEST_VALUE1" value="0"/>
                <member name="value2" c:identifier="GIR_TEST_ENUM_TEST_VALUE2" value="1"/>
index 9aeeacc4ad5b29fc2a15d569f3e74473fd317fc7..bbe98ada596ca18581bd91efe9bd4962bd2e3a12 100644 (file)
@@ -319,6 +319,11 @@ namespace GirTest {
                public void method<K> (K[] param) {
                }
        }
+
+       namespace Nested {
+               public void function () {
+               }
+       }
 }
 
 public enum InvalidEnum {
index 23ca2a8bd67b57d7a62197d011eafa38cce9d785..9e1f2ee66c50752d3b1f22f117d08f318565d17a 100644 (file)
@@ -1,5 +1,9 @@
 [CCode (gir_namespace = "GirTest", gir_version = "1.0")]
 namespace GirTest {
+       namespace Nested {
+               [CCode (cheader_filename = "girtest.h")]
+               public static void function ();
+       }
        [CCode (cheader_filename = "girtest.h")]
        public abstract class AbstractObjectTest : GLib.Object {
                protected AbstractObjectTest ();