MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / test_xmlNewInputFromFile

Function test_xmlNewInputFromFile

Externals/LibXML/testapi.c:16090–16126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16088
16089
16090static int
16091test_xmlNewInputFromFile(void) {
16092 int test_ret = 0;
16093
16094 int mem_base;
16095 xmlParserInputPtr ret_val;
16096 xmlParserCtxtPtr ctxt; /* an XML parser context */
16097 int n_ctxt;
16098 const char * filename; /* the filename to use as entity */
16099 int n_filename;
16100
16101 for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
16102 for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) {
16103 mem_base = xmlMemBlocks();
16104 ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
16105 filename = gen_filepath(n_filename, 1);
16106
16107 ret_val = xmlNewInputFromFile(ctxt, filename);
16108 desret_xmlParserInputPtr(ret_val);
16109 call_tests++;
16110 des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
16111 des_filepath(n_filename, filename, 1);
16112 xmlResetLastError();
16113 if (mem_base != xmlMemBlocks()) {
16114 printf("Leak of %d blocks found in xmlNewInputFromFile",
16115 xmlMemBlocks() - mem_base);
16116 test_ret++;
16117 printf(" %d", n_ctxt);
16118 printf(" %d", n_filename);
16119 printf("\n");
16120 }
16121 }
16122 }
16123 function_tests++;
16124
16125 return(test_ret);
16126}
16127
16128
16129static int

Callers 1

test_parserInternalsFunction · 0.85

Calls 8

xmlMemBlocksFunction · 0.85
gen_xmlParserCtxtPtrFunction · 0.85
gen_filepathFunction · 0.85
xmlNewInputFromFileFunction · 0.85
desret_xmlParserInputPtrFunction · 0.85
des_xmlParserCtxtPtrFunction · 0.85
des_filepathFunction · 0.85
xmlResetLastErrorFunction · 0.85

Tested by

no test coverage detected