aboutsummaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-09-26 12:50:30 +0200
committerLuca Deri <deri@ntop.org>2020-09-26 12:50:30 +0200
commit8e1a3f5cdcdb7b18494662f8c11e78a2ee2417ed (patch)
tree63556b7496e775c42bfd8bdb25b8eb3caeb3facf /tests/unit
parent58538b7d19f35e8b8c5e33d83dd3655d24d66476 (diff)
Added JSON-C check for unit tests
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/unit.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/unit/unit.c b/tests/unit/unit.c
index 9def14fc7..263f6d80f 100644
--- a/tests/unit/unit.c
+++ b/tests/unit/unit.c
@@ -52,17 +52,20 @@
#include <sys/mman.h>
#include <libgen.h>
-#include "json.h"
-
#include "ndpi_config.h"
#include "ndpi_api.h"
+#ifdef HAVE_JSON_H
+#include "json.h" /* JSON-C */
+#endif
+
static struct ndpi_detection_module_struct *ndpi_info_mod = NULL;
static int verbose = 0;
/* *********************************************** */
int serializerUnitTest() {
+#ifdef HAVE_JSON_H
ndpi_serializer serializer, deserializer;
int i, loop_id;
u_int8_t verbose = 0;
@@ -220,6 +223,7 @@ int serializerUnitTest() {
}
printf("%s OK\n", __FUNCTION__);
+#endif
return 0;
}