[PATCH 2/2] Add the test case for parsing uplink header type 2

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-net-gprs@lists.osmocom.org/.

Holger Freyther holger at freyther.de
Thu Apr 7 22:29:16 UTC 2016


> On 07 Apr 2016, at 13:57, Bhargava Abhyankar <Bhargava.Abhyankar at radisys.com> wrote:
> 
> A test case is added to validate the uplink header type 2 extraction
> functionality. Bug identified by unit test in the header type 2
> parsing is fixed.


> 	offs = rlc->data_offs_bits[0] / 8;
> -	OSMO_ASSERT(rlc->data_offs_bits[0] % 8 == 1);
> +	OSMO_ASSERT(rlc->data_offs_bits[0] % 8 == 7);
> -	e_ti_header = (data[offs-1] + (data[offs] << 8)) >> 7;
> -	rlc->block_info[0].e   = !!(e_ti_header & 0x01);
> -	rlc->block_info[0].ti  = !!(e_ti_header & 0x02);
> +	e_ti_header = (data[offs] & 0x60) >> 5;
> +	rlc->block_info[0].e   = (e_ti_header & 0x01);
> +	rlc->block_info[0].ti  = (e_ti_header & 0x02);
> 	cur_bit += 2;

you probably want this to be in another commit.


> +	pdch = &the_bts->bts_data()->trx[trx_no].pdch[ts_no];
> +	pdch->rcv_block(&data[0], 79, *fn, &meas);

like in my other mails, please have more strong post conditions. What do you actually expect in terms of side effects here? Test them specifically.

kind regards
	holger


More information about the osmocom-net-gprs mailing list