From cbf5b0c75b1c8684f1fd184a4b95c17f38686f8d Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Mon, 6 Jan 2020 12:48:33 -0500 Subject: [PATCH] gpu: nvgpu: unit: ptimer: add case for uncovered lines This adds a test for one case in scale_ptimer() that wasn't previously covered by the test. NVGPU-4818 Change-Id: Ifdf92b68a921d288701b2a9ecd45e07f96e229d8 Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/2274670 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert GVS: Gerrit_Virtual_Submit Reviewed-by: Sagar Kamble Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/units/ptimer/nvgpu-ptimer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/userspace/units/ptimer/nvgpu-ptimer.c b/userspace/units/ptimer/nvgpu-ptimer.c index 8c839d8a8..ebcba60f7 100644 --- a/userspace/units/ptimer/nvgpu-ptimer.c +++ b/userspace/units/ptimer/nvgpu-ptimer.c @@ -284,6 +284,12 @@ int test_ptimer_scaling(struct unit_module *m, ret = UNIT_FAIL; } + val = scale_ptimer(10, 6); + if (val != 17) { + unit_err(m, "ptimer scale calculation incorrect\n"); + ret = UNIT_FAIL; + } + val = ptimer_scalingfactor10x(100); if (val != (PTIMER_REF_FREQ_HZ*10/100)) { unit_err(m, "ptimer scale calculation incorrect\n");