Tests: in basic_tests.c, fix, do not overwrite known elements mappings

* tests/basic_tests.c:
   when testing functionality of lasso registries which map namespace
   elements to lasso objects, do not use liberty namespace because it
   interacts with other tests -- deserialization of lib:Assertion node
   was broken by this test -- when running them in CK_FORK=no mode.
   Changed namespace LASSO_LIB_HREF, for "coin" which is less dangerous.
This commit is contained in:
Benjamin Dauvergne 2010-01-04 09:14:35 +00:00
parent c8be196a5a
commit 6d9cb01e01
1 changed files with 5 additions and 4 deletions

View File

@ -104,7 +104,7 @@ END_TEST
const char *trad(const char *from_namespace, const char *from_name, const char* to_namespace)
{
if (strcmp(from_namespace, LASSO_LIB_HREF) == 0 &&
if (strcmp(from_namespace, "coin") == 0 &&
strcmp(to_namespace, LASSO_LASSO_HREF) == 0)
{
char *temp = g_strconcat("Lasso", from_name, NULL);
@ -121,12 +121,12 @@ START_TEST(test07_registry_functional_mapping)
const char *name;
gint r;
r = lasso_registry_default_add_functional_mapping(LASSO_LIB_HREF, LASSO_LASSO_HREF, trad);
r = lasso_registry_default_add_functional_mapping("coin", LASSO_LASSO_HREF, trad);
fail_unless(r == 0, "lasso_registry_default_add_functional mapping should return 0 for new mapping");
name = lasso_registry_default_get_mapping(LASSO_LIB_HREF, "Assertion", LASSO_LASSO_HREF);
name = lasso_registry_default_get_mapping("coin", "Assertion", LASSO_LASSO_HREF);
fail_unless(name != NULL, "lasso_registry_default_get_mapping should return the recent mapping");
fail_unless(strcmp(name, "LassoAssertion") == 0, "lasso_registry_default_get_mapping should return LassoAssertion");
r = lasso_registry_default_add_functional_mapping(LASSO_LIB_HREF, LASSO_LASSO_HREF, trad);
r = lasso_registry_default_add_functional_mapping("coin", LASSO_LASSO_HREF, trad);
fail_unless(r == LASSO_REGISTRY_ERROR_KEY_EXISTS, "lasso_registry_default_add_functional_mapping should return LASSO_REGISTRY_KEY_EXISTS when done two times");
}
END_TEST
@ -1871,6 +1871,7 @@ START_TEST(test10_test_alldumps)
fail_unless(xmlDocGetRootElement (xmldoc) != NULL, "Failed to parse %s: no root node element", *iter);
node = lasso_node_new_from_xmlNode(xmlDocGetRootElement(xmldoc));
fail_unless (LASSO_IS_SAML2_ENCRYPTED_ELEMENT (node), "Parsing of %s did not return a saml2:EncryptedElement, %s", *iter);
g_object_unref(node);
++iter;
}
}