diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-11-13 22:48:37 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-11-14 13:35:42 +0100 |
commit | bf12800c51e3b470851a42272e083120f649a96b (patch) | |
tree | 257dfed9802c5408d9b7e1af80c4040fd7c9d81e /tests/ussd/ussd_test.c | |
parent | 72eb44cc51c2172a0880c8cef46f5873af180836 (diff) |
tests: Initialize log system to fix crash, update test result
Use osmo_init_logging to initialize the log system to fix crashes
when we attempt to parse broken ASN1 messages.
Ignore stderr with parse errors, update the test result. make check
is now passing.
Diffstat (limited to 'tests/ussd/ussd_test.c')
-rw-r--r-- | tests/ussd/ussd_test.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/ussd/ussd_test.c b/tests/ussd/ussd_test.c index 6d2a8c9b..55384f10 100644 --- a/tests/ussd/ussd_test.c +++ b/tests/ussd/ussd_test.c @@ -19,6 +19,8 @@ * */ +#include <osmocom/core/application.h> +#include <osmocom/core/logging.h> #include <osmocom/gsm/gsm0480.h> #include <stdio.h> #include <stdlib.h> @@ -64,12 +66,16 @@ static int parse_mangle_ussd(const uint8_t *_data, int len) return rc; } +struct log_info info = {}; + int main(int argc, char **argv) { struct ussd_request req; const int size = sizeof(ussd_request); int i; + osmo_init_logging(&info); + gsm0480_decode_ussd_request((struct gsm48_hdr *) ussd_request, size, &req); printf("Tested if it still works. Text was: %s\n", req.text); |