[U-Boot] [PATCH v1 4/4] test: Add tests for the multiplexer framework

Jean-Jacques Hiblot jjhiblot at ti.com
Fri Oct 25 09:32:13 UTC 2019


Hi Tom,

On 25/10/2019 01:45, Tom Rini wrote:
> On Wed, Oct 02, 2019 at 02:47:49PM +0200, Jean-Jacques Hiblot wrote:
>
>> Provide tests to check the behavior of the multiplexer framework.
>> The test uses a mmio-based multiplexer.
>>
>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
> These tests don't pass (with all of the other series applied as well,
> and some warnings fixed up):
> _________________________ test_ut[ut_dm_devm_mux_mmio] _________________________
>
> u_boot_console = <u_boot_console_sandbox.ConsoleSandbox object at 0x7f2550b89890>
> ut_subtest = 'dm devm_mux_mmio'
>
>      def test_ut(u_boot_console, ut_subtest):
>          """Execute a "ut" subtest."""
>      
>          output = u_boot_console.run_command('ut ' + ut_subtest)
>>        assert output.endswith('Failures: 0')
> E       assert False
> E        +  where False = <built-in method endswith of str object at 0x7f2550567030>('Failures: 0')
> E        +    where <built-in method endswith of str object at 0x7f2550567030> = 'Test: dm_test_devm_mux_mmio: mux-mmio.c\r\r\n/builds/u-boot/u-boot/test/dm/mux-mmio.c:110, dm_test_devm_mux_mmio(): "...ux-mmio.c:110, dm_test_devm_mux_mmio(): "b-test" = dev_b->name: Expected "b-test", got "another-test"\r\r\nFailures: 2'.endswith

There has been some changes in the regmap support for sandbox. I'll 
rebase on top of master and send an updated version.

Thanks

JJ

>
> test/py/tests/test_ut.py:28: AssertionError
> ----------------------------- Captured stdout call -----------------------------
> => ut dm devm_mux_mmio
>
> Test: dm_test_devm_mux_mmio: mux-mmio.c
>
> /builds/u-boot/u-boot/test/dm/mux-mmio.c:110, dm_test_devm_mux_mmio(): "b-test" = dev_b->name: Expected "b-test", got "another-test"
>
> Test: dm_test_devm_mux_mmio: mux-mmio.c (flat tree)
>
> /builds/u-boot/u-boot/test/dm/mux-mmio.c:110, dm_test_devm_mux_mmio(): "b-test" = dev_b->name: Expected "b-test", got "another-test"
>
> Failures: 2
>
> =>
>
> Finally, clang-7 reports:
> /home/trini/u-boot/u-boot/drivers/mux/mux-uclass.c:108:34: warning: variable 'mux' is uninitialized when used here [-Wuninitialized]
>          debug("%s(mux=%p)\n", __func__, mux);
>                                          ^~~
> /home/trini/u-boot/u-boot/include/log.h:188:28: note: expanded from macro 'debug'
>          debug_cond(_DEBUG, fmt, ##args)
>                                    ^~~~
> /home/trini/u-boot/u-boot/include/log.h:168:41: note: expanded from macro 'debug_cond'
>                          log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \
>                                                               ^~~~
> /home/trini/u-boot/u-boot/include/log.h:139:25: note: expanded from macro 'log'
>                        pr_fmt(_fmt), ##_args); \
>                                        ^~~~~
> /home/trini/u-boot/u-boot/drivers/mux/mux-uclass.c:105:25: note: initialize the variable 'mux' to silence this warning
>          struct mux_control *mux;
>                                 ^
>                                  = NULL
>
> Thanks!



More information about the U-Boot mailing list