From ebc789aec901a73ab05e95774407b5cdea9a4eaa Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 25 May 2021 10:36:50 -0400 Subject: [PATCH] Fix #1016, move pointer check on OS_ModuleInfo test Move the test for OS_INVALiD_POINTER to after setup, where the module ID is valid. --- src/unit-tests/osloader-test/ut_osloader_module_test.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/unit-tests/osloader-test/ut_osloader_module_test.c b/src/unit-tests/osloader-test/ut_osloader_module_test.c index 52c57c410..aca22eefa 100644 --- a/src/unit-tests/osloader-test/ut_osloader_module_test.c +++ b/src/unit-tests/osloader-test/ut_osloader_module_test.c @@ -220,11 +220,6 @@ void UT_os_module_info_test() return; } - /*-----------------------------------------------------*/ - /* #1 Invalid-pointer-arg */ - - UT_RETVAL(OS_ModuleInfo(OS_OBJECT_ID_UNDEFINED, NULL), OS_INVALID_POINTER); - /*-----------------------------------------------------*/ /* #2 Invalid-ID-arg */ @@ -236,6 +231,10 @@ void UT_os_module_info_test() /* Setup */ if (UT_SETUP(OS_ModuleLoad(&module_id, "Good", UT_OS_GENERIC_MODULE_NAME2, OS_MODULE_FLAG_LOCAL_SYMBOLS))) { + /* Invalid-pointer-arg */ + UT_RETVAL(OS_ModuleInfo(module_id, NULL), OS_INVALID_POINTER); + + /* Nominal */ UT_NOMINAL(OS_ModuleInfo(module_id, &module_info)); UT_TEARDOWN(OS_ModuleUnload(module_id));