Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1151, MIR symbol too long or table to long for osloader test #1152

Merged
merged 1 commit into from
Sep 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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