diff mbox series

[v6,7/7] test: dm: fwu: fix for the updated api

Message ID 20230306231858.1888643-1-jassisinghbrar@gmail.com
State New
Headers show
Series fwu: gpt: implement read_mdata and write_mdata callbacks | expand

Commit Message

Jassi Brar March 6, 2023, 11:18 p.m. UTC
From: Jassi Brar <jaswinder.singh@linaro.org>

fwu_get_mdata() no more requires 'dev' argument and
fwu_check_mdata_validity() has been rendered useless and dropped.
Fix the test cases to work with aforementioned changes.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
---
 test/dm/fwu_mdata.c | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

Comments

Ilias Apalodimas March 15, 2023, 9:28 a.m. UTC | #1
On Mon, Mar 06, 2023 at 05:18:58PM -0600, jassisinghbrar@gmail.com wrote:
> From: Jassi Brar <jaswinder.singh@linaro.org>
>
> fwu_get_mdata() no more requires 'dev' argument and
> fwu_check_mdata_validity() has been rendered useless and dropped.
> Fix the test cases to work with aforementioned changes.
>
> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
> ---
>  test/dm/fwu_mdata.c | 22 +++-------------------
>  1 file changed, 3 insertions(+), 19 deletions(-)
>
> diff --git a/test/dm/fwu_mdata.c b/test/dm/fwu_mdata.c
> index b179a65c15..8b5c83ef4e 100644
> --- a/test/dm/fwu_mdata.c
> +++ b/test/dm/fwu_mdata.c
> @@ -98,7 +98,7 @@ static int dm_test_fwu_mdata_read(struct unit_test_state *uts)
>  	ut_assertok(populate_mmc_disk_image(uts));
>  	ut_assertok(write_mmc_blk_device(uts));
>
> -	ut_assertok(fwu_get_mdata(dev, &mdata));
> +	ut_assertok(fwu_get_mdata(&mdata));
>
>  	ut_asserteq(mdata.version, 0x1);
>
> @@ -118,30 +118,14 @@ static int dm_test_fwu_mdata_write(struct unit_test_state *uts)
>
>  	ut_assertok(uclass_first_device_err(UCLASS_FWU_MDATA, &dev));
>
> -	ut_assertok(fwu_get_mdata(dev, &mdata));
> +	ut_assertok(fwu_get_mdata(&mdata));
>
>  	active_idx = (mdata.active_index + 1) % CONFIG_FWU_NUM_BANKS;
>  	ut_assertok(fwu_set_active_index(active_idx));
>
> -	ut_assertok(fwu_get_mdata(dev, &mdata));
> +	ut_assertok(fwu_get_mdata(&mdata));
>  	ut_asserteq(mdata.active_index, active_idx);
>
>  	return 0;
>  }
>  DM_TEST(dm_test_fwu_mdata_write, UT_TESTF_SCAN_FDT);
> -
> -static int dm_test_fwu_mdata_check(struct unit_test_state *uts)
> -{
> -	struct udevice *dev;
> -
> -	ut_assertok(setup_blk_device(uts));
> -	ut_assertok(populate_mmc_disk_image(uts));
> -	ut_assertok(write_mmc_blk_device(uts));
> -
> -	ut_assertok(uclass_first_device_err(UCLASS_FWU_MDATA, &dev));
> -
> -	ut_assertok(fwu_check_mdata_validity());
> -
> -	return 0;
> -}
> -DM_TEST(dm_test_fwu_mdata_check, UT_TESTF_SCAN_FDT);
> --
> 2.34.1
>

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/test/dm/fwu_mdata.c b/test/dm/fwu_mdata.c
index b179a65c15..8b5c83ef4e 100644
--- a/test/dm/fwu_mdata.c
+++ b/test/dm/fwu_mdata.c
@@ -98,7 +98,7 @@  static int dm_test_fwu_mdata_read(struct unit_test_state *uts)
 	ut_assertok(populate_mmc_disk_image(uts));
 	ut_assertok(write_mmc_blk_device(uts));
 
-	ut_assertok(fwu_get_mdata(dev, &mdata));
+	ut_assertok(fwu_get_mdata(&mdata));
 
 	ut_asserteq(mdata.version, 0x1);
 
@@ -118,30 +118,14 @@  static int dm_test_fwu_mdata_write(struct unit_test_state *uts)
 
 	ut_assertok(uclass_first_device_err(UCLASS_FWU_MDATA, &dev));
 
-	ut_assertok(fwu_get_mdata(dev, &mdata));
+	ut_assertok(fwu_get_mdata(&mdata));
 
 	active_idx = (mdata.active_index + 1) % CONFIG_FWU_NUM_BANKS;
 	ut_assertok(fwu_set_active_index(active_idx));
 
-	ut_assertok(fwu_get_mdata(dev, &mdata));
+	ut_assertok(fwu_get_mdata(&mdata));
 	ut_asserteq(mdata.active_index, active_idx);
 
 	return 0;
 }
 DM_TEST(dm_test_fwu_mdata_write, UT_TESTF_SCAN_FDT);
-
-static int dm_test_fwu_mdata_check(struct unit_test_state *uts)
-{
-	struct udevice *dev;
-
-	ut_assertok(setup_blk_device(uts));
-	ut_assertok(populate_mmc_disk_image(uts));
-	ut_assertok(write_mmc_blk_device(uts));
-
-	ut_assertok(uclass_first_device_err(UCLASS_FWU_MDATA, &dev));
-
-	ut_assertok(fwu_check_mdata_validity());
-
-	return 0;
-}
-DM_TEST(dm_test_fwu_mdata_check, UT_TESTF_SCAN_FDT);