tests/flash: Improve flash_get_size output on error

Now expected vs read size will be logged in case of error
to make it easier to understand problem or correct test
settings.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
Dominik Ermel 2024-12-05 17:32:26 +00:00 committed by Benjamin Cabé
parent fa1b93d148
commit 9dad01c6dd

View file

@ -331,7 +331,8 @@ ZTEST(flash_driver, test_get_size)
uint64_t size;
zassert_ok(flash_get_size(flash_dev, &size));
zassert_equal(size, CONFIG_TEST_DRIVER_FLASH_SIZE, "Unexpected size");
zassert_equal(size, (uint64_t)CONFIG_TEST_DRIVER_FLASH_SIZE, "Expected %llu, got %llu\n",
(uint64_t)CONFIG_TEST_DRIVER_FLASH_SIZE, size);
#else
/* The test is sipped only because there is no uniform way to get device size */
ztest_test_skip();