Skip to content

Commit

Permalink
Fix nasa#1780, RTEMS CFE_FT_Global build failure
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
astrogeco and nmullane committed Aug 9, 2021
1 parent 600fd7a commit 1f461fe
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 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
2 changes: 1 addition & 1 deletion modules/cfe_testcase/src/tbl_content_access_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void TestGetReleaseAddresses(void)
}

void TBLContentAccessTestSetup(void)
{
{
UtTest_Add(TestGetAddress, RegisterTestTable, NULL, "Test Table Get Address");
UtTest_Add(TestReleaseAddress, RegisterTestTable, NULL, "Test Table Release Address");
UtTest_Add(TestGetReleaseAddresses, NULL, NULL, "Test Table Get and Release Addresses");
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_testcase/src/tbl_content_mang_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void TestModified(void)
}

void TBLContentMangTestSetup(void)
{
{
UtTest_Add(TestLoad, RegisterTestTable, UnregisterTestTable, "Test Table Load");
UtTest_Add(TestUpdate, RegisterTestTable, UnregisterTestTable, "Test Table Update");
UtTest_Add(TestValidate, RegisterTestTable, UnregisterTestTable, "Test Table Validate");
Expand Down
2 changes: 1 addition & 1 deletion modules/cfe_testcase/src/tbl_registration_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void TestTableShare(void)
}

void TBLRegistrationTestSetup(void)
{
{
UtTest_Add(TestTableRegistration, NULL, NULL, "Test Table Registration");
UtTest_Add(TestTableShare, NULL, NULL, "Test Table Sharing");
}

0 comments on commit 1f461fe

Please sign in to comment.