[vala] tests: Null-terminate arrays for compatibility test of uint8 and uchar



commit cd6ed679b62aacc427882f028c4c8c795d279610
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Jun 17 12:59:12 2019 +0200

    tests: Null-terminate arrays for compatibility test of uint8 and uchar
    
    Fixes https://gitlab.gnome.org/GNOME/vala/issues/809

 tests/basic-types/array-uint8-uchar-compat.vala | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/tests/basic-types/array-uint8-uchar-compat.vala b/tests/basic-types/array-uint8-uchar-compat.vala
index 91ac3751d..352be9a98 100644
--- a/tests/basic-types/array-uint8-uchar-compat.vala
+++ b/tests/basic-types/array-uint8-uchar-compat.vala
@@ -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);


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