[PATCH v3 21/23] test: Add a test for log filter-*

Sean Anderson seanga2 at gmail.com
Tue Oct 27 22:11:58 CET 2020


On 10/27/20 5:00 PM, Tom Rini wrote:
> On Sat, Oct 17, 2020 at 02:07:46PM -0400, Sean Anderson wrote:
> 
>> This exercises a few success and failure modes of the log filter-*
>> commands. log filter-list is not tested because it's purely informational.
>> I don't think there's a good way to test it except by testing if the output
>> of the command exactly matches a sample run.
>>
>> Signed-off-by: Sean Anderson <seanga2 at gmail.com>
>> Reviewed-by: Simon Glass <sjg at chromium.org>
> 
> Building this with Clang shows a real problem.  A full log is over at
> https://dev.azure.com/u-boot/u-boot/_build/results?buildId=1386&view=logs&j=f22b025e-3f3e-5478-618e-bef68154f752&t=0594e91d-c1b1-5d5d-b353-a764bbd01b55
> but:
> /home/trini/u-boot/u-boot/test/log/log_filter.c:64:13: warning: implicit conversion from enumeration type 'enum uclass_id' to different enumeration type 'enum log_category_t' [-Wenum-conversion]
>                                                       UCLASS_MMC));
>                                                       ^~~~~~~~~~
> /home/trini/u-boot/u-boot/include/test/ut.h:124:41: note: expanded from macro 'ut_asserteq'
>         unsigned int _val1 = (expr1), _val2 = (expr2);                  \
>                                                ^~~~~
> /home/trini/u-boot/u-boot/test/log/log_filter.c:66:13: warning: implicit conversion from enumeration type 'enum uclass_id' to different enumeration type 'enum log_category_t' [-Wenum-conversion]
>                                                       UCLASS_SPI));
>                                                       ^~~~~~~~~~
> /home/trini/u-boot/u-boot/include/test/ut.h:124:41: note: expanded from macro 'ut_asserteq'
>         unsigned int _val1 = (expr1), _val2 = (expr2);                  \
>                                                ^~~~~
> 2 warnings generated.
> 
> Was perhaps an earlier series, or some other series, adding LOGC_MMC /
> LOGC_SPI ?  Thanks!
> 

I think it's because UCLASS_SPI is an enum uclass_t, and those functions
expect a enum log_category_t. They should be cast with log_uc_cat. I can
send a v4 fixing this.

--Sean


More information about the U-Boot mailing list