osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/14397 )

Change subject: gsm48_decode_bcd_number2: fix ENOSPC edge case
......................................................................


Patch Set 2:

(3 comments)

> I recommend to extend the unit test first, so you could show the problem in 
> the expected output, and then the fix in a separate change.

Okay. Patch set 3 will only contain the added test case, showing that the 
actual output (0) differs from the expected output (-ENOSPC).

Patch set 4 will contain both the test case and the fix.

https://gerrit.osmocom.org/#/c/14397/2/tests/gsm0408/gsm0408_test.c 
File tests/gsm0408/gsm0408_test.c:

https://gerrit.osmocom.org/#/c/14397/2/tests/gsm0408/gsm0408_test.c@739
PS2, Line 739: .dec_buf_lim = 4
> Also, the actual strlen(dec_ascii) is 3. There is no truncation with 4. […]
The input for the decoder is 022143, which is "1234". dec_ascii contains 
"123\0" after the decoding function ran, because dec_buf_lim is 4.

But I understand what you mean, the title of the test is wrong, I'll fix it in 
an update.


https://gerrit.osmocom.org/#/c/14397/2/tests/gsm0408/gsm0408_test.c@739
PS2, Line 739:          .dec_buf_lim = 4
> comma is missing
Done


https://gerrit.osmocom.org/#/c/14397/2/tests/gsm0408/gsm0408_test.c@740
PS2, Line 740: }
> comma is missing
Done



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/14397
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie05900aca50cc7fe8a45d17844dbfcd905fd82fe
Gerrit-Change-Number: 14397
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-Comment-Date: Fri, 07 Jun 2019 08:58:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <[email protected]>
Gerrit-MessageType: comment

Reply via email to