From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Anderson Date: Tue, 27 Oct 2020 17:11:58 -0400 Subject: [PATCH v3 21/23] test: Add a test for log filter-* In-Reply-To: <20201027210052.GB5340@bill-the-cat> References: <20201017180749.119271-1-seanga2@gmail.com> <20201017180749.119271-22-seanga2@gmail.com> <20201027210052.GB5340@bill-the-cat> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 >> Reviewed-by: Simon Glass > > 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