Skip to content

Commit

Permalink
Fix nasa#559 cleaning up Rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
zanzaben committed Nov 23, 2020
1 parent 48ac38e commit 309b237
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
33 changes: 2 additions & 31 deletions src/unit-test-coverage/portable/src/coveragetest-posix-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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 --------------------------------------*/
Expand Down

0 comments on commit 309b237

Please sign in to comment.