[vala/0.34] tests: Add "use_string_marshalling = true" dbus-test
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.34] tests: Add "use_string_marshalling = true" dbus-test
- Date: Mon, 6 Mar 2017 14:43:38 +0000 (UTC)
commit ae5bd0dda776794e72821083bca4c344c7eeedf2
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 4241a0f..c69dd70 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -216,6 +216,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]