Skip to content

Commit

Permalink
Merge pull request #477 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
Integration Candidate 2020-05-13
  • Loading branch information
astrogeco authored May 22, 2020
2 parents c2bcebb + 9af5078 commit 3597aaf
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ This distribution contains:

## Version History

### Development Build: 5.0.17

- `OS_QueueCreate()` will return an error code if the depth parameter is larger than the configured `OS_MAX_QUEUE_DEPTH`.
- See <https://github.com/nasa/osal/pull/477>

### Development Build: 5.0.16

- Resized buffers and added explicit termination to string copies. No warnings on GCC9 with strict settings and optimization enabled.

- New API to reverse lookup an OS-provided thread/task identifier back to an OSAL ID. Any use of existing OStask_id field within the task property structure is now deprecated.

- See <https://github.com/nasa/osal/pull/458>

### Development Build: 5.0.15
Expand Down
1 change: 1 addition & 0 deletions src/os/inc/osapi-os-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ int32 OS_TaskFindIdBySystemData(uint32 *task_id, const void *sysdata, size_t sys
* @retval #OS_ERR_NAME_TOO_LONG name length including null terminator greater than #OS_MAX_API_NAME
* @retval #OS_ERR_NO_FREE_IDS if there are already the max queues created
* @retval #OS_ERR_NAME_TAKEN if the name is already being used on another queue
* @retval #OS_QUEUE_INVALID_SIZE if the queue depth exceeds the limit
* @retval #OS_ERROR if the OS create call fails
*/
int32 OS_QueueCreate (uint32 *queue_id, const char *queue_name,
Expand Down
2 changes: 1 addition & 1 deletion src/os/inc/osapi-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#define OS_MAJOR_VERSION 5 /**< @brief Major version number */
#define OS_MINOR_VERSION 0 /**< @brief Minor version number */
#define OS_REVISION 16 /**< @brief Revision number */
#define OS_REVISION 17 /**< @brief Revision number */
#define OS_MISSION_REV 0 /**< @brief Mission revision */

/**
Expand Down
5 changes: 5 additions & 0 deletions src/os/shared/src/osapi-queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ int32 OS_QueueCreate (uint32 *queue_id, const char *queue_name, uint32 queue_dep
return OS_ERR_NAME_TOO_LONG;
}

if ( queue_depth > OS_QUEUE_MAX_DEPTH )
{
return OS_QUEUE_INVALID_SIZE;
}

/* Note - the common ObjectIdAllocate routine will lock the object type and leave it locked. */
return_code = OS_ObjectIdAllocateNew(LOCAL_OBJID_TYPE, queue_name, &local_id, &record);
if(return_code == OS_SUCCESS)
Expand Down
4 changes: 4 additions & 0 deletions src/unit-test-coverage/shared/src/coveragetest-queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ void Test_OS_QueueCreate(void)
actual = OS_QueueCreate(&objid, "UT", 0, 0,0);
UtAssert_True(actual == expected, "OS_QueueCreate() (%ld) == OS_ERR_NAME_TOO_LONG", (long)actual);
UT_ClearForceFail(UT_KEY(OCS_strlen));

expected = OS_QUEUE_INVALID_SIZE;
actual = OS_QueueCreate(&objid, "UT", 1 + OS_QUEUE_MAX_DEPTH, 0,0);
UtAssert_True(actual == expected, "OS_QueueCreate() (%ld) == OS_QUEUE_INVALID_SIZE", (long)actual);
}

void Test_OS_QueueDelete(void)
Expand Down

0 comments on commit 3597aaf

Please sign in to comment.