[libsoup/libsoup-2-74] tests: Fix brotli test comparing non-NUL-terminated data as a string
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/libsoup-2-74] tests: Fix brotli test comparing non-NUL-terminated data as a string
- Date: Wed, 24 Nov 2021 20:32:54 +0000 (UTC)
commit 67ea293d2a80061f90c729e6f853bf88c8780b0f
Author: Patrick Griffis <pgriffis igalia com>
Date: Wed Nov 24 12:14:53 2021 -0600
tests: Fix brotli test comparing non-NUL-terminated data as a string
tests/brotli-decompressor-test.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/tests/brotli-decompressor-test.c b/tests/brotli-decompressor-test.c
index 9b9b2f37..6a72c055 100644
--- a/tests/brotli-decompressor-test.c
+++ b/tests/brotli-decompressor-test.c
@@ -54,6 +54,9 @@ test_brotli (void)
g_assert_cmpint (result, ==, G_CONVERTER_FINISHED);
+ /* NUL terminate data so we can cmpstr below. */
+ g_byte_array_append (out_bytes, (const guint8*)"\0", 1);
+
g_free (contents);
g_assert_true (g_file_get_contents (uncompressed_filename, &contents, &length, NULL));
g_assert_cmpstr ((char*)out_bytes->data, ==, contents);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]