Skip to content

Commit

Permalink
Fix #1009, add missing clock retcode tests
Browse files Browse the repository at this point in the history
Note that the success case for OS_SetLocalTime is tested,
but is marked as a MIR test case because it requires
elevated permission, it is expected to fail when running
as a normal user on Linux.
  • Loading branch information
jphickey committed May 19, 2021
1 parent 1d183e9 commit 03559a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/os/inc/osapi-clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ enum
* @param[out] time_struct An OS_time_t that will be set to the current time
*
* @return Get local time status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_INVALID_POINTER if time_struct is null
*/
int32 OS_GetLocalTime(OS_time_t *time_struct);
Expand All @@ -98,6 +99,7 @@ int32 OS_GetLocalTime(OS_time_t *time_struct);
* @param[in] time_struct An OS_time_t containing the current time
*
* @return Set local time status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_INVALID_POINTER if time_struct is null
*/
int32 OS_SetLocalTime(const OS_time_t *time_struct);
Expand Down
2 changes: 1 addition & 1 deletion src/unit-tests/oscore-test/ut_oscore_misc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void UT_os_setlocaltime_test()
/*-----------------------------------------------------*/
/* #1 Null-pointer-arg */

UT_RETVAL(OS_GetLocalTime(NULL), OS_INVALID_POINTER);
UT_RETVAL(OS_SetLocalTime(NULL), OS_INVALID_POINTER);

/*-----------------------------------------------------*/
/* #3 Nominal */
Expand Down

0 comments on commit 03559a6

Please sign in to comment.