gpu: nvgpu: Add branch coverage for common.fbp

Add missing branch coverage for nvgpu_fbp_remove_support()
corresponding to g->fbp == NULL case.

JIRA NVGPU-4679

Change-Id: I2d8e97b0d35a5a6738dc649500e2172560fe121f
Signed-off-by: tkudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2272934
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
tkudav
2020-01-03 15:56:08 +05:30
committed by Alex Waterman
parent 6800aa7c51
commit 7774669a30
2 changed files with 8 additions and 0 deletions

View File

@@ -206,8 +206,15 @@ int test_fbp_remove_support(struct unit_module *m, struct gk20a *g, void *args)
return UNIT_FAIL;
}
/*
* Call fbp_remove_support with fbp pointer set to NULL for branch
* coverage.
*/
nvgpu_fbp_remove_support(g);
return ret;
}
struct unit_module_test fbp_tests[] = {
UNIT_TEST(fbp_setup, test_fbp_setup, NULL, 0),
UNIT_TEST(fbp_init_and_query, test_fbp_init_and_query, NULL, 0),

View File

@@ -117,6 +117,7 @@ int test_fbp_init_and_query(struct unit_module *m, struct gk20a *g, void *args);
* - Confirm if g->fbp != NULL before calling fbp_remov_support API.
* - Call fbp_remove_support to cleanup the saved FBP data.
* - Confirm if g->fbp == NULL after cleanup.
* - Call fbp_remove_support with fbp pointer set to NULL for branch coverage.
*
* Output:
* - UNIT_FAIL if above API fails to cleanup g->fbp;