libsoup/backport-fix-testcase-error.patch
kerongw 95acdf2d9a fix brotli-decompressor-test testcase failure
Signed-off-by: kerongw <wangkerong@h-partners.com>
(cherry picked from commit 30074593e9e83fec7e4baa528c100955120c7fa2)
2022-11-01 11:31:54 +08:00

28 lines
968 B
Diff

From a2899a3f7a508f6e2f031c988759229a79a1b7be Mon Sep 17 00:00:00 2001
From: Patrick Griffis <pgriffis@igalia.com>
Date: Wed, 24 Nov 2021 12:14:53 -0600
Subject: [PATCH] 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 cb26e46a..cd9004c3 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);
--
GitLab