1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

tests: Make global variables static

This commit is contained in:
Nick Wellnhofer
2025-08-01 15:27:11 +02:00
parent 8436916097
commit 43f7ff0a9e
4 changed files with 13 additions and 13 deletions

View File

@@ -96,7 +96,7 @@ sqlRead(void * context, char * buffer, int len) {
return(len);
}
const char *include = "<?xml version='1.0'?>\n\
static const char *const include = "<?xml version='1.0'?>\n\
<document xmlns:xi=\"http://www.w3.org/2003/XInclude\">\n\
<p>List of people:</p>\n\
<xi:include href=\"sql:select_name_from_people\"/>\n\

View File

@@ -32,7 +32,7 @@ static int verbose = 0;
#define NB_EXPECTED_ERRORS 5
const char *skipped_tests[] = {
static const char *const skipped_tests[] = {
/* http://lists.w3.org/Archives/Public/public-xml-testsuite/2008Jul/0000.html */
"rmt-ns10-035",
NULL

View File

@@ -14,7 +14,7 @@
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
int lastError;
static int lastError;
static void errorHandler(void *unused, const xmlError *err) {
if ((unused == NULL) && (err != NULL) && (lastError == 0)) {
@@ -22,8 +22,8 @@ static void errorHandler(void *unused, const xmlError *err) {
}
}
char document1[100] = "<doc>XXXX</doc>";
char document2[100] = "<doc foo='XXXX'/>";
static char document1[100] = "<doc>XXXX</doc>";
static char document2[100] = "<doc foo='XXXX'/>";
static int testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
int len, char *data, int forbid1, int forbid2) {

View File

@@ -39,7 +39,7 @@ static int tests_quiet = 0;
#define MAX_TIME 2 /* seconds */
static clock_t t0;
int timeout = 0;
static int timeout = 0;
static void reset_timout(void) {
timeout = 0;
@@ -142,7 +142,7 @@ hugeClose(void * context) {
#define CHUNK 4096
char filling[CHUNK + 1];
static char filling[CHUNK + 1];
static void fillFilling(void) {
int i;
@@ -153,9 +153,9 @@ static void fillFilling(void) {
filling[CHUNK] = 0;
}
size_t maxlen = 64 * 1024 * 1024;
size_t curlen = 0;
size_t dotlen;
static size_t maxlen = 64 * 1024 * 1024;
static size_t curlen = 0;
static size_t dotlen;
/**
* Implement an huge: query read.
@@ -221,9 +221,9 @@ hugeRead(void *context, char *buffer, int len)
* *
************************************************************************/
unsigned int crazy_indx = 0;
static unsigned int crazy_indx = 0;
const char *crazy = "<?xml version='1.0' encoding='UTF-8'?>\
static const char *const crazy = "<?xml version='1.0' encoding='UTF-8'?>\
<?tst ?>\
<!-- tst -->\
<!DOCTYPE foo [\
@@ -386,7 +386,7 @@ initializeLibxml2(void) {
* *
************************************************************************/
unsigned long callbacks = 0;
static unsigned long callbacks = 0;
/**
* Is this document tagged standalone ?