Re: [PATCH 2/2] regmap: Add some basic kunit tests

From: David Gow
Date: Sat Mar 25 2023 - 02:30:33 EST


On Sat, 25 Mar 2023 at 08:27, Mark Brown <broonie@xxxxxxxxxx> wrote:
>
> On the theory that it's better to make a start let's add some KUnit tests
> for regmap. Currently this is a bit of a mess but it passes and hopefully
> will at some point help catch problems. We provide very basic cover for
> most of the core functionality that operates at the register level,
> repeating each test for each cache type in order to exercise the caches.
> There is no coverage of anything to do with the bulk operations at the bus
> level or formatting for byte stream buses yet.
>
> Each test creates it's own regmap since the cache structures are built
> incrementally, meaning we gain coverage from the different access
> patterns, and some of the tests cover different init scenarios.
>
> Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
> ---

It looks like regmap.basic_ranges is broken here (um, i386, arm64):
KTAP version 1
1..1
KTAP version 1
# Subtest: regmap
1..1
KTAP version 1
# Subtest: basic_ranges
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:399
Expected data->written[test_range.selector_reg] to be true, but is false
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:400
Expected data->written[test_range.window_start] to be true, but is false
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:408
Expected data->written[test_range.selector_reg] to be true, but is false
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:409
Expected data->written[test_range.window_start] to be true, but is false
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:415
Expected data->written[test_range.selector_reg] to be true, but is false
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:416
Expected data->read[test_range.window_start] to be true, but is false
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:424
Expected data->written[test_range.selector_reg] to be true, but is false
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:425
Expected data->read[test_range.window_start] to be true, but is false
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:429
Expected data->read[i] to be false, but is true
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:430
Expected data->written[i] to be false, but is true
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:429
Expected data->read[i] to be false, but is true
# basic_ranges: EXPECTATION FAILED at drivers/base/regmap/regmap-kunit.c:430
Expected data->written[i] to be false, but is true
not ok 1 none
<same for flat, rbtree>

The other tests all pass fine.

Am I missing a prerequisite?

Cheers,
-- David

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature