From 89f5bb96405d20152cb58b80eb54d7cfcbaae3f6 Mon Sep 17 00:00:00 2001 From: Jake Hageman Date: Wed, 15 Sep 2021 11:15:43 -0400 Subject: [PATCH] Fix #1148, Enable symbol api test and MIR dump too large --- src/tests/symbol-api-test/symbol-api-test.c | 38 ++++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/tests/symbol-api-test/symbol-api-test.c b/src/tests/symbol-api-test/symbol-api-test.c index bfe43ea0d..616f2f71a 100644 --- a/src/tests/symbol-api-test/symbol-api-test.c +++ b/src/tests/symbol-api-test/symbol-api-test.c @@ -32,7 +32,6 @@ void TestSymbolApi(void) { -#ifdef OS_INCLUDE_MODULE_LOADER int32 status; cpuaddr SymAddress; @@ -50,7 +49,11 @@ void TestSymbolApi(void) status = OS_SymbolTableDump("/ram/SymbolTable32k.dat", 32768); if (status == OS_ERR_NOT_IMPLEMENTED) { - UtAssert_NA("Module API not implemented"); + UtAssert_NA("OS_SymbolTableDump API not implemented"); + } + else if (status == OS_ERR_OUTPUT_TOO_LARGE) + { + UtAssert_MIR("32k too small for OS_SymbolTableDump"); } else { @@ -64,7 +67,11 @@ void TestSymbolApi(void) status = OS_SymbolTableDump("/ram/SymbolTable128k.dat", 131072); if (status == OS_ERR_NOT_IMPLEMENTED) { - UtAssert_NA("Module API not implemented"); + UtAssert_NA("OS_SymbolTableDump API not implemented"); + } + else if (status == OS_ERR_OUTPUT_TOO_LARGE) + { + UtAssert_MIR("128k too small for OS_SymbolTableDump"); } else { @@ -78,7 +85,11 @@ void TestSymbolApi(void) status = OS_SymbolTableDump("/ram/SymbolTable512k.dat", 524288); if (status == OS_ERR_NOT_IMPLEMENTED) { - UtAssert_NA("Module API not implemented"); + UtAssert_NA("OS_SymbolTableDump API not implemented"); + } + else if (status == OS_ERR_OUTPUT_TOO_LARGE) + { + UtAssert_MIR("512k too small for OS_SymbolTableDump"); } else { @@ -89,20 +100,29 @@ void TestSymbolApi(void) ** Test the symbol lookup */ status = OS_SymbolLookup(&SymAddress, "OS_Application_Startup"); + if (status == OS_ERR_NOT_IMPLEMENTED) + { + UtAssert_NA("OS_SymbolLookup API not implemented"); + } + else + { UtAssert_True(status == OS_SUCCESS, "OS_SymbolLookup(OS_Application_Startup) = %d, Addr = %lx", (int)status, (unsigned long)SymAddress); + } /* ** Test a symbol lookup that does not exist */ status = OS_SymbolLookup(&SymAddress, "ShouldNotExist"); + if (status == OS_ERR_NOT_IMPLEMENTED) + { + UtAssert_NA("OS_SymbolLookup API not implemented"); + } + else + { UtAssert_True(status != OS_SUCCESS, "OS_SymbolLookup(ShouldNotExist) = %d, Addr = %lx", (int)status, (unsigned long)SymAddress); - -#else - /* If the module loader is not present, generate an N/A test case just to indicate that the test ran */ - UtAssert_True(1, "Module loader not present"); -#endif + } } /* end TestSymbolApi */ void UtTest_Setup(void)