4 static int test_isds_document_free(
5 struct isds_document
**document
) {
6 isds_document_free(document
);
7 if (!document
) PASS_TEST
;
10 FAIL_TEST("isds_document_free() did not null pointer");
17 xmlNode node
= { .type
= XML_TEXT_NODE
, .content
= BAD_CAST
"data" };
19 INIT_TEST("isds_document_free()");
21 ABORT_UNIT("isds_init() failed");
23 struct isds_document
*document
= NULL
;
24 TEST("NULL", test_isds_document_free
, NULL
);
25 TEST("*NULL", test_isds_document_free
, &document
);
27 TEST_CALLOC(document
);
28 TEST("Empty structure", test_isds_document_free
, &document
);
30 TEST_CALLOC(document
);
32 TEST_FILL_STRING(document
->data
);
33 TEST_FILL_STRING(document
->dmMimeType
);
34 TEST_FILL_STRING(document
->dmFileGuid
);
35 TEST_FILL_STRING(document
->dmUpFileGuid
);
36 TEST_FILL_STRING(document
->dmFileDescr
);
37 TEST_FILL_STRING(document
->dmFormat
);
38 TEST("Binary document", test_isds_document_free
, &document
);
40 TEST_CALLOC(document
);
42 document
->xml_node_list
= &node
;
43 TEST_FILL_STRING(document
->dmMimeType
);
44 TEST_FILL_STRING(document
->dmFileGuid
);
45 TEST_FILL_STRING(document
->dmUpFileGuid
);
46 TEST_FILL_STRING(document
->dmFileDescr
);
47 TEST_FILL_STRING(document
->dmFormat
);
48 TEST("XML document", test_isds_document_free
, &document
);