[PATCH v1 2/2] libubox: tests: add more blobmsg/json test cases

Peter Seiderer ps.report at gmx.net
Tue Mar 9 20:44:21 GMT 2021


Hello Petr,

On Sun, 7 Mar 2021 11:30:28 +0100, Petr Štetiar <ynezz at true.cz> wrote:

> Peter Seiderer <ps.report at gmx.net> [2021-03-06 11:54:50]:
> 
> Hi,
> 
> nice, just a small nitpicks, these seems fine:
> 
> > +  int8_max: 127
> > +  int8_min: -128  
> 
> ...
> 
> but the outputs bellow looks suspicious:
> 
> > +  [*] blobmsg from json:  
> 
> ...
> 
> > +  int8_max: 1
> > +  int8_min: 1  
> 
> ...
> 
> > +  [*] blobmsg from json/cast_u64:  
> 
> ...
> 
> > +  int8_max: 1
> > +  int8_min: 1  
> 
> ...
> 
> > +  [*] blobmsg from json/cast_s64:  
> 
> ...
> 
> > +  int8_max: 1
> > +  int8_min: 1  

As stated/hidden in the test case source code:

	/* u8 is converted to boolean (true: all values != 0/false: value 0) in json */

See [1] from the libubox source code...

Regards,
Peter

[1] https://git.openwrt.org/?p=project/libubox.git;a=blob;f=blobmsg_json.c;h=dce81e991ef7b83ac4906bca6f875369d3057f36;hb=HEAD#l254


> 
> Cheers,
> 
> Petr
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel




More information about the openwrt-devel mailing list