]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Null-terminate arrays for compatibility test of uint8 and uchar
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 17 Jun 2019 10:59:12 +0000 (12:59 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 6 Aug 2019 11:51:08 +0000 (13:51 +0200)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/809

tests/basic-types/array-uint8-uchar-compat.vala

index 91ac3751d4ddf00b7414265b32dc91a5c2208196..352be9a98b37799dab2532c21bac6c8ea9e40fbb 100644 (file)
@@ -27,8 +27,8 @@ void change_buffer2 ([CCode (array_length = false)] uchar[] data) {
 
 void main () {
        {
-               data = { 'f', 'o', 'o', '\n' };
-               data2 = { 102, 111, 111, 10 };
+               data = { 'f', 'o', 'o', '\n', '\0' };
+               data2 = { 102, 111, 111, 10, 0 };
                assert ("foo\n" == (string) data);
                change_buffer (get_buffer ());
                assert ("bar\n" == (string) data);
@@ -38,8 +38,8 @@ void main () {
        }
 
        {
-               data = { 'f', 'o', 'o', '\n' };
-               data2 = { 102, 111, 111, 10 };
+               data = { 'f', 'o', 'o', '\n', '\0' };
+               data2 = { 102, 111, 111, 10, 0 };
                assert ("foo\n" == (string) data2);
                change_buffer2 (get_buffer2 ());
                assert ("baz\n" == (string) data2);