代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/realmd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From b6753bd048b4012b11d60c094d1ab6ca181ee50d Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@redhat.com>
Date: Thu, 21 Feb 2019 21:16:26 +0100
Subject: [PATCH] tests: ignore order in test_update_domain
Individual options of a domain or in general for a section in an ini
file are stored by realmd in a hash table. When writing out the ini file
the options can show up in any order and the unit tests should be aware
of it.
Resolves: https://gitlab.freedesktop.org/realmd/realmd/issues/19
---
tests/test-sssd-config.c | 41 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/tests/test-sssd-config.c b/tests/test-sssd-config.c
index 59eab75..8f3fec5 100644
--- a/tests/test-sssd-config.c
+++ b/tests/test-sssd-config.c
@@ -163,12 +163,49 @@ test_add_domain_only (Test *test,
g_free (output);
}
+static void check_for_test_update_domain (char *new)
+{
+ char *token;
+ char *saveptr;
+ size_t c;
+ int result = 0;
+
+ token = strtok_r (new, "\n", &saveptr);
+ g_assert_nonnull (token);
+ g_assert_cmpstr (token, ==, "[domain/one]");
+
+ for (c = 0; c < 3; c++) {
+ token = strtok_r (NULL, "\n", &saveptr);
+ g_assert_nonnull (token);
+ if (strcmp (token, "val=1") == 0) {
+ result += 1;
+ } else if (strcmp (token, "uno = 1") == 0) {
+ result += 2;
+ } else if (strcmp (token, "eins = one") == 0) {
+ result += 4;
+ } else {
+ g_assert_not_reached ();
+ }
+ }
+ g_assert_cmpint (result, ==, 7);
+
+ token = strtok_r (NULL, "\n", &saveptr);
+ g_assert_nonnull (token);
+ g_assert_cmpstr (token, ==, "[sssd]");
+
+ token = strtok_r (NULL, "\n", &saveptr);
+ g_assert_nonnull (token);
+ g_assert_cmpstr (token, ==, "domains=one");
+
+ token = strtok_r (NULL, "\n", &saveptr);
+ g_assert_null (token);
+}
+
static void
test_update_domain (Test *test,
gconstpointer unused)
{
const gchar *data = "[domain/one]\nval=1\n[sssd]\ndomains=one";
- const gchar *check = "[domain/one]\nval=1\nuno = 1\neins = one\n[sssd]\ndomains=one";
GError *error = NULL;
gchar *output;
gboolean ret;
@@ -190,7 +227,7 @@ test_update_domain (Test *test,
g_assert_no_error (error);
g_assert (ret == TRUE);
- g_assert_cmpstr (check, ==, output);
+ check_for_test_update_domain (output);
g_free (output);
}
--
2.20.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。