mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-21 22:50:08 +03:00
Regenerate api.xml and testapi.c
This commit is contained in:
parent
343fc1421c
commit
9a0be0dc4d
6319
doc/libxml2-api.xml
6319
doc/libxml2-api.xml
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
656
testapi.c
656
testapi.c
@ -665,21 +665,6 @@ static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr v
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_FTP_ENABLED
|
||||
#define gen_nb_xmlNanoFTPCtxtPtr 4
|
||||
static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
|
||||
if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD));
|
||||
if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD));
|
||||
if (no == 2) return(xmlNanoFTPNewCtxt("foo"));
|
||||
return(NULL);
|
||||
}
|
||||
static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) {
|
||||
if (val != NULL) {
|
||||
xmlNanoFTPFreeCtxt(val);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_HTTP_ENABLED
|
||||
#define gen_nb_xmlNanoHTTPCtxtPtr 1
|
||||
static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) {
|
||||
@ -874,11 +859,6 @@ static void desret_xmlNanoHTTPCtxtPtr(void *val) {
|
||||
xmlNanoHTTPClose(val);
|
||||
}
|
||||
#endif
|
||||
#ifdef LIBXML_FTP_ENABLED
|
||||
static void desret_xmlNanoFTPCtxtPtr(void *val) {
|
||||
xmlNanoFTPClose(val);
|
||||
}
|
||||
#endif
|
||||
/* cut and pasted from autogenerated to avoid troubles */
|
||||
#define gen_nb_const_xmlChar_ptr_ptr 1
|
||||
static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
|
||||
@ -1172,7 +1152,6 @@ static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaW
|
||||
#include <libxml/entities.h>
|
||||
#include <libxml/hash.h>
|
||||
#include <libxml/list.h>
|
||||
#include <libxml/nanoftp.h>
|
||||
#include <libxml/nanohttp.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
@ -1211,7 +1190,6 @@ static int test_encoding(void);
|
||||
static int test_entities(void);
|
||||
static int test_hash(void);
|
||||
static int test_list(void);
|
||||
static int test_nanoftp(void);
|
||||
static int test_nanohttp(void);
|
||||
static int test_parser(void);
|
||||
static int test_parserInternals(void);
|
||||
@ -1264,7 +1242,6 @@ testlibxml2(void)
|
||||
test_ret += test_entities();
|
||||
test_ret += test_hash();
|
||||
test_ret += test_list();
|
||||
test_ret += test_nanoftp();
|
||||
test_ret += test_nanohttp();
|
||||
test_ret += test_parser();
|
||||
test_ret += test_parserInternals();
|
||||
@ -3716,33 +3693,6 @@ test_HTMLtree(void) {
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
static int
|
||||
test_docbDefaultSAXHandlerInit(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_DOCB_ENABLED)
|
||||
#ifdef LIBXML_DOCB_ENABLED
|
||||
int mem_base;
|
||||
|
||||
mem_base = xmlMemBlocks();
|
||||
|
||||
docbDefaultSAXHandlerInit();
|
||||
call_tests++;
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in docbDefaultSAXHandlerInit",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf("\n");
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_htmlDefaultSAXHandlerInit(void) {
|
||||
int test_ret = 0;
|
||||
@ -4088,7 +4038,7 @@ static int
|
||||
test_xmlSAX2EndElement(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
|
||||
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
|
||||
#ifdef LIBXML_SAX1_ENABLED
|
||||
int mem_base;
|
||||
void * ctx; /* the user data (XML parser context) */
|
||||
@ -4653,38 +4603,6 @@ test_xmlSAX2InitDefaultSAXHandler(void) {
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlSAX2InitDocbDefaultSAXHandler(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_DOCB_ENABLED)
|
||||
int mem_base;
|
||||
xmlSAXHandler * hdlr; /* the SAX handler */
|
||||
int n_hdlr;
|
||||
|
||||
for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) {
|
||||
mem_base = xmlMemBlocks();
|
||||
hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0);
|
||||
|
||||
xmlSAX2InitDocbDefaultSAXHandler(hdlr);
|
||||
call_tests++;
|
||||
des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0);
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf(" %d", n_hdlr);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlSAX2InitHtmlDefaultSAXHandler(void) {
|
||||
int test_ret = 0;
|
||||
@ -5056,7 +4974,7 @@ static int
|
||||
test_xmlSAX2StartElement(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
|
||||
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
|
||||
#ifdef LIBXML_SAX1_ENABLED
|
||||
int mem_base;
|
||||
void * ctx; /* the user data (XML parser context) */
|
||||
@ -5322,8 +5240,7 @@ static int
|
||||
test_SAX2(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n");
|
||||
test_ret += test_docbDefaultSAXHandlerInit();
|
||||
if (quiet == 0) printf("Testing SAX2 : 36 of 36 functions ...\n");
|
||||
test_ret += test_htmlDefaultSAXHandlerInit();
|
||||
test_ret += test_xmlDefaultSAXHandlerInit();
|
||||
test_ret += test_xmlSAX2AttributeDecl();
|
||||
@ -5346,7 +5263,6 @@ test_SAX2(void) {
|
||||
test_ret += test_xmlSAX2HasInternalSubset();
|
||||
test_ret += test_xmlSAX2IgnorableWhitespace();
|
||||
test_ret += test_xmlSAX2InitDefaultSAXHandler();
|
||||
test_ret += test_xmlSAX2InitDocbDefaultSAXHandler();
|
||||
test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler();
|
||||
test_ret += test_xmlSAX2InternalSubset();
|
||||
test_ret += test_xmlSAX2IsStandalone();
|
||||
@ -11519,569 +11435,6 @@ test_list(void) {
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPCheckResponse(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
int ret_val;
|
||||
void * ctx; /* an FTP context */
|
||||
int n_ctx;
|
||||
|
||||
for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
|
||||
mem_base = xmlMemBlocks();
|
||||
ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
|
||||
|
||||
ret_val = xmlNanoFTPCheckResponse(ctx);
|
||||
desret_int(ret_val);
|
||||
call_tests++;
|
||||
des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPCheckResponse",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf(" %d", n_ctx);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPCleanup(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
|
||||
mem_base = xmlMemBlocks();
|
||||
|
||||
xmlNanoFTPCleanup();
|
||||
call_tests++;
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPCleanup",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf("\n");
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPCloseConnection(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
int ret_val;
|
||||
void * ctx; /* an FTP context */
|
||||
int n_ctx;
|
||||
|
||||
for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
|
||||
mem_base = xmlMemBlocks();
|
||||
ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
|
||||
|
||||
ret_val = xmlNanoFTPCloseConnection(ctx);
|
||||
desret_int(ret_val);
|
||||
call_tests++;
|
||||
des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPCloseConnection",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf(" %d", n_ctx);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPCwd(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
int ret_val;
|
||||
void * ctx; /* an FTP context */
|
||||
int n_ctx;
|
||||
char * directory; /* a directory on the server */
|
||||
int n_directory;
|
||||
|
||||
for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
|
||||
for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) {
|
||||
mem_base = xmlMemBlocks();
|
||||
ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
|
||||
directory = gen_const_char_ptr(n_directory, 1);
|
||||
|
||||
ret_val = xmlNanoFTPCwd(ctx, (const char *)directory);
|
||||
desret_int(ret_val);
|
||||
call_tests++;
|
||||
des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
|
||||
des_const_char_ptr(n_directory, (const char *)directory, 1);
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPCwd",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf(" %d", n_ctx);
|
||||
printf(" %d", n_directory);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPDele(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
int ret_val;
|
||||
void * ctx; /* an FTP context */
|
||||
int n_ctx;
|
||||
const char * file; /* a file or directory on the server */
|
||||
int n_file;
|
||||
|
||||
for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
|
||||
for (n_file = 0;n_file < gen_nb_filepath;n_file++) {
|
||||
mem_base = xmlMemBlocks();
|
||||
ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
|
||||
file = gen_filepath(n_file, 1);
|
||||
|
||||
ret_val = xmlNanoFTPDele(ctx, file);
|
||||
desret_int(ret_val);
|
||||
call_tests++;
|
||||
des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
|
||||
des_filepath(n_file, file, 1);
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPDele",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf(" %d", n_ctx);
|
||||
printf(" %d", n_file);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPGet(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
|
||||
/* missing type support */
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPGetConnection(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
|
||||
/* missing type support */
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPGetResponse(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
int ret_val;
|
||||
void * ctx; /* an FTP context */
|
||||
int n_ctx;
|
||||
|
||||
for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
|
||||
mem_base = xmlMemBlocks();
|
||||
ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
|
||||
|
||||
ret_val = xmlNanoFTPGetResponse(ctx);
|
||||
desret_int(ret_val);
|
||||
call_tests++;
|
||||
des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPGetResponse",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf(" %d", n_ctx);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPGetSocket(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
|
||||
/* missing type support */
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPInit(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
|
||||
mem_base = xmlMemBlocks();
|
||||
|
||||
xmlNanoFTPInit();
|
||||
call_tests++;
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPInit",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf("\n");
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPList(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
|
||||
/* missing type support */
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPNewCtxt(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
void * ret_val;
|
||||
const char * URL; /* The URL used to initialize the context */
|
||||
int n_URL;
|
||||
|
||||
for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
|
||||
mem_base = xmlMemBlocks();
|
||||
URL = gen_filepath(n_URL, 0);
|
||||
|
||||
ret_val = xmlNanoFTPNewCtxt(URL);
|
||||
desret_xmlNanoFTPCtxtPtr(ret_val);
|
||||
call_tests++;
|
||||
des_filepath(n_URL, URL, 0);
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPNewCtxt",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf(" %d", n_URL);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPOpen(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
void * ret_val;
|
||||
const char * URL; /* the URL to the resource */
|
||||
int n_URL;
|
||||
|
||||
for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
|
||||
mem_base = xmlMemBlocks();
|
||||
URL = gen_filepath(n_URL, 0);
|
||||
|
||||
ret_val = xmlNanoFTPOpen(URL);
|
||||
desret_xmlNanoFTPCtxtPtr(ret_val);
|
||||
call_tests++;
|
||||
des_filepath(n_URL, URL, 0);
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPOpen",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf(" %d", n_URL);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPProxy(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
char * host; /* the proxy host name */
|
||||
int n_host;
|
||||
int port; /* the proxy port */
|
||||
int n_port;
|
||||
char * user; /* the proxy user name */
|
||||
int n_user;
|
||||
char * passwd; /* the proxy password */
|
||||
int n_passwd;
|
||||
int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */
|
||||
int n_type;
|
||||
|
||||
for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) {
|
||||
for (n_port = 0;n_port < gen_nb_int;n_port++) {
|
||||
for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) {
|
||||
for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) {
|
||||
for (n_type = 0;n_type < gen_nb_int;n_type++) {
|
||||
host = gen_const_char_ptr(n_host, 0);
|
||||
port = gen_int(n_port, 1);
|
||||
user = gen_const_char_ptr(n_user, 2);
|
||||
passwd = gen_const_char_ptr(n_passwd, 3);
|
||||
type = gen_int(n_type, 4);
|
||||
|
||||
xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type);
|
||||
call_tests++;
|
||||
des_const_char_ptr(n_host, (const char *)host, 0);
|
||||
des_int(n_port, port, 1);
|
||||
des_const_char_ptr(n_user, (const char *)user, 2);
|
||||
des_const_char_ptr(n_passwd, (const char *)passwd, 3);
|
||||
des_int(n_type, type, 4);
|
||||
xmlResetLastError();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPQuit(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
int ret_val;
|
||||
void * ctx; /* an FTP context */
|
||||
int n_ctx;
|
||||
|
||||
for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
|
||||
mem_base = xmlMemBlocks();
|
||||
ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
|
||||
|
||||
ret_val = xmlNanoFTPQuit(ctx);
|
||||
desret_int(ret_val);
|
||||
call_tests++;
|
||||
des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPQuit",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf(" %d", n_ctx);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPRead(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
int ret_val;
|
||||
void * ctx; /* the FTP context */
|
||||
int n_ctx;
|
||||
void * dest; /* a buffer */
|
||||
int n_dest;
|
||||
int len; /* the buffer length */
|
||||
int n_len;
|
||||
|
||||
for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
|
||||
for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) {
|
||||
for (n_len = 0;n_len < gen_nb_int;n_len++) {
|
||||
mem_base = xmlMemBlocks();
|
||||
ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
|
||||
dest = gen_void_ptr(n_dest, 1);
|
||||
len = gen_int(n_len, 2);
|
||||
|
||||
ret_val = xmlNanoFTPRead(ctx, dest, len);
|
||||
desret_int(ret_val);
|
||||
call_tests++;
|
||||
des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
|
||||
des_void_ptr(n_dest, dest, 1);
|
||||
des_int(n_len, len, 2);
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPRead",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf(" %d", n_ctx);
|
||||
printf(" %d", n_dest);
|
||||
printf(" %d", n_len);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPScanProxy(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
const char * URL; /* The proxy URL used to initialize the proxy context */
|
||||
int n_URL;
|
||||
|
||||
for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
|
||||
URL = gen_filepath(n_URL, 0);
|
||||
|
||||
xmlNanoFTPScanProxy(URL);
|
||||
call_tests++;
|
||||
des_filepath(n_URL, URL, 0);
|
||||
xmlResetLastError();
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
test_xmlNanoFTPUpdateURL(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_FTP_ENABLED)
|
||||
int mem_base;
|
||||
int ret_val;
|
||||
void * ctx; /* an FTP context */
|
||||
int n_ctx;
|
||||
const char * URL; /* The URL used to update the context */
|
||||
int n_URL;
|
||||
|
||||
for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) {
|
||||
for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) {
|
||||
mem_base = xmlMemBlocks();
|
||||
ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0);
|
||||
URL = gen_filepath(n_URL, 1);
|
||||
|
||||
ret_val = xmlNanoFTPUpdateURL(ctx, URL);
|
||||
desret_int(ret_val);
|
||||
call_tests++;
|
||||
des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0);
|
||||
des_filepath(n_URL, URL, 1);
|
||||
xmlResetLastError();
|
||||
if (mem_base != xmlMemBlocks()) {
|
||||
printf("Leak of %d blocks found in xmlNanoFTPUpdateURL",
|
||||
xmlMemBlocks() - mem_base);
|
||||
test_ret++;
|
||||
printf(" %d", n_ctx);
|
||||
printf(" %d", n_URL);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
function_tests++;
|
||||
#endif
|
||||
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
static int
|
||||
test_nanoftp(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n");
|
||||
test_ret += test_xmlNanoFTPCheckResponse();
|
||||
test_ret += test_xmlNanoFTPCleanup();
|
||||
test_ret += test_xmlNanoFTPCloseConnection();
|
||||
test_ret += test_xmlNanoFTPCwd();
|
||||
test_ret += test_xmlNanoFTPDele();
|
||||
test_ret += test_xmlNanoFTPGet();
|
||||
test_ret += test_xmlNanoFTPGetConnection();
|
||||
test_ret += test_xmlNanoFTPGetResponse();
|
||||
test_ret += test_xmlNanoFTPGetSocket();
|
||||
test_ret += test_xmlNanoFTPInit();
|
||||
test_ret += test_xmlNanoFTPList();
|
||||
test_ret += test_xmlNanoFTPNewCtxt();
|
||||
test_ret += test_xmlNanoFTPOpen();
|
||||
test_ret += test_xmlNanoFTPProxy();
|
||||
test_ret += test_xmlNanoFTPQuit();
|
||||
test_ret += test_xmlNanoFTPRead();
|
||||
test_ret += test_xmlNanoFTPScanProxy();
|
||||
test_ret += test_xmlNanoFTPUpdateURL();
|
||||
|
||||
if (test_ret != 0)
|
||||
printf("Module nanoftp: %d errors\n", test_ret);
|
||||
return(test_ret);
|
||||
}
|
||||
|
||||
static int
|
||||
test_xmlNanoHTTPAuthHeader(void) {
|
||||
int test_ret = 0;
|
||||
@ -23940,7 +23293,7 @@ static int
|
||||
test_xmlValidateNCName(void) {
|
||||
int test_ret = 0;
|
||||
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
int mem_base;
|
||||
int ret_val;
|
||||
@ -52141,7 +51494,6 @@ test_module(const char *module) {
|
||||
if (!strcmp(module, "entities")) return(test_entities());
|
||||
if (!strcmp(module, "hash")) return(test_hash());
|
||||
if (!strcmp(module, "list")) return(test_list());
|
||||
if (!strcmp(module, "nanoftp")) return(test_nanoftp());
|
||||
if (!strcmp(module, "nanohttp")) return(test_nanohttp());
|
||||
if (!strcmp(module, "parser")) return(test_parser());
|
||||
if (!strcmp(module, "parserInternals")) return(test_parserInternals());
|
||||
|
Loading…
x
Reference in New Issue
Block a user