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 | |
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')
-rw-r--r-- | tests/ussd/ussd_test.c | 6 | ||||
-rw-r--r-- | tests/ussd/ussd_test.ok | 54 |
2 files changed, 59 insertions, 1 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); diff --git a/tests/ussd/ussd_test.ok b/tests/ussd/ussd_test.ok index e4bfabc1..1b6316e8 100644 --- a/tests/ussd/ussd_test.ok +++ b/tests/ussd/ussd_test.ok @@ -1 +1,53 @@ -TODO: test is crashing inside the log handling +Tested if it still works. Text was: **321# +Testing parsing a USSD request and truncated versions +Result for 1 is 28 +Result for 1 is 27 +Result for 1 is 26 +Result for 1 is 25 +Result for 0 is 24 +Result for 0 is 23 +Result for 0 is 22 +Result for 0 is 21 +Result for 0 is 20 +Result for 0 is 19 +Result for 0 is 18 +Result for 0 is 17 +Result for 0 is 16 +Result for 0 is 15 +Result for 0 is 14 +Result for 0 is 13 +Result for 0 is 12 +Result for 0 is 11 +Result for 0 is 10 +Result for 0 is 9 +Result for 0 is 8 +Result for 0 is 7 +Result for 0 is 6 +Result for 0 is 5 +Result for 0 is 4 +Result for 0 is 3 +Mangling the container now +Result for 0 is 28 +Result for 0 is 27 +Result for 1 is 26 +Result for 1 is 25 +Result for 0 is 24 +Result for 0 is 23 +Result for 0 is 22 +Result for 0 is 21 +Result for 0 is 20 +Result for 0 is 19 +Result for 0 is 18 +Result for 0 is 17 +Result for 0 is 16 +Result for 0 is 15 +Result for 0 is 14 +Result for 0 is 13 +Result for 0 is 12 +Result for 0 is 11 +Result for 0 is 10 +Result for 0 is 9 +Result for 0 is 8 +Result for 0 is 7 +Result for 0 is 6 +Result for 1 is 5 |