Skip to content

Commit cc982ae

Browse files
author
Felipe Zimmerle
committed
test: Makes the unit tests to work again
The unit tests was not working due to lack update. This patch adds the necessary stuff to have it work again.
1 parent ad330a4 commit cc982ae

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

tests/Makefile.am

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
check_PROGRAMS = msc_test
22
msc_test_SOURCES = msc_test.c \
3+
$(top_srcdir)/standalone/server.c \
4+
$(top_srcdir)/standalone/regex.c \
35
$(top_srcdir)/apache2/re.c \
46
$(top_srcdir)/apache2/re_operators.c \
57
$(top_srcdir)/apache2/re_actions.c \
@@ -16,6 +18,7 @@ msc_test_SOURCES = msc_test.c \
1618
$(top_srcdir)/apache2/persist_dbm.c \
1719
$(top_srcdir)/apache2/msc_reqbody.c \
1820
$(top_srcdir)/apache2/msc_crypt.c \
21+
$(top_srcdir)/apache2/msc_json.c \
1922
$(top_srcdir)/apache2/msc_tree.c \
2023
$(top_srcdir)/apache2/msc_geo.c \
2124
$(top_srcdir)/apache2/msc_gsb.c \
@@ -24,14 +27,17 @@ msc_test_SOURCES = msc_test.c \
2427
$(top_srcdir)/apache2/msc_release.c \
2528
$(top_srcdir)/apache2/libinjection/libinjection_sqli.c
2629
msc_test_CFLAGS = @APXS_CFLAGS@ @APR_CFLAGS@ @APU_CFLAGS@ \
27-
@PCRE_CFLAGS@ @LIBXML2_CFLAGS@ @MODSEC_EXTRA_CFLAGS@ @LUA_CFLAGS@
30+
@PCRE_CFLAGS@ @LIBXML2_CFLAGS@ @MODSEC_EXTRA_CFLAGS@ @LUA_CFLAGS@ \
31+
@YAJL_CFLAGS@
2832
msc_test_CPPFLAGS = -I$(top_srcdir)/apache2 \
2933
@APR_CPPFLAGS@ @LIBXML2_CPPFLAGS@ \
3034
@PCRE_CPPFLAGS@
3135
msc_test_LDADD = @APR_LDADD@ @APU_LDADD@ \
32-
@PCRE_LDADD@ @LIBXML2_LDADD@ @LUA_LDADD@
36+
@PCRE_LDADD@ @LIBXML2_LDADD@ @LUA_LDADD@ \
37+
@YAJL_LDADD@
3338
msc_test_LDFLAGS = @APR_LDFLAGS@ @APU_LDFLAGS@ @APXS_LDFLAGS@ \
34-
@PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@
39+
@PCRE_LDFLAGS@ @LIBXML2_LDFLAGS@ @LUA_LDFLAGS@ \
40+
@YAJL_LDFLAGS@
3541

3642
check_SCRIPTS = run-unit-tests.pl
3743
TESTS = $(check_SCRIPTS)

tests/msc_test.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ void msr_log_warn(modsec_rec *msr, const char *text, ...) {
178178
va_end(ap);
179179
}
180180

181-
const char *ap_get_remote_host(conn_rec *conn, void *dir_config, int type, int *str_is_ip) {
181+
#define ap_get_remote_host(a, b, c, d) test_ap_get_remote_host(a, b, c, d)
182+
const char *test_ap_get_remote_host(conn_rec *conn, void *dir_config, int type, int *str_is_ip) {
182183
return "FAKE-REMOTE-HOST";
183184
}
184185

0 commit comments

Comments
 (0)