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

Function test_xmlParserInputBufferCreateFd

Externals/LibXML/testapi.c:28221–28258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28219
28220
28221static int
28222test_xmlParserInputBufferCreateFd(void) {
28223 int test_ret = 0;
28224
28225 int mem_base;
28226 xmlParserInputBufferPtr ret_val;
28227 int fd; /* a file descriptor number */
28228 int n_fd;
28229 xmlCharEncoding enc; /* the charset encoding if known */
28230 int n_enc;
28231
28232 for (n_fd = 0;n_fd < gen_nb_int;n_fd++) {
28233 for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
28234 mem_base = xmlMemBlocks();
28235 fd = gen_int(n_fd, 0);
28236 enc = gen_xmlCharEncoding(n_enc, 1);
28237 if (fd >= 0) fd = -1;
28238
28239 ret_val = xmlParserInputBufferCreateFd(fd, enc);
28240 desret_xmlParserInputBufferPtr(ret_val);
28241 call_tests++;
28242 des_int(n_fd, fd, 0);
28243 des_xmlCharEncoding(n_enc, enc, 1);
28244 xmlResetLastError();
28245 if (mem_base != xmlMemBlocks()) {
28246 printf("Leak of %d blocks found in xmlParserInputBufferCreateFd",
28247 xmlMemBlocks() - mem_base);
28248 test_ret++;
28249 printf(" %d", n_fd);
28250 printf(" %d", n_enc);
28251 printf("\n");
28252 }
28253 }
28254 }
28255 function_tests++;
28256
28257 return(test_ret);
28258}
28259
28260
28261static int

Callers 1

test_xmlIOFunction · 0.85

Calls 8

xmlMemBlocksFunction · 0.85
gen_intFunction · 0.85
gen_xmlCharEncodingFunction · 0.85
des_intFunction · 0.85
des_xmlCharEncodingFunction · 0.85
xmlResetLastErrorFunction · 0.85

Tested by

no test coverage detected