diff --git a/userspace/units/interface/static_analysis/static_analysis.c b/userspace/units/interface/static_analysis/static_analysis.c index 5df8e5902..1007707f4 100644 --- a/userspace/units/interface/static_analysis/static_analysis.c +++ b/userspace/units/interface/static_analysis/static_analysis.c @@ -266,9 +266,17 @@ int test_cast(struct unit_module *m, struct gk20a *g, void *args) return UNIT_SUCCESS; } +int test_safety_checks(struct unit_module *m, struct gk20a *g, void *args) +{ + nvgpu_safety_checks(); + + return UNIT_SUCCESS; +} + struct unit_module_test static_analysis_tests[] = { UNIT_TEST(arithmetic, test_arithmetic, NULL, 0), UNIT_TEST(cast, test_cast, NULL, 0), + UNIT_TEST(safety_checks, test_safety_checks, NULL, 0), }; UNIT_MODULE(static_analysis, static_analysis_tests, UNIT_PRIO_NVGPU_TEST); \ No newline at end of file diff --git a/userspace/units/interface/static_analysis/static_analysis.h b/userspace/units/interface/static_analysis/static_analysis.h index d44e006fd..c2559415c 100644 --- a/userspace/units/interface/static_analysis/static_analysis.h +++ b/userspace/units/interface/static_analysis/static_analysis.h @@ -84,8 +84,26 @@ int test_arithmetic(struct unit_module *m, struct gk20a *g, void *args); */ int test_cast(struct unit_module *m, struct gk20a *g, void *args); +/** + * Test specification for: test_safety_checks + * + * Description: Verify functionality of static analysis safety_check() API. + * + * Test Type: Feature + * + * Targets: nvgpu_safety_checks + * + * Input: None + * + * Steps: + * - Call the API nvgpu_safety_checks(). No error should occur. + * + * Output: Returns PASS if expected result is met, FAIL otherwise. + */ +int test_safety_checks(struct unit_module *m, struct gk20a *g, void *args); + /** * @} */ -#endif /* UNIT_WORKER_H */ +#endif /* UNIT_STATIC_ANALYSIS_H */