Skip to content

Commit

Permalink
Fix nasa#1780, Resolve RTEMS CFE_FT_Global build fail
Browse files Browse the repository at this point in the history
- Removed multiple instantiations of CFE_FT_Global
- 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 <[email protected]>
  • Loading branch information
astrogeco and nmullane committed Aug 10, 2021
1 parent 600fd7a commit 20fbd6f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions modules/cfe_testcase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions modules/cfe_testcase/src/cfe_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
5 changes: 1 addition & 4 deletions modules/cfe_testcase/src/cfe_test_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions modules/cfe_testcase/src/cfe_test_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
*/
#include "cfe_test.h"

CFE_FT_Global_t CFE_FT_Global;

void RegisterTestTable(void);
void UnregisterTestTable(void);

Expand Down

0 comments on commit 20fbd6f

Please sign in to comment.