Skip to content

Commit

Permalink
Fix #1489, Clean up minor bugs + typos
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed Dec 17, 2024
1 parent dd4f0e9 commit d3ee760
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/bsp/generic-rtems/config/default_bsp_rtems_cfg.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/************************************************************************
* NASA Docket No. GSC-18,719-1, and identified as �~@~\core Flight System: Bootes�~@~]
* NASA Docket No. GSC-18,719-1, and identified as core Flight System: Bootes
*
* Copyright (c) 2020 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
Expand Down
2 changes: 1 addition & 1 deletion src/bsp/generic-rtems/src/bsp_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void OS_BSP_Shell(void)

status = rtems_shell_init("SHLL", RTEMS_MINIMUM_STACK_SIZE * 4, RTEMS_SHELL_PRIORITY, "/dev/console", false,
false, NULL);
if (status < 0)
if (status != RTEMS_SUCCESSFUL)
{
printf("shell init failed: %d / %s\n", status, strerror(errno));
}
Expand Down
2 changes: 1 addition & 1 deletion src/bsp/pc-rtems/src/bsp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void OS_BSP_Setup(void)
{
status = rtems_shell_init("SHLL", RTEMS_MINIMUM_STACK_SIZE * 4, RTEMS_SHELL_PRIORITY, "/dev/console", false,
false, NULL);
if (status < 0)
if (status != RTEMS_SUCCESSFUL)
{
printf("shell init failed: %d / %s\n", status, strerror(errno));
}
Expand Down
6 changes: 3 additions & 3 deletions src/os/inc/osapi-binsem.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ typedef struct
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_INVALID_POINTER if sen name or sem_id are NULL
* @retval #OS_INVALID_POINTER if sem_name or sem_id are NULL
* @retval #OS_ERR_NAME_TOO_LONG name length including null terminator greater than #OS_MAX_API_NAME
* @retval #OS_ERR_NO_FREE_IDS if all of the semaphore ids are taken
* @retval #OS_ERR_NAME_TAKEN if this is already the name of a binary semaphore
Expand Down Expand Up @@ -90,7 +90,7 @@ int32 OS_BinSemFlush(osal_id_t sem_id);
/**
* @brief Increment the semaphore value
*
* The function unlocks the semaphore referenced by sem_id by performing
* The function unlocks the semaphore referenced by sem_id by performing
* a semaphore unlock operation on that semaphore. If the semaphore value
* resulting from this operation is positive, then no threads were blocked
* waiting for the semaphore to become unlocked; the semaphore value is
Expand All @@ -109,7 +109,7 @@ int32 OS_BinSemGive(osal_id_t sem_id);
/**
* @brief Decrement the semaphore value
*
* The locks the semaphore referenced by sem_id by performing a
* The function locks the semaphore referenced by sem_id by performing a
* semaphore lock operation on that semaphore. If the semaphore value
* is currently zero, then the calling thread shall not return from
* the call until it either locks the semaphore or the call is
Expand Down
2 changes: 1 addition & 1 deletion src/os/inc/osapi-clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static inline OS_time_t OS_TimeFromTotalMicroseconds(int64 tm)
* @sa OS_TimeFromTotalNanoseconds
*
* @param[in] tm Time interval value
* @returns Whole number of microseconds in time interval
* @returns Whole number of nanoseconds in time interval
*/
static inline int64 OS_TimeGetTotalNanoseconds(OS_time_t tm)
{
Expand Down
4 changes: 2 additions & 2 deletions src/os/inc/osapi-condvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ int32 OS_CondVarBroadcast(osal_id_t var_id);
* The underlying mutex associated with the condition variable must be locked and
* owned by the calling task at the time this function is invoked. As part of this
* call, the mutex will be unlocked as the task blocks. This is done in such a way
* that there is no possibility that another task could aquire the mutex before the
* that there is no possibility that another task could acquire the mutex before the
* calling task has actually blocked.
*
* This atomicity with respect to blocking the task and unlocking the mutex is a
Expand Down Expand Up @@ -250,7 +250,7 @@ int32 OS_CondVarGetIdByName(osal_id_t *var_id, const char *var_name);
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_ERR_INVALID_ID if the id passed in is not a valid semaphore
* @retval #OS_INVALID_POINTER if the mut_prop pointer is null
* @retval #OS_INVALID_POINTER if the condvar_prop pointer is null
*/
int32 OS_CondVarGetInfo(osal_id_t var_id, OS_condvar_prop_t *condvar_prop);
/**@}*/
Expand Down
6 changes: 3 additions & 3 deletions src/os/inc/osapi-countsem.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ typedef struct
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_INVALID_POINTER if sen name or sem_id are NULL
* @retval #OS_INVALID_POINTER if sem_name or sem_id are NULL
* @retval #OS_ERR_NAME_TOO_LONG name length including null terminator greater than #OS_MAX_API_NAME
* @retval #OS_ERR_NO_FREE_IDS if all of the semaphore ids are taken
* @retval #OS_ERR_NAME_TAKEN if this is already the name of a counting semaphore
Expand Down Expand Up @@ -95,7 +95,7 @@ int32 OS_CountSemGive(osal_id_t sem_id);
/**
* @brief Decrement the semaphore value
*
* The locks the semaphore referenced by sem_id by performing a
* This locks the semaphore referenced by sem_id by performing a
* semaphore lock operation on that semaphore. If the semaphore value
* is currently zero, then the calling thread shall not return from
* the call until it either locks the semaphore or the call is
Expand Down Expand Up @@ -155,7 +155,7 @@ int32 OS_CountSemDelete(osal_id_t sem_id);
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_INVALID_POINTER is semid or sem_name are NULL pointers
* @retval #OS_INVALID_POINTER if sem_id or sem_name are NULL pointers
* @retval #OS_ERR_NAME_TOO_LONG name length including null terminator greater than #OS_MAX_API_NAME
* @retval #OS_ERR_NAME_NOT_FOUND if the name was not found in the table
*/
Expand Down
4 changes: 2 additions & 2 deletions src/os/inc/osapi-sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#ifndef OSAPI_SOCKETS_H
#define OSAPI_SOCKETS_H

/* NOTE - osconfig.h may optionally specify the value for OS_SOCADDR_MAX_LEN */
/* NOTE - osconfig.h may optionally specify the value for OS_SOCKADDR_MAX_LEN */
#include "osconfig.h"
#include "common_types.h"
#include "osapi-clock.h"
Expand Down Expand Up @@ -578,7 +578,7 @@ int32 OS_SocketGetIdByName(osal_id_t *sock_id, const char *sock_name);
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
* @retval #OS_ERR_INVALID_ID if the id passed in is not a valid semaphore
* @retval #OS_ERR_INVALID_ID if the id passed in is not a valid socket
* @retval #OS_INVALID_POINTER if the count_prop pointer is null
*/
int32 OS_SocketGetInfo(osal_id_t sock_id, OS_socket_prop_t *sock_prop);
Expand Down
6 changes: 3 additions & 3 deletions src/os/inc/osapi-timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebas
* zero to indicate the timer is not to be automatically reset.
*
* @note The resolution of the times specified is limited to the clock accuracy
* returned in the OS_TimerCreate call. If the times specified in the start_msec
* or interval_msec parameters are less than the accuracy, they will be rounded
* returned in the OS_TimerCreate call. If the times specified in the start_time
* or interval_time parameters are less than the accuracy, they will be rounded
* up to the accuracy of the timer.
*
* @note This configuration API must not be used from the context of a timer callback.
Expand All @@ -159,7 +159,7 @@ int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebas
* @param[in] start_time Time in microseconds to the first expiration
* @param[in] interval_time Time in microseconds between subsequent intervals, value
* of zero will only call the user callback function once
* after the start_msec time.
* after the start_time time.
*
* @return Execution status, see @ref OSReturnCodes
* @retval #OS_SUCCESS @copybrief OS_SUCCESS
Expand Down
8 changes: 4 additions & 4 deletions src/tests/idmap-api-test/idmap-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,13 @@ void Test_OS_ForEachObject(void)

/* Verify Outputs */
UtAssert_True(Count.TaskCount == 0, "OS_ForEachObject() TaskCount (%lu) == 0", (unsigned long)Count.TaskCount);
UtAssert_True(Count.QueueCount == 0, "OS_ForEachObject() QueueCount (%lu) == 1", (unsigned long)Count.QueueCount);
UtAssert_True(Count.CountSemCount == 0, "OS_ForEachObject() CountSemCount (%lu) == 1",
UtAssert_True(Count.QueueCount == 0, "OS_ForEachObject() QueueCount (%lu) == 0", (unsigned long)Count.QueueCount);
UtAssert_True(Count.CountSemCount == 0, "OS_ForEachObject() CountSemCount (%lu) == 0",
(unsigned long)Count.CountSemCount);
UtAssert_True(Count.BinSemCount == 0, "OS_ForEachObject() BinSemCount (%lu) == 2",
UtAssert_True(Count.BinSemCount == 0, "OS_ForEachObject() BinSemCount (%lu) == 0",
(unsigned long)Count.BinSemCount);
UtAssert_True(Count.MutexCount == 3, "OS_ForEachObject() MutexCount (%lu) == 3", (unsigned long)Count.MutexCount);
UtAssert_True(Count.TimeBaseCount == 0, "OS_ForEachObject() TimeBaseCount (%lu) == 1",
UtAssert_True(Count.TimeBaseCount == 0, "OS_ForEachObject() TimeBaseCount (%lu) == 0",
(unsigned long)Count.TimeBaseCount);

/*
Expand Down
6 changes: 3 additions & 3 deletions src/tests/symbol-api-test/symbol-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void TestSymbolApi(void)
}
else if (status == OS_ERR_NAME_TOO_LONG)
{
UtAssert_MIR("OS_SymbolTableDump name to long, consider increasing OSAL_CONFIG_MAX_SYM_LEN");
UtAssert_MIR("OS_SymbolTableDump name too long, consider increasing OSAL_CONFIG_MAX_SYM_LEN");
}
else
{
Expand All @@ -77,7 +77,7 @@ void TestSymbolApi(void)
}
else if (status == OS_ERR_NAME_TOO_LONG)
{
UtAssert_MIR("OS_SymbolTableDump name to long, consider increasing OSAL_CONFIG_MAX_SYM_LEN");
UtAssert_MIR("OS_SymbolTableDump name too long, consider increasing OSAL_CONFIG_MAX_SYM_LEN");
}
else
{
Expand All @@ -99,7 +99,7 @@ void TestSymbolApi(void)
}
else if (status == OS_ERR_NAME_TOO_LONG)
{
UtAssert_MIR("OS_SymbolTableDump name to long, consider increasing OSAL_CONFIG_MAX_SYM_LEN");
UtAssert_MIR("OS_SymbolTableDump name too long, consider increasing OSAL_CONFIG_MAX_SYM_LEN");
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/unit-test-coverage/shared/src/coveragetest-filesys.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,12 @@ void Test_OS_chkfs(void)

expected = OS_INVALID_POINTER;
actual = OS_chkfs(NULL, false);
UtAssert_True(actual == expected, "OS_fsBytesFree() (%ld) == OS_INVALID_POINTER", (long)actual);
UtAssert_True(actual == expected, "OS_chkfs() (%ld) == OS_INVALID_POINTER", (long)actual);

UT_SetDefaultReturnValue(UT_KEY(OCS_memchr), OS_ERROR);
expected = OS_FS_ERR_PATH_TOO_LONG;
actual = OS_chkfs("/cf", false);
UtAssert_True(actual == expected, "OS_fsBytesFree() (%ld) == OS_FS_ERR_PATH_TOO_LONG", (long)actual);
UtAssert_True(actual == expected, "OS_chkfs() (%ld) == OS_FS_ERR_PATH_TOO_LONG", (long)actual);
UT_ClearDefaultReturnValue(UT_KEY(OCS_memchr));

/* Test Fail due to no matching VolTab entry */
Expand Down
2 changes: 1 addition & 1 deletion src/unit-test-coverage/shared/src/coveragetest-idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ void Test_OS_ForEachObject(void)
UtAssert_True(Count.TaskCount == 1, "OS_ForEachObject() TaskCount (%lu) == 1", (unsigned long)Count.TaskCount);
UtAssert_True(Count.QueueCount == 1, "OS_ForEachObject() QueueCount (%lu) == 1", (unsigned long)Count.QueueCount);
UtAssert_True(Count.MutexCount == 1, "OS_ForEachObject() MutexCount (%lu) == 1", (unsigned long)Count.MutexCount);
UtAssert_True(Count.OtherCount == 10, "OS_ForEachObject() OtherCount (%lu) == 9", (unsigned long)Count.OtherCount);
UtAssert_True(Count.OtherCount == 10, "OS_ForEachObject() OtherCount (%lu) == 10", (unsigned long)Count.OtherCount);

OS_ForEachObjectOfType(OS_OBJECT_TYPE_OS_QUEUE, self_id.id, ObjTypeCounter, &Count);
UtAssert_True(Count.TaskCount == 1, "OS_ForEachObjectOfType(), creator %08lx TaskCount (%lu) == 1",
Expand Down
2 changes: 1 addition & 1 deletion src/unit-tests/oscore-test/ut_oscore_select_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,5 @@ void UT_os_select_multi_test(void)
}

/*================================================================================*
** End of File: ut_oscore_queue_test.c
** End of File: ut_oscore_select_test.c
**================================================================================*/
2 changes: 1 addition & 1 deletion src/unit-tests/osfile-test/ut_osfile_fileio_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ void UT_os_movefile_test()
/* #6 Nominal */

memset(g_fNames[0], '\0', sizeof(g_fNames[0]));
memset(g_fNames[0], '\0', sizeof(g_fNames[1]));
memset(g_fNames[1], '\0', sizeof(g_fNames[1]));
UT_os_sprintf(g_fNames[0], "%s/Mv_Nom_Old.txt", g_mntName);
UT_os_sprintf(g_fNames[1], "%s/Mv_Nom_New.txt", g_mntName);

Expand Down

0 comments on commit d3ee760

Please sign in to comment.