[vala] Add test for bug 726347



commit 4e4974557378ba41dc00566149448b3e375b3a44
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Mar 16 11:35:19 2014 +0100

    Add test for bug 726347

 tests/Makefile.am            |    1 +
 tests/methods/bug726347.vala |   16 ++++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 77b2fa0..cbfd580 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -58,6 +58,7 @@ TESTS = \
        methods/bug663210.vala \
        methods/bug723009.vala \
        methods/bug723195.vala \
+       methods/bug726347.vala \
        methods/generics.vala \
        control-flow/break.vala \
        control-flow/expressions-conditional.vala \
diff --git a/tests/methods/bug726347.vala b/tests/methods/bug726347.vala
new file mode 100644
index 0000000..8a6cfb1
--- /dev/null
+++ b/tests/methods/bug726347.vala
@@ -0,0 +1,16 @@
+class Foo {
+       public int count_strings (...) {
+               var i = 0;
+               var args = va_list();
+               for (string? str = args.arg<string?>(); str != null; str = args.arg<string?>()) {
+                       i++;
+               }
+               return i;
+       }
+}
+
+void main() {
+       var foo = new Foo ();
+       int count = foo.count_strings ("foo", "bar", "baz");
+       assert (count == 3);
+}
\ No newline at end of file


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