Skip to content

Commit

Permalink
Fix nasa#1151, MIR symbol too long or table to long for osloader test
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Sep 15, 2021
1 parent 2a2defb commit 6fd967c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 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 @@ -177,6 +177,7 @@ void UT_os_module_symbol_lookup_test()
**--------------------------------------------------------------------------------*/
void UT_os_symbol_table_dump_test()
{
int32 status;
/*
* Note that even if the functionality is not implemented,
* the API still validates the input pointers (not null) and
Expand All @@ -196,7 +197,25 @@ void UT_os_symbol_table_dump_test()
/*-----------------------------------------------------*/
/* #3 Nominal */

if (UT_NOMINAL_OR_NOTIMPL(OS_SymbolTableDump(UT_OS_GENERIC_MODULE_DIR "SymbolReal.dat", UT_SYMTABLE_SIZE_LIMIT)))
status = OS_SymbolTableDump(UT_OS_GENERIC_MODULE_DIR "SymbolReal.dat", UT_SYMTABLE_SIZE_LIMIT);
if (status == OS_ERR_NOT_IMPLEMENTED)
{
UtAssert_NA("OS_SymbolTableDump API not implemented");
}
else if (status == OS_ERR_OUTPUT_TOO_LARGE)
{
UtAssert_MIR("UT_SYMTABLE_SIZE_LIMIT too small for OS_SymbolTableDump");
}
else if (status == OS_ERR_NAME_TOO_LONG)
{
UtAssert_MIR("OSAL_CONFIG_MAX_SYM_LEN too small for OS_SymbolTableDump");
}
else
{
UtAssert_True(status == OS_SUCCESS, "status after 128k OS_SymbolTableDump = %d", (int)status);
}

if (status == OS_SUCCESS)
{
UT_RETVAL(OS_SymbolTableDump(UT_OS_GENERIC_MODULE_DIR "SymbolZero.dat", 0), OS_ERR_OUTPUT_TOO_LARGE);
}
Expand Down

0 comments on commit 6fd967c

Please sign in to comment.