From 6fd967c3b9ef2c9635a55c12480043b9a325f59c Mon Sep 17 00:00:00 2001 From: Jake Hageman Date: Wed, 15 Sep 2021 17:08:36 -0400 Subject: [PATCH] Fix #1151, MIR symbol too long or table to long for osloader test --- .../osloader-test/ut_osloader_symtable_test.c | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/unit-tests/osloader-test/ut_osloader_symtable_test.c b/src/unit-tests/osloader-test/ut_osloader_symtable_test.c index 1a5f8bc88..d96d9fe1a 100644 --- a/src/unit-tests/osloader-test/ut_osloader_symtable_test.c +++ b/src/unit-tests/osloader-test/ut_osloader_symtable_test.c @@ -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 @@ -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); }