]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Don't use invalid syntax to declare local variable with array type
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 2 Jul 2020 11:11:52 +0000 (13:11 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 26 Jul 2020 08:37:21 +0000 (10:37 +0200)
See https://gitlab.gnome.org/GNOME/vala/issues/942

tests/basic-types/arrays.vala
tests/objects/bug778632.vala

index f4777a7a7b7f725f6be2b7372b41474133f36508..5d2bea15fc9a27760bbff45fdea912eb524f7770 100644 (file)
@@ -148,7 +148,7 @@ int[,,] nd_array_pass (int[,,] a, out int[,,] b) {
 }
 
 void test_nd_array () {
-       int[2,2,2] a = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}};
+       int[,,] a = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}};
        assert (a[1,0,1] == 6);
 
        int[,,] b, c;
@@ -162,7 +162,7 @@ void test_nd_array () {
        assert (c.length[2] == 2);
        assert (c[0,1,1] == 4);
 
-       string[1,2,3] s = {{{"a", "b", "c"}, {"d", "e", "f"}}};
+       string[,,] s = {{{"a", "b", "c"}, {"d", "e", "f"}}};
        assert (s[0,0,2] == "c");
 }
 
index cd788016819b86a177b359d2b336e7b2843f4f6c..e4c91ad51640efc93eba1e18e52f0ad616264b76 100644 (file)
@@ -2,7 +2,7 @@ class Foo : Object {
        public signal void bar (int[,,] a);
 
        public void bar_emit () {
-               int[2,3,2] a = {{{1, 2}, {3, 4}, {5, 6}}, {{7, 8}, {9, 10}, {11, 12}}};
+               int[,,] a = {{{1, 2}, {3, 4}, {5, 6}}, {{7, 8}, {9, 10}, {11, 12}}};
                bar (a);
        }
 }