From 627294f52c045caecaced1cf42793f2ace1f0179 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 10 Oct 2011 16:25:38 +0200 Subject: [PATCH] [tests] add non-regression tests concerning the parsing of any xmlNode tree by LassoMiscTextNode when SNIPPET_ANY is used by a LassoNode --- tests/non_regression_tests.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/tests/non_regression_tests.c b/tests/non_regression_tests.c index 03f6045f..b266e9dd 100644 --- a/tests/non_regression_tests.c +++ b/tests/non_regression_tests.c @@ -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 +#include 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[] = "C8NQsm1Y3Gas9m0AMDhxU7UxCSI="; + 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*