From 8fca2b14843fcf06ab9c67f84a1bb6b12944bf92 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Mon, 9 Aug 2021 14:25:05 -0400 Subject: [PATCH] Fix #1780, Resolve table-test RTEMS build failure Fixes RTEMS compilation error. Moves the assignment of the TBL related elements of `CFE_FT_Global` from 'cfe_test_table' to `cfe_test` to avoid duplicate definitions error. Makes `cfe_test.c` first in CMakeLists dependency list Co-authored-by: Niall Mullane --- modules/cfe_testcase/CMakeLists.txt | 4 ++-- modules/cfe_testcase/src/cfe_test.c | 5 +++++ modules/cfe_testcase/src/cfe_test_table.c | 5 +---- modules/cfe_testcase/src/cfe_test_table.h | 2 -- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/cfe_testcase/CMakeLists.txt b/modules/cfe_testcase/CMakeLists.txt index 844980844..7ba48d9a3 100644 --- a/modules/cfe_testcase/CMakeLists.txt +++ b/modules/cfe_testcase/CMakeLists.txt @@ -2,9 +2,9 @@ include_directories(inc) # Filenames based on doxygen groups. # Create the app module -add_cfe_app(cfe_testcase - src/cfe_test_table.c +add_cfe_app(cfe_testcase src/cfe_test.c + src/cfe_test_table.c src/es_application_control_test.c src/es_info_test.c src/es_task_test.c diff --git a/modules/cfe_testcase/src/cfe_test.c b/modules/cfe_testcase/src/cfe_test.c index c2555d841..a0bdae2db 100644 --- a/modules/cfe_testcase/src/cfe_test.c +++ b/modules/cfe_testcase/src/cfe_test.c @@ -41,6 +41,11 @@ CFE_FT_Global_t CFE_FT_Global; */ void CFE_TestMain(void) { + /* Constant Table information used by all table tests */ + CFE_FT_Global.TblName = "TestTable"; + CFE_FT_Global.RegisteredTblName = "CFE_TEST_APP.TestTable"; + CFE_FT_Global.TblFilename = "test_tbl.tbl"; + /* * Register this test app with CFE assert * diff --git a/modules/cfe_testcase/src/cfe_test_table.c b/modules/cfe_testcase/src/cfe_test_table.c index b0fcc8cc5..b8659f4cf 100644 --- a/modules/cfe_testcase/src/cfe_test_table.c +++ b/modules/cfe_testcase/src/cfe_test_table.c @@ -33,13 +33,10 @@ #include "cfe_test.h" #include "cfe_test_table.h" -/* Constant Table information used by all table tests */ -CFE_FT_Global_t CFE_FT_Global = { - .TblName = "TestTable", .RegisteredTblName = "CFE_TEST_APP.TestTable", .TblFilename = "test_tbl.tbl"}; - /* Setup function to register a table */ void RegisterTestTable(void) { + UtAssert_INT32_EQ(CFE_TBL_Register(&CFE_FT_Global.TblHandle, CFE_FT_Global.TblName, sizeof(TBL_TEST_Table_t), CFE_TBL_OPT_DEFAULT, NULL), CFE_SUCCESS); diff --git a/modules/cfe_testcase/src/cfe_test_table.h b/modules/cfe_testcase/src/cfe_test_table.h index 1e28b06e8..c37539e01 100644 --- a/modules/cfe_testcase/src/cfe_test_table.h +++ b/modules/cfe_testcase/src/cfe_test_table.h @@ -39,8 +39,6 @@ */ #include "cfe_test.h" -CFE_FT_Global_t CFE_FT_Global; - void RegisterTestTable(void); void UnregisterTestTable(void);