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
This commit is contained in:
Neels Hofmeyr 2018-03-23 02:04:18 +01:00 committed by Harald Welte
parent c1991df2c4
commit 473485c903
1 changed files with 6 additions and 6 deletions

View File

@ -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,
}