[vala/staging: 3/7] tests: Add "use_string_marshalling = true" dbus-test



commit ac59d16159affbb6946e4f2b05570408095a17c5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 6 13:16:45 2017 +0100

    tests: Add "use_string_marshalling = true" dbus-test
    
    Commit 09e6818d01e introduced the possibility of inserting _error
    labels at the end of functions, which make C compilers angry.
    This "test" (no actual tests are run, just compile correctness is
    checked here) triggers some of these situations.
    
    the "test3" abstract method is trickier though, it doesn't warn
    but produces code with early returns, which in practice means
    possible leaks.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778540

 tests/Makefile.am                       |    1 +
 tests/dbus/enum-string-marshalling.vala |   16 ++++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 67baf08..cd9f569 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -258,6 +258,7 @@ TESTS = \
        dbus/errors.test \
        dbus/async.test \
        dbus/async-errors.test \
+       dbus/enum-string-marshalling.vala \
        dbus/signals.test \
        dbus/filedescriptor.test \
        dbus/filedescriptor-errors.test \
diff --git a/tests/dbus/enum-string-marshalling.vala b/tests/dbus/enum-string-marshalling.vala
new file mode 100644
index 0000000..14942a3
--- /dev/null
+++ b/tests/dbus/enum-string-marshalling.vala
@@ -0,0 +1,16 @@
+[DBus (use_string_marshalling = true)]
+public enum FooEnum {
+       BAR
+}
+
+[DBus (name = "org.example.Test")]
+public interface Test : GLib.Object {
+       public abstract async void test1 (FooEnum e) throws DBusError;
+       public abstract void test2 (FooEnum e) throws DBusError;
+       public abstract void test3 (FooEnum e1, UnixOutputStream output_stream, FooEnum e2) throws DBusError;
+       //FIXME public abstract void test4 (FooEnum e);
+}
+
+void main () {
+       // We just want to ensure compile correctness here
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]