diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2015-11-30 16:27:11 +0100 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2015-11-30 16:27:11 +0100 |
commit | 9a12a4b992b59698da12f6a24c5e659389c1f739 (patch) | |
tree | f0e30326b37d13024014d0cdf904f884f972d430 /src | |
parent | b2548fb1e8463119db0b1a16303183745a8002fb (diff) |
test-helpers: Also print out hexdump of encoded bit string
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/test-helpers.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tests/test-helpers.c b/src/tests/test-helpers.c index 76ab4dc..60f3d3b 100644 --- a/src/tests/test-helpers.c +++ b/src/tests/test-helpers.c @@ -71,6 +71,7 @@ void test_asn1_helpers(void) { int rc; + void *buffer; BIT_STRING_t enc; uint32_t res, tmpval; char text[32]; @@ -83,6 +84,9 @@ void test_asn1_helpers(void) ASSERT(enc.size == sizeof(uint32_t)); ASSERT(enc.bits_unused == 0); + rc = aper_encode_to_new_buffer(&asn_DEF_BIT_STRING, 0, &enc, (void **) &buffer); + printf("Encoded: %s\n", osmo_hexdump_nospc(buffer, rc)); + res = asn1bitstr_to_u32(&enc); printf("Decoding back to uint32_t: 0x%x\n", res); @@ -94,6 +98,9 @@ void test_asn1_helpers(void) ASSERT(enc.size == 24/8); ASSERT(enc.bits_unused == 0); + rc = aper_encode_to_new_buffer(&asn_DEF_BIT_STRING, 0, &enc, (void **) &buffer); + printf("Encoded: %s\n", osmo_hexdump_nospc(buffer, rc)); + rc = asn1_strncpy(text, &text1, sizeof(text)); printf("Decoding string from asn.1: %s\n", text); |