[LTP] [Automated-testing] [PATCH v2 2/5] lib: Add minimalistic json parser

Richard Palethorpe rpalethorpe@suse.de
Fri Nov 5 11:56:47 CET 2021


Hello,

"Petr Vorel" <pvorel@suse.cz> writes:

> Hi Cyril,
>
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
> Nice work!
>
>> +static int eatws(struct tst_json_buf *buf)
>> +{
>> +	while (!buf_empty(buf)) {
>> +		switch (buf->json[buf->off]) {
>> +		case ' ':
>> +		case '\t':
>> +		case '\n':
>> +		case '\f':
> Shouldn't there be '\r' as well? (handled at copy_str()).

Yeah, it seems to be in the spec.

At any rate, I wouldn't mind this patch being applied immediately
because there is more than one WIP it may be useful for.

Reviewed-by: Richard Palethorpe <rpalethorpe@suse.com>

>> +		break;
>> +		default:
>> +			goto ret;
>> +		}
>> +
>> +		buf->off += 1;
>> +	}
>> +ret:
>> +	return buf_empty(buf);
>> +}
>
>
> Kind regards,
> Petr
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#872): https://lists.yoctoproject.org/g/automated-testing/message/872
> Mute This Topic: https://lists.yoctoproject.org/mt/80881162/3616767
> Group Owner: automated-testing+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/automated-testing/unsub [rpalethorpe@suse.de]
> -=-=-=-=-=-=-=-=-=-=-=-


-- 
Thank you,
Richard.


More information about the ltp mailing list