diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:29 +0000 |
commit | b41961d74fe7ff2d4d4abaca92454e87c561e49f (patch) | |
tree | b34e3826a7b649dafdbd05081140c990c96d736d /lib/common/tests/xpath | |
parent | Releasing progress-linux version 2.1.7-1~progress7.99u1. (diff) | |
download | pacemaker-b41961d74fe7ff2d4d4abaca92454e87c561e49f.tar.xz pacemaker-b41961d74fe7ff2d4d4abaca92454e87c561e49f.zip |
Merging upstream version 2.1.8~rc1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/common/tests/xpath')
-rw-r--r-- | lib/common/tests/xpath/pcmk__xpath_node_id_test.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/common/tests/xpath/pcmk__xpath_node_id_test.c b/lib/common/tests/xpath/pcmk__xpath_node_id_test.c index 3922b34..86500c2 100644 --- a/lib/common/tests/xpath/pcmk__xpath_node_id_test.c +++ b/lib/common/tests/xpath/pcmk__xpath_node_id_test.c @@ -1,5 +1,5 @@ /* - * Copyright 2021-2022 the Pacemaker project contributors + * Copyright 2021-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -9,14 +9,14 @@ #include <crm_internal.h> -#include <crm/msg_xml.h> +#include <crm/common/xml.h> #include <crm/common/unittest_internal.h> #include <crm/common/xml_internal.h> static void empty_input(void **state) { - assert_null(pcmk__xpath_node_id(NULL, "lrm")); - assert_null(pcmk__xpath_node_id("", "lrm")); + assert_null(pcmk__xpath_node_id(NULL, PCMK__XE_LRM)); + assert_null(pcmk__xpath_node_id("", PCMK__XE_LRM)); assert_null(pcmk__xpath_node_id("/blah/blah", NULL)); assert_null(pcmk__xpath_node_id("/blah/blah", "")); assert_null(pcmk__xpath_node_id(NULL, NULL)); @@ -24,30 +24,31 @@ empty_input(void **state) { static void no_quotes(void **state) { - const char *xpath = "/some/xpath/lrm[@" XML_ATTR_ID "=xyz]"; - pcmk__assert_asserts(pcmk__xpath_node_id(xpath, "lrm")); + const char *xpath = "/some/xpath/" PCMK__XE_LRM "[@" PCMK_XA_ID "=xyz]"; + pcmk__assert_asserts(pcmk__xpath_node_id(xpath, PCMK__XE_LRM)); } static void not_present(void **state) { - const char *xpath = "/some/xpath/string[@" XML_ATTR_ID "='xyz']"; - assert_null(pcmk__xpath_node_id(xpath, "lrm")); + const char *xpath = "/some/xpath/string[@" PCMK_XA_ID "='xyz']"; + assert_null(pcmk__xpath_node_id(xpath, PCMK__XE_LRM)); - xpath = "/some/xpath/containing[@" XML_ATTR_ID "='lrm']"; - assert_null(pcmk__xpath_node_id(xpath, "lrm")); + xpath = "/some/xpath/containing[@" PCMK_XA_ID "='" PCMK__XE_LRM "']"; + assert_null(pcmk__xpath_node_id(xpath, PCMK__XE_LRM)); } static void present(void **state) { char *s = NULL; - const char *xpath = "/some/xpath/containing/lrm[@" XML_ATTR_ID "='xyz']"; + const char *xpath = "/some/xpath/containing" + "/" PCMK__XE_LRM "[@" PCMK_XA_ID "='xyz']"; - s = pcmk__xpath_node_id(xpath, "lrm"); + s = pcmk__xpath_node_id(xpath, PCMK__XE_LRM); assert_int_equal(strcmp(s, "xyz"), 0); free(s); - xpath = "/some/other/lrm[@" XML_ATTR_ID "='xyz']/xpath"; - s = pcmk__xpath_node_id(xpath, "lrm"); + xpath = "/some/other/" PCMK__XE_LRM "[@" PCMK_XA_ID "='xyz']/xpath"; + s = pcmk__xpath_node_id(xpath, PCMK__XE_LRM); assert_int_equal(strcmp(s, "xyz"), 0); free(s); } |