]> 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>
Thu, 2 Jul 2020 12:03:43 +0000 (14:03 +0200)
See https://gitlab.gnome.org/GNOME/vala/issues/942

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

index e87d8c909e0da4ff4d034f1bb7139e4f04bb848f..d2b8c55f8ae702f7e8d5b8ab3851d448ca445112 100644 (file)
@@ -164,7 +164,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;
@@ -178,7 +178,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);
        }
 }