From 309b23728561837fcb6b075dd1842fe82ba7a34a Mon Sep 17 00:00:00 2001 From: Alex Campbell Date: Mon, 23 Nov 2020 13:48:13 -0500 Subject: [PATCH] Fix #559 cleaning up Rebasing --- .../portable/src/coveragetest-posix-files.c | 5 --- .../portable/src/coveragetest-posix-io.c | 33 ++----------------- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/src/unit-test-coverage/portable/src/coveragetest-posix-files.c b/src/unit-test-coverage/portable/src/coveragetest-posix-files.c index e07a87905..372914b28 100644 --- a/src/unit-test-coverage/portable/src/coveragetest-posix-files.c +++ b/src/unit-test-coverage/portable/src/coveragetest-posix-files.c @@ -47,13 +47,8 @@ void Test_OS_FileOpen_Impl(void) OSAPI_TEST_FUNCTION_RC(OS_FileOpen_Impl, (UT_INDEX_0, "local", 0, -1234), OS_ERROR); /* failure mode */ -<<<<<<< HEAD UT_SetDefaultReturnValue(UT_KEY(OCS_open), -1); - OSAPI_TEST_FUNCTION_RC(OS_FileOpen_Impl, (0, "local", 0, OS_READ_ONLY), OS_ERROR); -======= - UT_SetForceFail(UT_KEY(OCS_open), -1); OSAPI_TEST_FUNCTION_RC(OS_FileOpen_Impl, (UT_INDEX_0, "local", 0, OS_READ_ONLY), OS_ERROR); ->>>>>>> refs/rewritten/onto } void Test_OS_FileStat_Impl(void) diff --git a/src/unit-test-coverage/portable/src/coveragetest-posix-io.c b/src/unit-test-coverage/portable/src/coveragetest-posix-io.c index af27b0cda..b272d9792 100644 --- a/src/unit-test-coverage/portable/src/coveragetest-posix-io.c +++ b/src/unit-test-coverage/portable/src/coveragetest-posix-io.c @@ -49,13 +49,8 @@ void Test_OS_GenericClose_Impl(void) * Test path where underlying close() fails. * Should still return success. */ -<<<<<<< HEAD UT_SetDefaultReturnValue(UT_KEY(OCS_close), -1); - OSAPI_TEST_FUNCTION_RC(OS_GenericClose_Impl, (0), OS_SUCCESS); -======= - UT_SetForceFail(UT_KEY(OCS_close), -1); OSAPI_TEST_FUNCTION_RC(OS_GenericClose_Impl, (UT_INDEX_0), OS_SUCCESS); ->>>>>>> refs/rewritten/onto } void Test_OS_GenericSeek_Impl(void) @@ -66,33 +61,19 @@ void Test_OS_GenericSeek_Impl(void) */ /* note on success this wrapper returns the result of lseek(), not OS_SUCCESS */ -<<<<<<< HEAD UT_SetDefaultReturnValue(UT_KEY(OCS_lseek), 111); - OSAPI_TEST_FUNCTION_RC(OS_GenericSeek_Impl, (0, 0, OS_SEEK_CUR), 111); - UT_SetDefaultReturnValue(UT_KEY(OCS_lseek), 222); - OSAPI_TEST_FUNCTION_RC(OS_GenericSeek_Impl, (0, 0, OS_SEEK_SET), 222); - UT_SetDefaultReturnValue(UT_KEY(OCS_lseek), 333); - OSAPI_TEST_FUNCTION_RC(OS_GenericSeek_Impl, (0, 0, OS_SEEK_END), 333); -======= - UT_SetForceFail(UT_KEY(OCS_lseek), 111); OSAPI_TEST_FUNCTION_RC(OS_GenericSeek_Impl, (UT_INDEX_0, 0, OS_SEEK_CUR), 111); - UT_SetForceFail(UT_KEY(OCS_lseek), 222); + UT_SetDefaultReturnValue(UT_KEY(OCS_lseek), 222); OSAPI_TEST_FUNCTION_RC(OS_GenericSeek_Impl, (UT_INDEX_0, 0, OS_SEEK_SET), 222); - UT_SetForceFail(UT_KEY(OCS_lseek), 333); + UT_SetDefaultReturnValue(UT_KEY(OCS_lseek), 333); OSAPI_TEST_FUNCTION_RC(OS_GenericSeek_Impl, (UT_INDEX_0, 0, OS_SEEK_END), 333); ->>>>>>> refs/rewritten/onto /* bad whence */ OSAPI_TEST_FUNCTION_RC(OS_GenericSeek_Impl, (UT_INDEX_0, 0, 1234), OS_ERROR); /* generic failure of lseek() */ -<<<<<<< HEAD UT_SetDefaultReturnValue(UT_KEY(OCS_lseek), -1); - OSAPI_TEST_FUNCTION_RC(OS_GenericSeek_Impl, (0, 0, OS_SEEK_END), OS_ERROR); -======= - UT_SetForceFail(UT_KEY(OCS_lseek), -1); OSAPI_TEST_FUNCTION_RC(OS_GenericSeek_Impl, (UT_INDEX_0, 0, OS_SEEK_END), OS_ERROR); ->>>>>>> refs/rewritten/onto /* The seek implementation also checks for this specific pipe errno */ OCS_errno = OCS_ESPIPE; @@ -121,13 +102,8 @@ void Test_OS_GenericRead_Impl(void) UtAssert_True(UT_GetStubCount(UT_KEY(OS_SelectSingle_Impl)) == 1, "OS_SelectSingle() called"); /* read() failure */ -<<<<<<< HEAD UT_SetDefaultReturnValue(UT_KEY(OCS_read), -1); - OSAPI_TEST_FUNCTION_RC(OS_GenericRead_Impl, (0, DestData, sizeof(DestData), 0), OS_ERROR); -======= - UT_SetForceFail(UT_KEY(OCS_read), -1); OSAPI_TEST_FUNCTION_RC(OS_GenericRead_Impl, (UT_INDEX_0, DestData, sizeof(DestData), 0), OS_ERROR); ->>>>>>> refs/rewritten/onto } void Test_OS_GenericWrite_Impl(void) @@ -152,13 +128,8 @@ void Test_OS_GenericWrite_Impl(void) UtAssert_True(UT_GetStubCount(UT_KEY(OS_SelectSingle_Impl)) == 1, "OS_SelectSingle() called"); /* write() failure */ -<<<<<<< HEAD UT_SetDefaultReturnValue(UT_KEY(OCS_write), -1); - OSAPI_TEST_FUNCTION_RC(OS_GenericWrite_Impl, (0, DestData, sizeof(DestData), 0), OS_ERROR); -======= - UT_SetForceFail(UT_KEY(OCS_write), -1); OSAPI_TEST_FUNCTION_RC(OS_GenericWrite_Impl, (UT_INDEX_0, DestData, sizeof(DestData), 0), OS_ERROR); ->>>>>>> refs/rewritten/onto } /* ------------------- End of test cases --------------------------------------*/