summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-01-15 16:37:09 +0100
committerMax <msuraev@sysmocom.de>2019-02-26 09:16:38 +0000
commit5ec0cf5475a7b31efa3b122f53e6c2a0e1908c20 (patch)
tree97b33cd7d5940bb3f84b2d5e01580784f2898050 /tests
parent79f92709396c04f991f1d4f9b888de75f53d2224 (diff)
LCLS: add string dump helpers
Add functions to dump LCLS (without GCR) and GCR. Dumping entire struct results in inconveniently long string hence the separate functions. Both use talloc functions so they expect caller to take care of providing proper allocation context and freeing memory. Change-Id: Ic3609224c8f3282d667e75f68bc20327e36eb9e6
Diffstat (limited to 'tests')
-rw-r--r--tests/gsm0808/gsm0808_test.c5
-rw-r--r--tests/gsm0808/gsm0808_test.ok4
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index 65fef53a..af90d00c 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -760,11 +760,12 @@ static void test_enc_dec_lcls()
}
if (!osmo_gcr_eq(&lcls_out->gcr, &lcls_in.gcr)) {
- printf("GCR parsed wrong.\n");
+ printf("GCR parsed wrong:\n\t%s\n\t%s\n", osmo_gcr_dump(lcls_out), osmo_gcr_dump(&lcls_in));
abort();
}
- printf("\tdecoded %d bytes: %s\n", rc, rc == len ? "OK" : "FAIL");
+ printf("\tdecoded %d bytes: %s:\n%s\n", rc, rc == len ? "OK" : "FAIL", osmo_lcls_dump(lcls_out));
+ printf("\t%s\n", osmo_gcr_dump(lcls_out));
msgb_free(msg);
}
diff --git a/tests/gsm0808/gsm0808_test.ok b/tests/gsm0808/gsm0808_test.ok
index 7819e7a6..e7df007a 100644
--- a/tests/gsm0808/gsm0808_test.ok
+++ b/tests/gsm0808/gsm0808_test.ok
@@ -27,7 +27,9 @@ Testing creating DTAP
Testing prepend DTAP
Testing Global Call Reference IE encoder...
15 bytes added: OK
- decoded 15 bytes: OK
+ decoded 15 bytes: OK:
+LCLS Config: Not available, Control: Not available, Correlation-Needed: 1
+ GCR NetID 0xf1f2f3, Node 0xdead, CallRefID 0x4142434445
test_gsm0808_enc_dec_cell_id_list_lac: encoded: 1a 07 05 01 24 ab cd 56 78 (rc = 9)
------- test_cell_id_list_add
cell_id_list == CGI[0]:{}