diff options
author | Luca Deri <deri@ntop.org> | 2020-10-02 12:39:08 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-10-02 12:39:08 +0200 |
commit | b68a3707f678e648567ea95a223825f2553d6673 (patch) | |
tree | cad577b8f5605ebac690ada9d821e9274366740c /tests/unit | |
parent | b0c4d01734b9531915592494498741bb307262c6 (diff) |
Updated serialization test unit
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/unit.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/unit/unit.c b/tests/unit/unit.c index 263f6d80f..2842638c2 100644 --- a/tests/unit/unit.c +++ b/tests/unit/unit.c @@ -68,7 +68,6 @@ int serializerUnitTest() { #ifdef HAVE_JSON_H ndpi_serializer serializer, deserializer; int i, loop_id; - u_int8_t verbose = 0; ndpi_serialization_format fmt; u_int32_t buffer_len; char *buffer; @@ -230,7 +229,8 @@ int serializerUnitTest() { /* *********************************************** */ int main(int argc, char **argv) { - + int c; + if (ndpi_get_api_version() != NDPI_API_VERSION) { printf("nDPI Library version mismatch: please make sure this code and the nDPI library are in sync\n"); return -1; @@ -241,6 +241,18 @@ int main(int argc, char **argv) { if (ndpi_info_mod == NULL) return -1; + while((c = getopt(argc, argv, "vh")) != -1) { + switch(c) { + case 'v': + verbose = 1; + break; + + default: + printf("Usage: unit [-v] [-h]\n"); + return(0); + } + } + /* Tests */ if (serializerUnitTest() != 0) return -1; |