- loader cunit: Add missing $(CFLAGS) to the main binary
- liblwgeom cunit: Avoid link issues with some sanitizers
References #4383
git-svn-id: http://svn.osgeo.org/postgis/trunk@17411
b70326c6-7e19-0410-871a-
916f4a2858ee
/*
** Global variable to hold TWKB strings
*/
-char *hex_a;
-char *hex_b;
-uint8_t precision = 0;
-uint8_t variant = 0;
+static char *hex_a;
+static char *hex_b;
+static uint8_t precision = 0;
+static uint8_t variant = 0;
/*
** The suite initialization function.
/*
** Global variable to hold WKB strings
*/
-char *hex_a;
-char *hex_b;
+static char *hex_a;
+static char *hex_b;
/*
** The suite initialization function.
/*
** Global variable to hold hex TWKB strings
*/
-char *s;
-char *w;
+static char *s;
+static char *w;
/*
** The suite initialization function.
/*
** Global variable to hold hex WKB strings
*/
-char *s;
-size_t s_size;
+static char *s;
+static size_t s_size;
/*
** The suite initialization function.
/*
** Global variable to hold WKT strings
*/
-char *s = NULL;
+static char *s = NULL;
/*
** The suite initialization function.
#include "cu_tester.h"
#include "../postgis_config.h"
+char cu_error_msg[MAX_CUNIT_ERROR_LENGTH + 1] = {0};
+
/* Internal funcs */
static void
cu_errorreporter(const char *fmt, va_list ap);
*
**********************************************************************/
+#ifndef _CU_TESTER_H
+#define _CU_TESTER_H 1
+
#include "liblwgeom.h"
#define MAX_CUNIT_ERROR_LENGTH 512
#define PG_ADD_TEST(suite, testfunc) CU_add_test(suite, #testfunc, testfunc)
/* Contains the most recent error message generated by lwerror. */
-char cu_error_msg[MAX_CUNIT_ERROR_LENGTH+1];
+extern char cu_error_msg[];
/* Resets cu_error_msg back to blank. */
void cu_error_msg_reset(void);
/* Utility functions */
void do_fn_test(LWGEOM* (*transfn)(LWGEOM*), char *input_wkt, char *expected_wkt);
+
+#endif /* _CU_TESTER_H */
# Build the main unit test executable
cu_tester: $(LOADER_OBJS) $(OBJS)
$(LIBTOOL) --mode=link \
- $(CC) $^ -o $@ $(LIBLWGEOM) $(LDFLAGS)
+ $(CC) $(CFLAGS) $^ -o $@ $(LIBLWGEOM) $(LDFLAGS)
# Command to build each of the .o files
$(OBJS): %.o: %.c