代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From bad124022e97195191d3dd1ea2b5b9aa9df57aea Mon Sep 17 00:00:00 2001
From: yangmingtai <961612727@qq.com>
Date: Tue, 11 Jan 2022 20:22:11 +0800
Subject: [PATCH] fix test-string-util failed when locale is not utf8
(cherry picked from commit 647082cf7f07a87c65601626e86c3ed9f78fb387)
(cherry picked from commit 32f33c9474ab89061d799a92a1273b106468e8c6)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/bad124022e97195191d3dd1ea2b5b9aa9df57aea
---
src/test/test-string-util.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/test/test-string-util.c b/src/test/test-string-util.c
index 4d9d0260c9..266aee9115 100644
--- a/src/test/test-string-util.c
+++ b/src/test/test-string-util.c
@@ -176,33 +176,33 @@ static void test_cellescape(void) {
assert_se(streq(cellescape(buf, 1, "\020"), ""));
assert_se(streq(cellescape(buf, 2, "\020"), "."));
assert_se(streq(cellescape(buf, 3, "\020"), ".."));
- assert_se(streq(cellescape(buf, 4, "\020"), "…"));
+ assert_se(streq(cellescape(buf, 4, "\020"), is_locale_utf8() ? "…" : "..."));
assert_se(streq(cellescape(buf, 5, "\020"), "\\020"));
- assert_se(streq(cellescape(buf, 5, "1234\020"), "1…"));
- assert_se(streq(cellescape(buf, 6, "1234\020"), "12…"));
- assert_se(streq(cellescape(buf, 7, "1234\020"), "123…"));
- assert_se(streq(cellescape(buf, 8, "1234\020"), "1234…"));
+ assert_se(streq(cellescape(buf, 5, "1234\020"), is_locale_utf8() ? "1…" : "1..."));
+ assert_se(streq(cellescape(buf, 6, "1234\020"), is_locale_utf8() ? "12…" : "12..."));
+ assert_se(streq(cellescape(buf, 7, "1234\020"), is_locale_utf8() ? "123…" : "123..."));
+ assert_se(streq(cellescape(buf, 8, "1234\020"), is_locale_utf8() ? "1234…" : "1234..."));
assert_se(streq(cellescape(buf, 9, "1234\020"), "1234\\020"));
assert_se(streq(cellescape(buf, 1, "\t\n"), ""));
assert_se(streq(cellescape(buf, 2, "\t\n"), "."));
assert_se(streq(cellescape(buf, 3, "\t\n"), ".."));
- assert_se(streq(cellescape(buf, 4, "\t\n"), "…"));
+ assert_se(streq(cellescape(buf, 4, "\t\n"), is_locale_utf8() ? "…" : "..."));
assert_se(streq(cellescape(buf, 5, "\t\n"), "\\t\\n"));
- assert_se(streq(cellescape(buf, 5, "1234\t\n"), "1…"));
- assert_se(streq(cellescape(buf, 6, "1234\t\n"), "12…"));
- assert_se(streq(cellescape(buf, 7, "1234\t\n"), "123…"));
- assert_se(streq(cellescape(buf, 8, "1234\t\n"), "1234…"));
+ assert_se(streq(cellescape(buf, 5, "1234\t\n"), is_locale_utf8() ? "1…" : "1..."));
+ assert_se(streq(cellescape(buf, 6, "1234\t\n"), is_locale_utf8() ? "12…" : "12..."));
+ assert_se(streq(cellescape(buf, 7, "1234\t\n"), is_locale_utf8() ? "123…" : "123..."));
+ assert_se(streq(cellescape(buf, 8, "1234\t\n"), is_locale_utf8() ? "1234…" : "1234..."));
assert_se(streq(cellescape(buf, 9, "1234\t\n"), "1234\\t\\n"));
- assert_se(streq(cellescape(buf, 4, "x\t\020\n"), "…"));
- assert_se(streq(cellescape(buf, 5, "x\t\020\n"), "x…"));
- assert_se(streq(cellescape(buf, 6, "x\t\020\n"), "x…"));
- assert_se(streq(cellescape(buf, 7, "x\t\020\n"), "x\\t…"));
- assert_se(streq(cellescape(buf, 8, "x\t\020\n"), "x\\t…"));
- assert_se(streq(cellescape(buf, 9, "x\t\020\n"), "x\\t…"));
+ assert_se(streq(cellescape(buf, 4, "x\t\020\n"), is_locale_utf8() ? "…" : "..."));
+ assert_se(streq(cellescape(buf, 5, "x\t\020\n"), is_locale_utf8() ? "x…" : "x..."));
+ assert_se(streq(cellescape(buf, 6, "x\t\020\n"), is_locale_utf8() ? "x…" : "x..."));
+ assert_se(streq(cellescape(buf, 7, "x\t\020\n"), is_locale_utf8() ? "x\\t…" : "x\\t..."));
+ assert_se(streq(cellescape(buf, 8, "x\t\020\n"), is_locale_utf8() ? "x\\t…" : "x\\t..."));
+ assert_se(streq(cellescape(buf, 9, "x\t\020\n"), is_locale_utf8() ? "x\\t…" : "x\\t..."));
assert_se(streq(cellescape(buf, 10, "x\t\020\n"), "x\\t\\020\\n"));
assert_se(streq(cellescape(buf, 6, "1\011"), "1\\t"));
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。