On Wed, Mar 16, 2016 at 11:46:01AM +0100, Harald Welte wrote:
Hi Neels,
On Tue, Mar 15, 2016 at 01:28:10PM +0100, Neels Hofmeyr wrote:
So create new functions to take on the MCC+MNC BCD handling and call those from gsm48_generate_lai() and gsm48_decode_lai(). In this way, the 3G code in openbsc can use only the BCD functionality without code duplication.
fine. As this kind of bit/nibble shifting is something that can easily get wrong, and we don't have a test case yet, it should be best to add a test case testing gsm48_generate_lai() first, then perform the factoring-out and confirm that the test result doesn't change.
I agree on that. I didn't check hence wasn't aware that no test for gsm48_generate_lai() exists. Nevertheless, when Holger and I went thru the patch review, we broke the BCD generation/parsing code on purpose and actually managed to provoke a test failure with that. So these functions seem to be tested, at least indirectly. I hope that's sufficient...?
~Neels