From 0c1d871e4c5e46a2945cccb2ce765f9be2fe01fb Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Sun, 1 Mar 2009 10:54:34 +0100 Subject: Import upstream version 2.7.1 --- testapi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'testapi.c') diff --git a/testapi.c b/testapi.c index 037f7e4..6f85910 100644 --- a/testapi.c +++ b/testapi.c @@ -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); -- cgit v1.2.3