summaryrefslogtreecommitdiffstats
path: root/tests/gsm0808
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-03-23 02:15:12 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-23 12:31:29 +0000
commitc44fc23feecc58ef3041f317dee0e5297e3c4571 (patch)
treee36c4a246d1c69a1bb342142e2cc0f0e3a55fc58 /tests/gsm0808
parent473485c903c16c36198d6317a0545f109785cf21 (diff)
show failure in gsm0808_enc_cell_id_list2() in gsm0808_test
Change-Id: I763b18d2922701ad97382269747ff0cbb7bd657b
Diffstat (limited to 'tests/gsm0808')
-rw-r--r--tests/gsm0808/gsm0808_test.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index abdb26e9..f6a7bc43 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -1002,8 +1002,9 @@ static void test_gsm0808_enc_dec_cell_id_list_multi_global()
struct msgb *msg;
uint8_t cil_enc_expected[] = { GSM0808_IE_CELL_IDENTIFIER_LIST, 0x16, 0x00,
0x21, 0x63, 0x54, 0x23, 0x42, 0x00, 0x1,
- 0x21, 0x74, 0x54, 0x24, 0x43, 0x00, 0x2,
- 0x21, 0x85, 0x54, 0x25, 0x44, 0x00, 0x77
+ 0x21, 0xf4, 0x75, 0x24, 0x43, 0x00, 0x2,
+ 0x21, 0xf5, 0x70, 0x25, 0x44, 0x00, 0x77
+ /* ERROR! This ^^^^^^^^ should be 0x75, 0x00, i.e. a 3-digit MNC with leading zeros! */
};
uint8_t rc_enc;
int rc_dec, i;
@@ -1021,14 +1022,15 @@ static void test_gsm0808_enc_dec_cell_id_list_multi_global()
},
{
.global = {
- .lai = { .plmn = { .mcc = 124, .mnc = 457 },
+ .lai = { .plmn = { .mcc = 124, .mnc = 57 },
.lac = 0x2443 },
.cell_identity = 2,
}
},
{
.global = {
- .lai = { .plmn = { .mcc = 125, .mnc = 458 },
+ .lai = { .plmn = { .mcc = 125, .mnc = 7,
+ .mnc_3_digits = true },
.lac = 0x2544 },
.cell_identity = 119,
}
@@ -1055,7 +1057,9 @@ static void test_gsm0808_enc_dec_cell_id_list_multi_global()
struct osmo_cell_global_id *dec_id;
enc_id = &enc_cil.id_list[i].global;
dec_id = &dec_cil.id_list[i].global;
+ /* ERROR: the decoded PLMN will mismatch, because the leading zero was not preserved:
OSMO_ASSERT(osmo_plmn_cmp(&enc_id->lai.plmn, &dec_id->lai.plmn) == 0);
+ */
OSMO_ASSERT(enc_id->lai.lac == dec_id->lai.lac);
OSMO_ASSERT(enc_id->cell_identity == dec_id->cell_identity);
}