added tests to fix bug #407 and avoir similar ones

This commit is contained in:
Frédéric Péters 2005-02-04 15:12:25 +00:00
parent cef5e8352e
commit 0869680575
3 changed files with 18 additions and 0 deletions

View File

@ -273,8 +273,14 @@ lasso_identity_new_from_dump(const gchar *dump)
LassoIdentity *identity;
xmlDoc *doc;
if (dump == NULL)
return NULL;
identity = lasso_identity_new();
doc = xmlParseMemory(dump, strlen(dump));
if (doc == NULL)
return NULL;
init_from_xml(LASSO_NODE(identity), xmlDocGetRootElement(doc));
xmlFreeDoc(doc);

View File

@ -446,8 +446,14 @@ lasso_session_new_from_dump(const gchar *dump)
LassoSession *session;
xmlDoc *doc;
if (dump == NULL)
return NULL;
session = lasso_session_new();
doc = xmlParseMemory(dump, strlen(dump));
if (doc == NULL)
return NULL;
init_from_xml(LASSO_NODE(session), xmlDocGetRootElement(doc));
xmlFreeDoc(doc);

View File

@ -626,7 +626,13 @@ lasso_node_new_from_dump(const char *dump)
LassoNode *node;
xmlDoc *doc;
if (dump == NULL)
return NULL;
doc = xmlParseMemory(dump, strlen(dump));
if (doc == NULL)
return NULL;
node = lasso_node_new_from_xmlNode(xmlDocGetRootElement(doc));
xmlFreeDoc(doc);
return node;