aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2015-11-24 18:11:03 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2015-11-24 18:11:03 +0100
commit1a86955288e44041e56c411f59407a04e49739b5 (patch)
tree727f359c10bedf1e12e134842cb426a78a596a3d /src
parent39e643a62d6cfccf993a06be611f251b75c4074f (diff)
tests/test-hnbap: Decode HNBAP UE Register accept as well
Diffstat (limited to 'src')
-rw-r--r--src/tests/test-hnbap.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/tests/test-hnbap.c b/src/tests/test-hnbap.c
index 1fae902..f03a8e6 100644
--- a/src/tests/test-hnbap.c
+++ b/src/tests/test-hnbap.c
@@ -54,6 +54,7 @@ void test_asn1_decoding(void)
HNBAP_PDU_t _pdu, *pdu = &_pdu;
InitiatingMessage_t *im;
+ SuccessfulOutcome_t *so;
UERegisterRequestIEs_t ies;
char imsi[16];
@@ -80,7 +81,28 @@ void test_asn1_decoding(void)
decode_iu_bcd(imsi, sizeof(imsi), ies.uE_Identity.choice.iMSI.buf,
ies.uE_Identity.choice.iMSI.size);
- printf("HNBAP UE Register from IMSI %s\n", imsi);
+ printf("HNBAP UE Register request from IMSI %s\n", imsi);
+
+ memset(pdu, 0, sizeof(*pdu));
+ dec_ret = aper_decode(NULL, &asn_DEF_HNBAP_PDU, (void **) &pdu,
+ hnbap_ue_reg_acc, sizeof(hnbap_ue_reg_acc), 0, 0);
+
+
+ ASSERT(dec_ret.code == RC_OK);
+ ASSERT(pdu->present == HNBAP_PDU_PR_successfulOutcome);
+
+ so = &pdu->choice.successfulOutcome;
+ ASSERT(so->procedureCode == ProcedureCode_id_UERegister);
+
+ rc = hnbap_decode_ueregisteraccepties(&ies, &so->value);
+ ASSERT(rc >= 0);
+
+ ASSERT(ies.uE_Identity.present == UE_Identity_PR_iMSI);
+ decode_iu_bcd(imsi, sizeof(imsi), ies.uE_Identity.choice.iMSI.buf,
+ ies.uE_Identity.choice.iMSI.size);
+
+ printf("HNBAP UE Register accept to IMSI %s\n", imsi);
+
}