added tests to fix bug #407 and avoir similar ones
This commit is contained in:
parent
cef5e8352e
commit
0869680575
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue