Skip to content

Commit

Permalink
Fix nasa#1016, additional codes from symbol table dump
Browse files Browse the repository at this point in the history
Adds documentation for OS_ERR_OUTPUT_TOO_LARGE and
OS_ERR_NAME_TOO_LONG.  These are primarily validated
via coverage test, as symbol table dump is only
possible on VxWorks.
  • Loading branch information
jphickey committed May 25, 2021
1 parent d9070fb commit f384359
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/os/inc/osapi-module.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ int32 OS_ModuleSymbolLookup(osal_id_t module_id, cpuaddr *symbol_address, const
* @retval #OS_ERR_NOT_IMPLEMENTED @copybrief OS_ERR_NOT_IMPLEMENTED
* @retval #OS_INVALID_POINTER if the filename argument is NULL
* @retval #OS_FS_ERR_PATH_INVALID if the filename argument is not valid
* @retval #OS_ERR_NAME_TOO_LONG if any of the symbol names are too long @covtest
* @retval #OS_ERR_OUTPUT_TOO_LARGE if the size_limit was reached before completing all symbols @covtest
* @retval #OS_ERROR if an other/unspecified error occurs @covtest
*/
int32 OS_SymbolTableDump(const char *filename, size_t size_limit);
Expand Down
5 changes: 4 additions & 1 deletion src/unit-tests/osloader-test/ut_osloader_symtable_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ void UT_os_symbol_table_dump_test()
/*-----------------------------------------------------*/
/* #3 Nominal */

UT_NOMINAL_OR_NOTIMPL(OS_SymbolTableDump(UT_OS_GENERIC_MODULE_DIR "SymbolFile.dat", 32000));
if (UT_NOMINAL_OR_NOTIMPL(OS_SymbolTableDump(UT_OS_GENERIC_MODULE_DIR "SymbolFile.dat", 32000)))
{
UT_RETVAL(OS_SymbolTableDump(UT_OS_GENERIC_MODULE_DIR "SymbolFile.dat", 0), OS_ERR_OUTPUT_TOO_LARGE);
}
}

/*================================================================================*
Expand Down

0 comments on commit f384359

Please sign in to comment.