diff options
Diffstat (limited to 'testapi.c')
-rw-r--r-- | testapi.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -599,9 +599,10 @@ static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, #endif #define gen_nb_xmlBufferPtr 3 +static const char *static_buf_content = "a static buffer"; static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) { if (no == 0) return(xmlBufferCreate()); - if (no == 1) return(xmlBufferCreateStatic((void *)"a static buffer", 13)); + if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13)); return(NULL); } static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) { @@ -18827,6 +18828,7 @@ test_xmlBufferSetAllocationScheme(void) { scheme = gen_xmlBufferAllocationScheme(n_scheme, 1); xmlBufferSetAllocationScheme(buf, scheme); + if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;} call_tests++; des_xmlBufferPtr(n_buf, buf, 0); des_xmlBufferAllocationScheme(n_scheme, scheme, 1); |