summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-03-23 02:04:18 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-23 12:25:13 +0000
commit473485c903c16c36198d6317a0545f109785cf21 (patch)
tree56a063d57071188bae97bef3d977bc968db02178 /tests
parentc1991df2c496835bd2bdfda6c79c5100dea56a8d (diff)
gsm0808_test: cosmetic: test non-hex MCC
The test currently sets the MCC by a hex value, which is a weird choice. The MCC gets BCD'd and hence we will see the decimal values 1:1 in the encoded octets as hex digits. Using hex as input obscures that: Right now it sets mcc = 0x123, which is actually 291 in decimal, and we hence see "92 .1" in the expected BCD result. Using 0x124 in the test source actually makes it hard to see where the 0x123 went. Change the MCC to decimal notation (123, 124, 125) and adjust the expected encoded output. Change-Id: I973835c54a90fefe50d2b3581324d12556715f58
Diffstat (limited to 'tests')
-rw-r--r--tests/gsm0808/gsm0808_test.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index c25344a2..abdb26e9 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -1001,9 +1001,9 @@ static void test_gsm0808_enc_dec_cell_id_list_multi_global()
struct gsm0808_cell_id_list2 dec_cil;
struct msgb *msg;
uint8_t cil_enc_expected[] = { GSM0808_IE_CELL_IDENTIFIER_LIST, 0x16, 0x00,
- 0x92, 0x61, 0x54, 0x23, 0x42, 0x00, 0x1,
- 0x92, 0x72, 0x54, 0x24, 0x43, 0x00, 0x2,
- 0x92, 0x83, 0x54, 0x25, 0x44, 0x00, 0x77
+ 0x21, 0x63, 0x54, 0x23, 0x42, 0x00, 0x1,
+ 0x21, 0x74, 0x54, 0x24, 0x43, 0x00, 0x2,
+ 0x21, 0x85, 0x54, 0x25, 0x44, 0x00, 0x77
};
uint8_t rc_enc;
int rc_dec, i;
@@ -1014,21 +1014,21 @@ static void test_gsm0808_enc_dec_cell_id_list_multi_global()
.id_list = {
{
.global = {
- .lai = { .plmn = { .mcc = 0x123, .mnc = 456 },
+ .lai = { .plmn = { .mcc = 123, .mnc = 456 },
.lac = 0x2342 },
.cell_identity = 1,
}
},
{
.global = {
- .lai = { .plmn = { .mcc = 0x124, .mnc = 457 },
+ .lai = { .plmn = { .mcc = 124, .mnc = 457 },
.lac = 0x2443 },
.cell_identity = 2,
}
},
{
.global = {
- .lai = { .plmn = { .mcc = 0x125, .mnc = 458 },
+ .lai = { .plmn = { .mcc = 125, .mnc = 458 },
.lac = 0x2544 },
.cell_identity = 119,
}