diff --git a/src/unit-test-coverage/shared/src/coveragetest-dir.c b/src/unit-test-coverage/shared/src/coveragetest-dir.c index d197136a0..a6ea62bc1 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-dir.c +++ b/src/unit-test-coverage/shared/src/coveragetest-dir.c @@ -70,7 +70,11 @@ void Test_OS_DirectoryOpen(void) UtAssert_True(actual == expected, "OS_DirectoryOpen() (%ld) == OS_SUCCESS", (long)actual); OSAPI_TEST_OBJID(objid, !=, OS_OBJECT_ID_UNDEFINED); - OSAPI_TEST_FUNCTION_RC(OS_DirectoryOpen(NULL, NULL), OS_INVALID_POINTER); + /* + * Note that the second arg (path) is validated by a separate unit (OS_TranslatePath), + * so it should not be passed NULL here + */ + OSAPI_TEST_FUNCTION_RC(OS_DirectoryOpen(NULL, "Dir"), OS_INVALID_POINTER); } void Test_OS_DirectoryClose(void) diff --git a/src/unit-tests/osfile-test/ut_osfile_dirio_test.c b/src/unit-tests/osfile-test/ut_osfile_dirio_test.c index a71fd90c8..b6ed6d5a4 100644 --- a/src/unit-tests/osfile-test/ut_osfile_dirio_test.c +++ b/src/unit-tests/osfile-test/ut_osfile_dirio_test.c @@ -284,6 +284,7 @@ void UT_os_closedir_test() os_dirent_t dirEntry; UT_RETVAL(OS_DirectoryClose(UT_OBJID_INCORRECT), OS_ERR_INVALID_ID); + UT_RETVAL(OS_DirectoryClose(OS_OBJECT_ID_UNDEFINED), OS_ERR_INVALID_ID); /*-----------------------------------------------------*/ /* #2 Nominal */ @@ -358,6 +359,7 @@ void UT_os_readdir_test() /* Invalid ID */ UT_RETVAL(OS_DirectoryRead(UT_OBJID_INCORRECT, &dirent), OS_ERR_INVALID_ID); + UT_RETVAL(OS_DirectoryRead(OS_OBJECT_ID_UNDEFINED, &dirent), OS_ERR_INVALID_ID); /*-----------------------------------------------------*/ /* #3 Nominal */ @@ -449,6 +451,7 @@ void UT_os_rewinddir_test() /* Invalid ID */ UT_RETVAL(OS_DirectoryRewind(UT_OBJID_INCORRECT), OS_ERR_INVALID_ID); + UT_RETVAL(OS_DirectoryRewind(OS_OBJECT_ID_UNDEFINED), OS_ERR_INVALID_ID); /*-----------------------------------------------------*/ /* #2 Nominal */