[tests] add non-regression tests concerning the parsing of any xmlNode tree by LassoMiscTextNode when SNIPPET_ANY is used by a LassoNode

This commit is contained in:
Benjamin Dauvergne 2011-10-10 16:25:38 +02:00
parent 94136d639b
commit 627294f52c
1 changed files with 30 additions and 1 deletions

View File

@ -32,8 +32,11 @@
#include <../lasso/xml/lib_authentication_statement.h>
#include <../lasso/xml/saml_name_identifier.h>
#include <../lasso/xml/samlp_response.h>
#include <../lasso/xml/saml-2.0/saml2_attribute.h>
#include <../lasso/id-ff/provider.h>
#include "../lasso/utils.h"
#include <libxml/tree.h>
#include <libxml/parser.h>
Suite* non_regression_suite();
@ -137,12 +140,38 @@ START_TEST(indexed_endpoints_20101008)
}
END_TEST
void error_log_func(G_GNUC_UNUSED const gchar *log_domain, G_GNUC_UNUSED GLogLevelFlags log_level,
const gchar *message, G_GNUC_UNUSED gpointer user_data)
{
fail_unless(FALSE, "error_func called... %s", message);
}
START_TEST(remove_warning_when_parssing_unknown_SNIPPET_LIST_NODES_20111007)
{
LassoNode *node;
xmlDoc *xmldoc;
const char content[] = "<saml:Attribute Name=\"urn:oid:1.3.6.1.4.1.5923.1.1.1.10\" NameFormat=\"urn:oasis:names:tc:SAML:2.0:attrname-format:uri\" FriendlyName=\"eduPersonTargetedID\" xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\"><saml:AttributeValue><NameID Format=\"urn:oasis:names:tc:SAML:2.0:nameid-format:persistent\" NameQualifier=\"https://services-federation.renater.fr/test/idp\" SPNameQualifier=\"https://univnautes.entrouvert.lan/authsaml2/metadata\">C8NQsm1Y3Gas9m0AMDhxU7UxCSI=</NameID></saml:AttributeValue></saml:Attribute>";
guint log_handler;
xmldoc = xmlReadMemory(content, sizeof(content)-1, NULL, NULL, 0);
check_not_null(xmldoc);
log_handler = g_log_set_handler("Lasso", G_LOG_LEVEL_MASK, error_log_func, NULL);
node = lasso_node_new_from_xmlNode(xmlDocGetRootElement(xmldoc));
check_not_null(node);
check_true(LASSO_IS_SAML2_ATTRIBUTE(node));
g_log_remove_handler("Lasso", log_handler);
check_true(LASSO_IS_NODE(node));
xmlFreeDoc(xmldoc);
lasso_release_gobject(node);
}
END_TEST
struct {
char *name;
void *function;
} tests[] = {
{ "Googleapps error from coudot@ on 27-09-2010", test01_googleapps_27092010},
{ "Wrong assertionConsumer ordering on 08-10-2010", indexed_endpoints_20101008}
{ "Wrong assertionConsumer ordering on 08-10-2010", indexed_endpoints_20101008},
{ "Warning when parsing AttributeValue node containing unknown namespace nodes", remove_warning_when_parssing_unknown_SNIPPET_LIST_NODES_20111007 }
};
Suite*