Skip to content

Commit

Permalink
Fix nasa#51, externalize symbols in lc_test_utils.h
Browse files Browse the repository at this point in the history
Make the table objects in this header "extern" and instantiate them in
the C file instead.  This solves the duplicate symbol linker errors.
  • Loading branch information
jphickey committed Dec 1, 2022
1 parent 543cf6b commit 6b0ec3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions unit-test/utilities/lc_test_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
#include "utassert.h"
#include "utstubs.h"

LC_WDTEntry_t WDTable[LC_MAX_WATCHPOINTS];
LC_ADTEntry_t ADTable[LC_MAX_ACTIONPOINTS];
LC_WRTEntry_t WRTable[LC_MAX_WATCHPOINTS];
LC_ARTEntry_t ARTable[LC_MAX_ACTIONPOINTS];

#define UT_MAX_SENDEVENT_DEPTH 4
CFE_EVS_SendEvent_context_t context_CFE_EVS_SendEvent[UT_MAX_SENDEVENT_DEPTH];
CFE_ES_WriteToSysLog_context_t context_CFE_ES_WriteToSysLog;
Expand Down
8 changes: 4 additions & 4 deletions unit-test/utilities/lc_test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ extern LC_AppData_t LC_AppData;
extern LC_OperData_t LC_OperData;

/* Global table variables for table pointers contained in LC_OperData */
LC_WDTEntry_t WDTable[LC_MAX_WATCHPOINTS];
LC_ADTEntry_t ADTable[LC_MAX_ACTIONPOINTS];
LC_WRTEntry_t WRTable[LC_MAX_WATCHPOINTS];
LC_ARTEntry_t ARTable[LC_MAX_ACTIONPOINTS];
extern LC_WDTEntry_t WDTable[LC_MAX_WATCHPOINTS];
extern LC_ADTEntry_t ADTable[LC_MAX_ACTIONPOINTS];
extern LC_WRTEntry_t WRTable[LC_MAX_WATCHPOINTS];
extern LC_ARTEntry_t ARTable[LC_MAX_ACTIONPOINTS];

/*
* Global context structures
Expand Down

0 comments on commit 6b0ec3c

Please sign in to comment.