diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml
new file mode 100644
index 0000000..4142b77
--- /dev/null
+++ b/.github/workflows/add-to-project.yml
@@ -0,0 +1,13 @@
+name: Add Issue or PR to Project
+
+on:
+ issues:
+ types: [opened]
+ pull_request_target:
+ types: [opened, ready_for_review, converted_to_draft]
+
+jobs:
+ add-to-project:
+ name: Add issue or pull request to project
+ uses: nasa/cFS/.github/workflows/add-to-project-reusable.yml@dev
+ secrets: inherit
\ No newline at end of file
diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml
index 9723b29..68781bf 100644
--- a/.github/workflows/build-documentation.yml
+++ b/.github/workflows/build-documentation.yml
@@ -1,4 +1,4 @@
-name: Build and Deploy Documentation
+name: Build Documentation
on:
push:
@@ -15,9 +15,8 @@ on:
jobs:
build-documentation:
name: Build and deploy cFS documents
- uses: nasa/cFS/.github/workflows/build-deploy-doc.yml@main
+ uses: nasa/cFS/.github/workflows/build-doc-reusable.yml@dev
with:
target: "[\"mm-usersguide\"]"
app-name: mm
- buildpdf: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
- deploy: ${{ github.event_name == 'push' && contains(github.ref, 'main')}}
+ buildpdf: ${{ github.event_name == 'push' && (contains(github.ref, 'main') || contains(github.ref, 'dev')) }}
diff --git a/.github/workflows/build-run-app.yml b/.github/workflows/build-run-app.yml
index b780d37..a3b6a58 100644
--- a/.github/workflows/build-run-app.yml
+++ b/.github/workflows/build-run-app.yml
@@ -11,8 +11,11 @@ on:
- reopened
- synchronize
workflow_dispatch:
+ schedule:
+ # 9:35 PM UTC every Sunday
+ - cron: '35 21 * * 0'
jobs:
build-run:
name: Build and run with startup msg verification
- uses: nasa/cFS/.github/workflows/build-run-app.yml@main
+ uses: nasa/cFS/.github/workflows/build-run-app-reusable.yml@dev
diff --git a/.github/workflows/codeql-build.yml b/.github/workflows/codeql-build.yml
index a0133c8..5f56327 100644
--- a/.github/workflows/codeql-build.yml
+++ b/.github/workflows/codeql-build.yml
@@ -16,11 +16,8 @@ on:
jobs:
codeql:
name: Codeql Analysis
- uses: nasa/cFS/.github/workflows/codeql-reusable.yml@main
+ uses: nasa/cFS/.github/workflows/codeql-reusable.yml@dev
with:
component-path: apps/mm
prep: 'make prep; make -C build/tools/elf2cfetbl'
make: 'make -C build/native/default_cpu1/apps/mm'
- setup: |
- cp ./cfe/cmake/Makefile.sample Makefile && cp -r ./cfe/cmake/sample_defs sample_defs
- sed -i "/list(APPEND MISSION_GLOBAL_APPLIST/a list(APPEND MISSION_GLOBAL_APPLIST mm)" sample_defs/targets.cmake
diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml
index 441199a..a47839d 100644
--- a/.github/workflows/format-check.yml
+++ b/.github/workflows/format-check.yml
@@ -2,13 +2,18 @@ name: Format Check
# Run on all push and pull requests
on:
+ push:
+ branches:
+ - dev
+ - main
pull_request:
types:
- opened
- reopened
- synchronize
+ workflow_dispatch:
jobs:
format-check:
name: Run format check
- uses: nasa/cFS/.github/workflows/format-check.yml@main
+ uses: nasa/cFS/.github/workflows/format-check.yml@dev
diff --git a/.github/workflows/mcdc.yml b/.github/workflows/mcdc.yml
new file mode 100644
index 0000000..579207f
--- /dev/null
+++ b/.github/workflows/mcdc.yml
@@ -0,0 +1,20 @@
+name: MCDC Analysis
+
+on:
+ push:
+ branches:
+ - dev
+ - main
+ pull_request:
+ types:
+ - opened
+ - reopened
+ - synchronize
+ workflow_dispatch:
+
+jobs:
+ mcdc:
+ name: Run MCDC Analysis
+ uses: nasa/cFS/.github/workflows/mcdc-reusable.yml@dev
+ with:
+ app-name: 'mm'
\ No newline at end of file
diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml
index 800c300..9c279a0 100644
--- a/.github/workflows/static-analysis.yml
+++ b/.github/workflows/static-analysis.yml
@@ -15,7 +15,5 @@ on:
jobs:
static-analysis:
- name: Run cppcheck
- uses: nasa/cFS/.github/workflows/static-analysis.yml@main
- with:
- strict-dir-list: './fsw'
+ name: Static Analysis
+ uses: nasa/cFS/.github/workflows/app-static-analysis-reusable.yml@dev
\ No newline at end of file
diff --git a/.github/workflows/unit-test-coverage.yml b/.github/workflows/unit-test-coverage.yml
index 5056711..6172d6b 100644
--- a/.github/workflows/unit-test-coverage.yml
+++ b/.github/workflows/unit-test-coverage.yml
@@ -11,8 +11,11 @@ on:
- reopened
- synchronize
workflow_dispatch:
+ schedule:
+ # 9:25 PM UTC every Sunday
+ - cron: '25 21 * * 0'
jobs:
unit-test-coverage:
name: Run unit test and coverage
- uses: nasa/cFS/.github/workflows/unit-test-coverage.yml@main
+ uses: nasa/cFS/.github/workflows/unit-test-coverage-reusable.yml@dev
diff --git a/config/default_mm_extern_typedefs.h b/config/default_mm_extern_typedefs.h
index 97a841a..82e53d9 100644
--- a/config/default_mm_extern_typedefs.h
+++ b/config/default_mm_extern_typedefs.h
@@ -32,26 +32,27 @@
/* ======== */
typedef CFE_ES_MemAddress_t MM_MemAddress_t;
-typedef uint32 MM_MemSize_t;
+typedef uint32 MM_MemSize_t;
/**
* @brief Last Action Identifiers
*/
-enum {
- MM_LastAction_NOACTION = 0, /**< \brief Used to clear out HK action variable */
- MM_LastAction_PEEK = 1, /**< \brief Peek action */
- MM_LastAction_POKE = 2, /**< \brief Poke action */
- MM_LastAction_LOAD_FROM_FILE = 3, /**< \brief Load from file action */
- MM_LastAction_LOAD_WID = 4, /**< \brief Load with interrupts disabled action */
- MM_LastAction_DUMP_TO_FILE = 5, /**< \brief Dump to file action */
- MM_LastAction_DUMP_INEVENT = 6, /**< \brief Dump in event action */
- MM_LastAction_FILL = 7, /**< \brief Fill action */
- MM_LastAction_SYM_LOOKUP = 8, /**< \brief Symbol lookup action */
- MM_LastAction_SYMTBL_SAVE = 9, /**< \brief Dump symbol table to file action */
- MM_LastAction_EEPROMWRITE_ENA = 10, /**< \brief EEPROM write enable action */
- MM_LastAction_EEPROMWRITE_DIS = 11, /**< \brief EEPROM write disable action */
- MM_LastAction_NOOP = 12, /**< \brief No-op action */
- MM_LastAction_RESET = 13 /**< \brief Reset counters action */
+enum
+{
+ MM_LastAction_NOACTION = 0, /**< \brief Used to clear out HK action variable */
+ MM_LastAction_PEEK = 1, /**< \brief Peek action */
+ MM_LastAction_POKE = 2, /**< \brief Poke action */
+ MM_LastAction_LOAD_FROM_FILE = 3, /**< \brief Load from file action */
+ MM_LastAction_LOAD_WID = 4, /**< \brief Load with interrupts disabled action */
+ MM_LastAction_DUMP_TO_FILE = 5, /**< \brief Dump to file action */
+ MM_LastAction_DUMP_INEVENT = 6, /**< \brief Dump in event action */
+ MM_LastAction_FILL = 7, /**< \brief Fill action */
+ MM_LastAction_SYM_LOOKUP = 8, /**< \brief Symbol lookup action */
+ MM_LastAction_SYMTBL_SAVE = 9, /**< \brief Dump symbol table to file action */
+ MM_LastAction_EEPROMWRITE_ENA = 10, /**< \brief EEPROM write enable action */
+ MM_LastAction_EEPROMWRITE_DIS = 11, /**< \brief EEPROM write disable action */
+ MM_LastAction_NOOP = 12, /**< \brief No-op action */
+ MM_LastAction_RESET = 13 /**< \brief Reset counters action */
};
typedef uint8 MM_LastAction_Enum_t;
@@ -59,22 +60,24 @@ typedef uint8 MM_LastAction_Enum_t;
/**
* \brief Memory Types
*/
-typedef enum {
- MM_MemType_NOMEMTYPE = 0, /**< \brief Used to indicate that no memtype specified */
- MM_MemType_RAM = 1, /**< \brief Normal RAM, no special access required */
- MM_MemType_EEPROM = 2, /**< \brief EEPROM, requires special access for writes */
- MM_MemType_MEM8 = 3, /**< \brief Optional memory type that is only 8-bit read/write */
- MM_MemType_MEM16 = 4, /**< \brief Optional memory type that is only 16-bit read/write */
- MM_MemType_MEM32 = 5 /**< \brief Optional memory type that is only 32-bit read/write */
+typedef enum
+{
+ MM_MemType_NOMEMTYPE = 0, /**< \brief Used to indicate that no memtype specified */
+ MM_MemType_RAM = 1, /**< \brief Normal RAM, no special access required */
+ MM_MemType_EEPROM = 2, /**< \brief EEPROM, requires special access for writes */
+ MM_MemType_MEM8 = 3, /**< \brief Optional memory type that is only 8-bit read/write */
+ MM_MemType_MEM16 = 4, /**< \brief Optional memory type that is only 16-bit read/write */
+ MM_MemType_MEM32 = 5 /**< \brief Optional memory type that is only 32-bit read/write */
} MM_MemType_Enum_t;
/**
* \brief Symbolic Address Type
*/
-typedef struct {
- MM_MemAddress_t Offset; /**< \brief Optional offset that is used as the
- absolute address if the SymName string is NUL */
- char SymName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Symbol name string */
+typedef struct
+{
+ MM_MemAddress_t Offset; /**< \brief Optional offset that is used as the
+ absolute address if the SymName string is NUL */
+ char SymName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Symbol name string */
} MM_SymAddr_t;
#endif /* DEFAULT_MM_EXTERN_TYPEDEFS_H */
\ No newline at end of file
diff --git a/config/default_mm_fcncode_values.h b/config/default_mm_fcncode_values.h
index 04bf57d..27b207c 100644
--- a/config/default_mm_fcncode_values.h
+++ b/config/default_mm_fcncode_values.h
@@ -38,20 +38,21 @@
/* Typedefs */
/* ======== */
-enum MM_FunctionCode {
- MM_FunctionCode_NOOP = 0,
- MM_FunctionCode_RESET = 1,
- MM_FunctionCode_PEEK = 2,
- MM_FunctionCode_POKE = 3,
- MM_FunctionCode_LOAD_MEM_WID = 4,
- MM_FunctionCode_LOAD_MEM_FROM_FILE = 5,
- MM_FunctionCode_DUMP_MEM_TO_FILE = 6,
- MM_FunctionCode_DUMP_IN_EVENT = 7,
- MM_FunctionCode_FILL_MEM = 8,
- MM_FunctionCode_LOOKUP_SYM = 9,
- MM_FunctionCode_SYMTBL_TO_FILE = 10,
- MM_FunctionCode_ENABLE_EEPROM_WRITE = 11,
- MM_FunctionCode_DISABLE_EEPROM_WRITE = 12,
+enum MM_FunctionCode
+{
+ MM_FunctionCode_NOOP = 0,
+ MM_FunctionCode_RESET = 1,
+ MM_FunctionCode_PEEK = 2,
+ MM_FunctionCode_POKE = 3,
+ MM_FunctionCode_LOAD_MEM_WID = 4,
+ MM_FunctionCode_LOAD_MEM_FROM_FILE = 5,
+ MM_FunctionCode_DUMP_MEM_TO_FILE = 6,
+ MM_FunctionCode_DUMP_IN_EVENT = 7,
+ MM_FunctionCode_FILL_MEM = 8,
+ MM_FunctionCode_LOOKUP_SYM = 9,
+ MM_FunctionCode_SYMTBL_TO_FILE = 10,
+ MM_FunctionCode_ENABLE_EEPROM_WRITE = 11,
+ MM_FunctionCode_DISABLE_EEPROM_WRITE = 12,
};
#endif /* DEFAULT_MM_FCNCODE_VALUES_H */
\ No newline at end of file
diff --git a/config/default_mm_filedefs.h b/config/default_mm_filedefs.h
index b790675..c13aeb6 100644
--- a/config/default_mm_filedefs.h
+++ b/config/default_mm_filedefs.h
@@ -41,13 +41,14 @@
* and restore capability). This MM header is the secondary header, the
* standard cFE file header is primary header for all load and dump files.
*/
-typedef struct {
- MM_SymAddr_t SymAddress; /**< \brief Symbolic load address or fully resolved
- dump address */
- uint32 NumOfBytes; /**< \brief Bytes to load or bytes dumped */
- uint32 Crc; /**< \brief CRC value for load or dump data */
- MM_MemType_Enum_t MemType; /**< \brief Memory type used */
- uint8 Spare[3]; /**< \brief Structure Padding */
+typedef struct
+{
+ MM_SymAddr_t SymAddress; /**< \brief Symbolic load address or fully resolved
+ dump address */
+ uint32 NumOfBytes; /**< \brief Bytes to load or bytes dumped */
+ uint32 Crc; /**< \brief CRC value for load or dump data */
+ MM_MemType_Enum_t MemType; /**< \brief Memory type used */
+ uint8 Spare[3]; /**< \brief Structure Padding */
} MM_LoadDumpFileHeader_t;
#endif
diff --git a/config/default_mm_msgdefs.h b/config/default_mm_msgdefs.h
index 5a6a5e7..d1b551d 100644
--- a/config/default_mm_msgdefs.h
+++ b/config/default_mm_msgdefs.h
@@ -40,123 +40,134 @@
/**
* \brief Memory Peek Command Payload
*/
-typedef struct {
- MM_MemSize_t DataSize; /**< \brief Size of the data to be read */
- MM_MemType_Enum_t MemType; /**< \brief Memory type to peek data from */
- MM_SymAddr_t SrcSymAddress; /**< \brief Symbolic source peek address */
+typedef struct
+{
+ MM_MemSize_t DataSize; /**< \brief Size of the data to be read */
+ MM_MemType_Enum_t MemType; /**< \brief Memory type to peek data from */
+ MM_SymAddr_t SrcSymAddress; /**< \brief Symbolic source peek address */
} MM_PeekCmd_Payload_t;
/**
* \brief Memory Poke Command Payload
*/
-typedef struct {
- MM_MemSize_t DataSize; /**< \brief Size of the data to be written */
- MM_MemType_Enum_t MemType; /**< \brief Memory type to poke data to */
- uint32 Data; /**< \brief Data to be written */
- uint8 Padding2[4]; /**< \brief Structure padding */
- MM_SymAddr_t DestSymAddress; /**< \brief Symbolic destination poke address */
+typedef struct
+{
+ MM_MemSize_t DataSize; /**< \brief Size of the data to be written */
+ MM_MemType_Enum_t MemType; /**< \brief Memory type to poke data to */
+ uint32 Data; /**< \brief Data to be written */
+ uint8 Padding2[4]; /**< \brief Structure padding */
+ MM_SymAddr_t DestSymAddress; /**< \brief Symbolic destination poke address */
} MM_PokeCmd_Payload_t;
/**
* \brief Memory Load With Interrupts Disabled Command Payload
*/
-typedef struct {
- uint8 NumOfBytes; /**< \brief Number of bytes to be loaded */
- uint8 Padding[3]; /**< \brief Structure padding */
- uint32 Crc; /**< \brief Data check value */
- MM_SymAddr_t DestSymAddress; /**< \brief Symbolic destination load address */
- uint8 DataArray[MM_INTERFACE_MAX_UNINTERRUPTIBLE_DATA]; /**< \brief Data to be
- loaded */
+typedef struct
+{
+ uint8 NumOfBytes; /**< \brief Number of bytes to be loaded */
+ uint8 Padding[3]; /**< \brief Structure padding */
+ uint32 Crc; /**< \brief Data check value */
+ MM_SymAddr_t DestSymAddress; /**< \brief Symbolic destination load address */
+ uint8 DataArray[MM_INTERFACE_MAX_UNINTERRUPTIBLE_DATA]; /**< \brief Data to be
+ loaded */
} MM_LoadMemWIDCmd_Payload_t;
/**
* \brief Dump Memory In Event Message Command Payload
*/
-typedef struct {
- MM_MemType_Enum_t MemType; /**< \brief Memory dump type */
- uint8 NumOfBytes; /**< \brief Number of bytes to be dumped */
- uint8 Padding[3]; /**< \brief Structure padding */
- MM_SymAddr_t SrcSymAddress; /**< \brief Symbolic source address */
+typedef struct
+{
+ MM_MemType_Enum_t MemType; /**< \brief Memory dump type */
+ uint8 NumOfBytes; /**< \brief Number of bytes to be dumped */
+ uint8 Padding[3]; /**< \brief Structure padding */
+ MM_SymAddr_t SrcSymAddress; /**< \brief Symbolic source address */
} MM_DumpInEventCmd_Payload_t;
/**
* \brief Memory Load From File Command Payload
*/
-typedef struct {
- char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Name of memory load file
- */
+typedef struct
+{
+ char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Name of memory load file
+ */
} MM_LoadMemFromFileCmd_Payload_t;
/**
* \brief Memory Dump To File Command Payload
*/
-typedef struct {
- MM_MemType_Enum_t MemType; /**< \brief Memory dump type */
- MM_MemSize_t NumOfBytes; /**< \brief Number of bytes to be dumped */
- MM_SymAddr_t SrcSymAddress; /**< \brief Symbol plus optional offset */
- char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Name of memory dump file
- */
+typedef struct
+{
+ MM_MemType_Enum_t MemType; /**< \brief Memory dump type */
+ MM_MemSize_t NumOfBytes; /**< \brief Number of bytes to be dumped */
+ MM_SymAddr_t SrcSymAddress; /**< \brief Symbol plus optional offset */
+ char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Name of memory dump file
+ */
} MM_DumpMemToFileCmd_Payload_t;
/**
* \brief Memory Fill Command Payload
*/
-typedef struct {
- MM_MemType_Enum_t MemType; /**< \brief Memory type */
- MM_MemSize_t NumOfBytes; /**< \brief Number of bytes to fill */
- uint32 FillPattern; /**< \brief Fill pattern to use */
- uint8 Padding[4]; /**< \brief Structure padding */
- MM_SymAddr_t DestSymAddress; /**< \brief Symbol plus optional offset */
+typedef struct
+{
+ MM_MemType_Enum_t MemType; /**< \brief Memory type */
+ MM_MemSize_t NumOfBytes; /**< \brief Number of bytes to fill */
+ uint32 FillPattern; /**< \brief Fill pattern to use */
+ uint8 Padding[4]; /**< \brief Structure padding */
+ MM_SymAddr_t DestSymAddress; /**< \brief Symbol plus optional offset */
} MM_FillMemCmd_Payload_t;
/**
* \brief Symbol Table Lookup Command Payload
*/
-typedef struct {
- char SymName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Symbol name string */
+typedef struct
+{
+ char SymName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Symbol name string */
} MM_LookupSymCmd_Payload_t;
/**
* \brief Save Symbol Table To File Command Payload
*/
-typedef struct {
- char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Name of symbol dump file
- */
+typedef struct
+{
+ char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Name of symbol dump file
+ */
} MM_SymTblToFileCmd_Payload_t;
/**
* \brief EEPROM Write Enable Command Payload
*/
-typedef struct {
- uint32 Bank; /**< \brief EEPROM bank number to write-enable */
+typedef struct
+{
+ uint32 Bank; /**< \brief EEPROM bank number to write-enable */
} MM_EepromWriteEnaCmd_Payload_t;
/**
* \brief EEPROM Write Disable Command Payload
*/
-typedef struct {
- uint32 Bank; /**< \brief EEPROM bank number to write-disable */
+typedef struct
+{
+ uint32 Bank; /**< \brief EEPROM bank number to write-disable */
} MM_EepromWriteDisCmd_Payload_t;
/**
* \brief Housekeeping Packet Payload Structure
*/
-typedef struct {
- uint8 CmdCounter; /**< \brief MM Application Command Counter */
- uint8 ErrCounter; /**< \brief MM Application Command Error Counter */
- uint8 LastAction; /**< \brief Last command action executed */
- uint8 Padding; /**< \brief Last command action executed */
- MM_MemType_Enum_t MemType; /**< \brief Memory type for last command */
- MM_MemAddress_t
- Address; /**< \brief Fully resolved address used for last command */
- uint32 DataValue; /**< \brief Last command data (fill pattern or peek/poke
- value) */
- MM_MemSize_t BytesProcessed; /**< \brief Bytes processed for last command */
- char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Name of the data file
- used for last command, where
- applicable */
+typedef struct
+{
+ uint8 CommandCounter; /**< \brief MM Application Command Counter */
+ uint8 CommandErrorCounter; /**< \brief MM Application Command Error Counter */
+ uint8 LastAction; /**< \brief Last command action executed */
+ uint8 Padding;
+ MM_MemType_Enum_t MemType; /**< \brief Memory type for last command */
+ MM_MemAddress_t Address; /**< \brief Fully resolved address used for last command */
+ uint32 DataValue; /**< \brief Last command data (fill pattern or peek/poke
+ value) */
+ MM_MemSize_t BytesProcessed; /**< \brief Bytes processed for last command */
+ char FileName[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Name of the data file
+ used for last command, where
+ applicable */
} MM_HkTlm_Payload_t;
#endif /* DEFAULT_MM_MSGDEFS_H */
-/**\}*/
\ No newline at end of file
+/**\}*/
diff --git a/config/default_mm_msgid_values.h b/config/default_mm_msgid_values.h
index 7afb702..1327197 100644
--- a/config/default_mm_msgid_values.h
+++ b/config/default_mm_msgid_values.h
@@ -33,9 +33,7 @@
/* Macros */
/* ====== */
-#define MM_CMD_PLATFORM_MIDVAL(x) \
- CFE_PLATFORM_CMD_TOPICID_TO_MIDV(MM_MISSION_##x##_TOPICID)
-#define MM_TLM_PLATFORM_MIDVAL(x) \
- CFE_PLATFORM_TLM_TOPICID_TO_MIDV(MM_MISSION_##x##_TOPICID)
+#define MM_CMD_PLATFORM_MIDVAL(x) CFE_PLATFORM_CMD_TOPICID_TO_MIDV(MM_MISSION_##x##_TOPICID)
+#define MM_TLM_PLATFORM_MIDVAL(x) CFE_PLATFORM_TLM_TOPICID_TO_MIDV(MM_MISSION_##x##_TOPICID)
#endif
\ No newline at end of file
diff --git a/config/default_mm_msgids.h b/config/default_mm_msgids.h
index a862b9e..21f281c 100644
--- a/config/default_mm_msgids.h
+++ b/config/default_mm_msgids.h
@@ -39,7 +39,7 @@
* \{
*/
-#define MM_CMD_MID MM_CMD_PLATFORM_MIDVAL(CMD)
+#define MM_CMD_MID MM_CMD_PLATFORM_MIDVAL(CMD)
#define MM_SEND_HK_MID MM_CMD_PLATFORM_MIDVAL(SEND_HK)
/** \} */
diff --git a/config/default_mm_msgstruct.h b/config/default_mm_msgstruct.h
index 6b66b1f..ffc145b 100644
--- a/config/default_mm_msgstruct.h
+++ b/config/default_mm_msgstruct.h
@@ -40,8 +40,9 @@
*
* For command details see #MM_NOOP_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
} MM_NoopCmd_t;
/**
@@ -49,8 +50,9 @@ typedef struct {
*
* For command details see #MM_RESET_COUNTERS_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
} MM_ResetCountersCmd_t;
/**
@@ -58,9 +60,10 @@ typedef struct {
*
* For command details see #MM_PEEK_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
- MM_PeekCmd_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+ MM_PeekCmd_Payload_t Payload;
} MM_PeekCmd_t;
/**
@@ -68,9 +71,10 @@ typedef struct {
*
* For command details see #MM_POKE_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
- MM_PokeCmd_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+ MM_PokeCmd_Payload_t Payload;
} MM_PokeCmd_t;
/**
@@ -78,9 +82,10 @@ typedef struct {
*
* For command details see #MM_LOAD_MEM_WID_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
- MM_LoadMemWIDCmd_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+ MM_LoadMemWIDCmd_Payload_t Payload;
} MM_LoadMemWIDCmd_t;
/**
@@ -88,9 +93,10 @@ typedef struct {
*
* For command details see #MM_DUMP_IN_EVENT_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
- MM_DumpInEventCmd_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+ MM_DumpInEventCmd_Payload_t Payload;
} MM_DumpInEventCmd_t;
/**
@@ -98,9 +104,10 @@ typedef struct {
*
* For command details see #MM_LOAD_MEM_FROM_FILE_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
- MM_LoadMemFromFileCmd_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+ MM_LoadMemFromFileCmd_Payload_t Payload;
} MM_LoadMemFromFileCmd_t;
/**
@@ -108,9 +115,10 @@ typedef struct {
*
* For command details see #MM_DUMP_MEM_TO_FILE_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
- MM_DumpMemToFileCmd_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+ MM_DumpMemToFileCmd_Payload_t Payload;
} MM_DumpMemToFileCmd_t;
/**
@@ -118,9 +126,10 @@ typedef struct {
*
* For command details see #MM_FILL_MEM_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
- MM_FillMemCmd_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+ MM_FillMemCmd_Payload_t Payload;
} MM_FillMemCmd_t;
/**
@@ -128,9 +137,10 @@ typedef struct {
*
* For command details see #MM_LOOKUP_SYM_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
- MM_LookupSymCmd_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+ MM_LookupSymCmd_Payload_t Payload;
} MM_LookupSymCmd_t;
/**
@@ -138,9 +148,10 @@ typedef struct {
*
* For command details see #MM_SYM_TBL_TO_FILE_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
- MM_SymTblToFileCmd_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+ MM_SymTblToFileCmd_Payload_t Payload;
} MM_SymTblToFileCmd_t;
/**
@@ -148,9 +159,10 @@ typedef struct {
*
* For command details see #MM_EEPROM_WRITE_ENA_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
- MM_EepromWriteEnaCmd_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+ MM_EepromWriteEnaCmd_Payload_t Payload;
} MM_EepromWriteEnaCmd_t;
/**
@@ -158,24 +170,27 @@ typedef struct {
*
* For command details see #MM_EEPROM_WRITE_DIS_CC
*/
-typedef struct {
- CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
- MM_EepromWriteDisCmd_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_CommandHeader_t CommandHeader; /**< \brief Command header */
+ MM_EepromWriteDisCmd_Payload_t Payload;
} MM_EepromWriteDisCmd_t;
/**
* \brief Housekeeping Packet Structure
*/
-typedef struct {
- CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */
- MM_HkTlm_Payload_t Payload;
+typedef struct
+{
+ CFE_MSG_TelemetryHeader_t TelemetryHeader; /**< \brief Telemetry header */
+ MM_HkTlm_Payload_t Payload;
} MM_HkTlm_t;
/**
* \brief Housekeeping Request Command
*/
-typedef struct {
- CFE_MSG_TelemetryHeader_t TelemetryHeader;
+typedef struct
+{
+ CFE_MSG_TelemetryHeader_t TelemetryHeader;
} MM_SendHkCmd_t;
#endif /* DEFAULT_MM_MSGSTRUCT_H */
diff --git a/config/default_mm_perfids.h b/config/default_mm_perfids.h
index c3a4ab3..20cca05 100644
--- a/config/default_mm_perfids.h
+++ b/config/default_mm_perfids.h
@@ -24,12 +24,10 @@
#ifndef DEFAULT_MM_PERFIDS_H
#define DEFAULT_MM_PERFIDS_H
-#define MM_APPMAIN_PERF_ID 30 /**< \brief Application main performance ID */
-#define MM_SEGBREAK_PERF_ID \
- 31 /**< \brief Memory processing segment break performance ID */
-#define MM_EEPROM_POKE_PERF_ID 32 /**< \brief EEPROM poke performance ID */
-#define MM_EEPROM_FILELOAD_PERF_ID \
- 33 /**< \brief EEPROM file load performance ID */
-#define MM_EEPROM_FILL_PERF_ID 34 /**< \brief EEPROM fill performance ID */
+#define MM_APPMAIN_PERF_ID 30 /**< \brief Application main performance ID */
+#define MM_SEGBREAK_PERF_ID 31 /**< \brief Memory processing segment break performance ID */
+#define MM_EEPROM_POKE_PERF_ID 32 /**< \brief EEPROM poke performance ID */
+#define MM_EEPROM_FILELOAD_PERF_ID 33 /**< \brief EEPROM file load performance ID */
+#define MM_EEPROM_FILL_PERF_ID 34 /**< \brief EEPROM fill performance ID */
#endif /* DEFAULT_MM_PERFIDS_H */
\ No newline at end of file
diff --git a/eds/mm.xml b/eds/mm.xml
index 215903e..2064f1c 100644
--- a/eds/mm.xml
+++ b/eds/mm.xml
@@ -36,7 +36,7 @@
-
+
@@ -197,9 +197,10 @@
-
-
+
+
+
@@ -212,7 +213,7 @@
-
+
@@ -383,4 +384,4 @@
-
\ No newline at end of file
+
diff --git a/fsw/inc/mm_fcncodes.h b/fsw/inc/mm_fcncodes.h
index 9e190e1..b0c0498 100644
--- a/fsw/inc/mm_fcncodes.h
+++ b/fsw/inc/mm_fcncodes.h
@@ -46,7 +46,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - The #MM_NOOP_INF_EID informational event message will be
* generated when the command is received
*
@@ -55,7 +55,7 @@
* - Command packet length not as expected
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
*
* \par Criticality
@@ -77,8 +77,8 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will be cleared
- * - #MM_HkTlm_Payload_t.ErrCounter will be cleared
+ * - #MM_HkTlm_Payload_t.CommandCounter will be cleared
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will be cleared
* - The #MM_RESET_INF_EID informational event message will be
* generated when the command is executed
*
@@ -87,7 +87,7 @@
* - Command packet length not as expected
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
*
* \par Criticality
@@ -109,7 +109,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - #MM_HkTlm_Payload_t.LastAction will be set to #MM_LastAction_PEEK
* - #MM_HkTlm_Payload_t.MemType will be set to the commanded memory type
* - #MM_HkTlm_Payload_t.Address will be set to the fully resolved
@@ -135,7 +135,7 @@
* - The address and data size are not properly aligned
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_DATA_SIZE_BITS_ERR_EID
@@ -170,7 +170,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - #MM_HkTlm_Payload_t.LastAction will be set to #MM_LastAction_POKE
* - #MM_HkTlm_Payload_t.MemType will be set to the commanded memory type
* - #MM_HkTlm_Payload_t.Address will be set to the fully resolved source
@@ -197,7 +197,7 @@
* - An EEPROM write error occured
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_DATA_SIZE_BITS_ERR_EID
@@ -241,7 +241,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - #MM_HkTlm_Payload_t.LastAction will be set to #MM_LastAction_LOAD_WID
* - #MM_HkTlm_Payload_t.Address will be set to the fully resolved
* destination memory address
@@ -259,7 +259,7 @@
* - Invalid data size specified in command message
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_LOAD_WID_CRC_ERR_EID
@@ -296,7 +296,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - #MM_HkTlm_Payload_t.LastAction will be set to
* #MM_LastAction_LOAD_FROM_FILE
* - #MM_HkTlm_Payload_t.MemType will be set to the commanded memory type
@@ -326,7 +326,7 @@
* - The specified memory type is invalid
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_OS_OPEN_ERR_EID
* - Error specific event message #MM_OS_CLOSE_ERR_EID
@@ -374,7 +374,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - #MM_HkTlm_Payload_t.LastAction will be set to
* #MM_LastAction_DUMP_TO_FILE
* - #MM_HkTlm_Payload_t.MemType will be set to the commanded memory type
@@ -403,7 +403,7 @@
* - The specified memory type is invalid
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_OS_CREAT_ERR_EID
@@ -445,7 +445,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - #MM_HkTlm_Payload_t.LastAction will be set to
* #MM_LastAction_DUMP_INEVENT
* - #MM_HkTlm_Payload_t.MemType will be set to the commanded memory type
@@ -466,7 +466,7 @@
* - The specified memory type is invalid
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_OS_MEMVALIDATE_ERR_EID
@@ -502,7 +502,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - #MM_HkTlm_Payload_t.LastAction will be set to #MM_LastAction_FILL
* - #MM_HkTlm_Payload_t.MemType will be set to the commanded memory type
* - #MM_HkTlm_Payload_t.Address will be set to the fully resolved
@@ -523,7 +523,7 @@
* - The specified memory type is invalid
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
* - Error specific event message #MM_OS_MEMVALIDATE_ERR_EID
@@ -562,7 +562,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - #MM_HkTlm_Payload_t.LastAction will be set to
* #MM_LastAction_SYM_LOOKUP
* - #MM_HkTlm_Payload_t.Address will be set to the fully resolved memory
@@ -575,7 +575,7 @@
* - A symbol name was specified that can't be resolved
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMNAME_NUL_ERR_EID
* - Error specific event message #MM_SYMNAME_ERR_EID
@@ -600,7 +600,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - #MM_HkTlm_Payload_t.LastAction will be set to
* #MM_LastAction_SYMTBL_SAVE
* - #MM_HkTlm_Payload_t.FileName will be set to the dump file name
@@ -614,7 +614,7 @@
* - The OSAL returns a status other than success to the command
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_SYMFILENAME_NUL_ERR_EID
* - Error specific event message #MM_SYMTBL_TO_FILE_FAIL_ERR_EID
@@ -642,7 +642,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - #MM_HkTlm_Payload_t.LastAction will be set to
* #MM_LastAction_EEPROMWRITE_ENA
* - The #MM_EEPROM_WRITE_ENA_INF_EID informational event message will
@@ -654,7 +654,7 @@
* - Non-success return status from PSP write enable
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_EEPROM_WRITE_ENA_ERR_EID
*
@@ -681,7 +681,7 @@
* \par Command Verification
* Successful execution of this command may be verified with
* the following telemetry:
- * - #MM_HkTlm_Payload_t.CmdCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandCounter will increment
* - #MM_HkTlm_Payload_t.LastAction will be set to
* #MM_LastAction_EEPROMWRITE_DIS
* - The #MM_EEPROM_WRITE_DIS_INF_EID informational event message will
@@ -693,7 +693,7 @@
* - Non-success return status from PSP write disable
*
* \par Evidence of failure may be found in the following telemetry:
- * - #MM_HkTlm_Payload_t.ErrCounter will increment
+ * - #MM_HkTlm_Payload_t.CommandErrorCounter will increment
* - Error specific event message #MM_CMD_LEN_ERR_EID
* - Error specific event message #MM_EEPROM_WRITE_DIS_ERR_EID
*
@@ -706,4 +706,4 @@
/** \} */
-#endif /* MM_FCNCODES_H */
\ No newline at end of file
+#endif /* MM_FCNCODES_H */
diff --git a/fsw/inc/mm_interface_cfg.h b/fsw/inc/mm_interface_cfg.h
index cf3dc82..32b5913 100644
--- a/fsw/inc/mm_interface_cfg.h
+++ b/fsw/inc/mm_interface_cfg.h
@@ -48,8 +48,7 @@
* to avoid packet segmentation for the command protocal being
* used.
*/
-#define MM_INTERFACE_MAX_UNINTERRUPTIBLE_DATA \
- MM_INTERFACE_CFGVAL(MAX_UNINTERRUPTIBLE_DATA)
+#define MM_INTERFACE_MAX_UNINTERRUPTIBLE_DATA MM_INTERFACE_CFGVAL(MAX_UNINTERRUPTIBLE_DATA)
#define DEFAULT_MM_INTERFACE_MAX_UNINTERRUPTIBLE_DATA 200
#endif /* MM_INTERFACE_CFG_H */
\ No newline at end of file
diff --git a/fsw/inc/mm_internal_cfg.h b/fsw/inc/mm_internal_cfg.h
index 3bb9e90..57169b0 100644
--- a/fsw/inc/mm_internal_cfg.h
+++ b/fsw/inc/mm_internal_cfg.h
@@ -30,12 +30,11 @@
/* ====== */
/** \brief MM command pipe depth */
-#define MM_INTERNAL_CMD_PIPE_DEPTH MM_INTERNAL_CFGVAL(CMD_PIPE_DEPTH)
-#define DEFAULT_MM_INTERNAL_CMD_PIPE_DEPTH \
- (3 * CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT)
+#define MM_INTERNAL_CMD_PIPE_DEPTH MM_INTERNAL_CFGVAL(CMD_PIPE_DEPTH)
+#define DEFAULT_MM_INTERNAL_CMD_PIPE_DEPTH (3 * CFE_PLATFORM_SB_DEFAULT_MSG_LIMIT)
/** \brief MM command pipe name */
-#define MM_INTERNAL_CMD_PIPE_NAME MM_INTERNAL_CFGVAL(CMD_PIPE_NAME)
+#define MM_INTERNAL_CMD_PIPE_NAME MM_INTERNAL_CFGVAL(CMD_PIPE_NAME)
#define DEFAULT_MM_INTERNAL_CMD_PIPE_NAME "MM_CMD_PIPE"
/**
@@ -45,7 +44,7 @@
* Wakes up MM every 1 second for routine maintenance whether a
* message was received or not.
*/
-#define MM_INTERNAL_SB_TIMEOUT MM_INTERNAL_CFGVAL(SB_TIMEOUT)
+#define MM_INTERNAL_SB_TIMEOUT MM_INTERNAL_CFGVAL(SB_TIMEOUT)
#define DEFAULT_MM_INTERNAL_SB_TIMEOUT 1000
/**
@@ -59,7 +58,7 @@
* The file header data type for the value is 32 bits unsigned,
* thus the value can be anything from zero to 4,294,967,295.
*/
-#define MM_INTERNAL_CFE_HDR_SUBTYPE MM_INTERNAL_CFGVAL(CFE_HDR_SUBTYPE)
+#define MM_INTERNAL_CFE_HDR_SUBTYPE MM_INTERNAL_CFGVAL(CFE_HDR_SUBTYPE)
#define DEFAULT_MM_INTERNAL_CFE_HDR_SUBTYPE 0x4D4D5354
/**
@@ -73,7 +72,7 @@
* The string length (including string terminator) cannot exceed
* #CFE_FS_HDR_DESC_MAX_LEN. (limit is not verified)
*/
-#define MM_INTERNAL_CFE_HDR_DESCRIPTION MM_INTERNAL_CFGVAL(CFE_HDR_DESCRIPTION)
+#define MM_INTERNAL_CFE_HDR_DESCRIPTION MM_INTERNAL_CFGVAL(CFE_HDR_DESCRIPTION)
#define DEFAULT_MM_INTERNAL_CFE_HDR_DESCRIPTION "Memory Manager dump file"
/**
@@ -91,8 +90,7 @@
* requests since it cannot process such a request while a load
* or dump is in progress.
*/
-#define MM_INTERNAL_MAX_LOAD_FILE_DATA_RAM \
- MM_INTERNAL_CFGVAL(MAX_LOAD_FILE_DATA_RAM)
+#define MM_INTERNAL_MAX_LOAD_FILE_DATA_RAM MM_INTERNAL_CFGVAL(MAX_LOAD_FILE_DATA_RAM)
#define DEFAULT_MM_INTERNAL_MAX_LOAD_FILE_DATA_RAM (1024 * 1024)
/**
@@ -110,8 +108,7 @@
* requests since it cannot process such a request while a load
* or dump is in progress.
*/
-#define MM_INTERNAL_MAX_LOAD_FILE_DATA_EEPROM \
- MM_INTERNAL_CFGVAL(MAX_LOAD_FILE_DATA_EEPROM)
+#define MM_INTERNAL_MAX_LOAD_FILE_DATA_EEPROM MM_INTERNAL_CFGVAL(MAX_LOAD_FILE_DATA_EEPROM)
#define DEFAULT_MM_INTERNAL_MAX_LOAD_FILE_DATA_EEPROM (128 * 1024)
/**
@@ -127,7 +124,7 @@
* the amount of time available for other tasks to execute and
* increase MM CPU utilization during load operations.
*/
-#define MM_INTERNAL_MAX_LOAD_DATA_SEG MM_INTERNAL_CFGVAL(MAX_LOAD_DATA_SEG)
+#define MM_INTERNAL_MAX_LOAD_DATA_SEG MM_INTERNAL_CFGVAL(MAX_LOAD_DATA_SEG)
#define DEFAULT_MM_INTERNAL_MAX_LOAD_DATA_SEG 200
/**
@@ -145,8 +142,7 @@
* requests since it cannot process such a request while a load
* or dump is in progress.
*/
-#define MM_INTERNAL_MAX_DUMP_FILE_DATA_RAM \
- MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_RAM)
+#define MM_INTERNAL_MAX_DUMP_FILE_DATA_RAM MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_RAM)
#define DEFAULT_MM_INTERNAL_MAX_DUMP_FILE_DATA_RAM (1024 * 1024)
/**
@@ -164,8 +160,7 @@
* requests since it cannot process such a request while a load
* or dump is in progress.
*/
-#define MM_INTERNAL_MAX_DUMP_FILE_DATA_EEPROM \
- MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_EEPROM)
+#define MM_INTERNAL_MAX_DUMP_FILE_DATA_EEPROM MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_EEPROM)
#define DEFAULT_MM_INTERNAL_MAX_DUMP_FILE_DATA_EEPROM (128 * 1024)
/**
@@ -181,8 +176,7 @@
* However, setting this value to a large number will impact
* the OSAL since it is responsible for generating the dump file.
*/
-#define MM_INTERNAL_MAX_DUMP_FILE_DATA_SYMTBL \
- MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_SYMTBL)
+#define MM_INTERNAL_MAX_DUMP_FILE_DATA_SYMTBL MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_SYMTBL)
#define DEFAULT_MM_INTERNAL_MAX_DUMP_FILE_DATA_SYMTBL (128 * 1024)
/**
@@ -199,7 +193,7 @@
* the amount of time available for other tasks to execute and
* increase MM CPU utilization during dump operations.
*/
-#define MM_INTERNAL_MAX_DUMP_DATA_SEG MM_INTERNAL_CFGVAL(MAX_DUMP_DATA_SEG)
+#define MM_INTERNAL_MAX_DUMP_DATA_SEG MM_INTERNAL_CFGVAL(MAX_DUMP_DATA_SEG)
#define DEFAULT_MM_INTERNAL_MAX_DUMP_DATA_SEG 200
/**
@@ -217,7 +211,7 @@
* requests since it cannot process such a request while a fill
* operation is in progress.
*/
-#define MM_INTERNAL_MAX_FILL_DATA_RAM MM_INTERNAL_CFGVAL(MAX_FILL_DATA_RAM)
+#define MM_INTERNAL_MAX_FILL_DATA_RAM MM_INTERNAL_CFGVAL(MAX_FILL_DATA_RAM)
#define DEFAULT_MM_INTERNAL_MAX_FILL_DATA_RAM (1024 * 1024)
/**
@@ -235,8 +229,7 @@
* requests since it cannot process such a request while a fill
* operation is in progress.
*/
-#define MM_INTERNAL_MAX_FILL_DATA_EEPROM \
- MM_INTERNAL_CFGVAL(MAX_FILL_DATA_EEPROM)
+#define MM_INTERNAL_MAX_FILL_DATA_EEPROM MM_INTERNAL_CFGVAL(MAX_FILL_DATA_EEPROM)
#define DEFAULT_MM_INTERNAL_MAX_FILL_DATA_EEPROM (128 * 1024)
/**
@@ -253,7 +246,7 @@
* the amount of time available for other tasks to execute and
* increase MM CPU utilization during memory fill operations.
*/
-#define MM_INTERNAL_MAX_FILL_DATA_SEG MM_INTERNAL_CFGVAL(MAX_FILL_DATA_SEG)
+#define MM_INTERNAL_MAX_FILL_DATA_SEG MM_INTERNAL_CFGVAL(MAX_FILL_DATA_SEG)
#define DEFAULT_MM_INTERNAL_MAX_FILL_DATA_SEG 200
/**
@@ -284,8 +277,7 @@
* of MM being late responding to housekeeping requests since it
* cannot process such a request while a load or dump is in progress.
*/
-#define MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM32 \
- MM_INTERNAL_CFGVAL(MAX_LOAD_FILE_DATA_MEM32)
+#define MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM32 MM_INTERNAL_CFGVAL(MAX_LOAD_FILE_DATA_MEM32)
#define DEFAULT_MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM32 (1024 * 1024)
/**
@@ -303,8 +295,7 @@
* of MM being late responding to housekeeping requests since it
* cannot process such a request while a load or dump is in progress.
*/
-#define MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM32 \
- MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_MEM32)
+#define MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM32 MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_MEM32)
#define DEFAULT_MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM32 (1024 * 1024)
/**
@@ -323,7 +314,7 @@
* cannot process such a request while a memory fill operation
* is in progress.
*/
-#define MM_INTERNAL_MAX_FILL_DATA_MEM32 MM_INTERNAL_CFGVAL(MAX_FILL_DATA_MEM32)
+#define MM_INTERNAL_MAX_FILL_DATA_MEM32 MM_INTERNAL_CFGVAL(MAX_FILL_DATA_MEM32)
#define DEFAULT_MM_INTERNAL_MAX_FILL_DATA_MEM32 (1024 * 1024)
/**
@@ -354,8 +345,7 @@
* of MM being late responding to housekeeping requests since it
* cannot process such a request while a load or dump is in progress.
*/
-#define MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM16 \
- MM_INTERNAL_CFGVAL(MAX_LOAD_FILE_DATA_MEM16)
+#define MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM16 MM_INTERNAL_CFGVAL(MAX_LOAD_FILE_DATA_MEM16)
#define DEFAULT_MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM16 (1024 * 1024)
/**
@@ -371,8 +361,7 @@
* of MM being late responding to housekeeping requests since it
* cannot process such a request while a load or dump is in progress.
*/
-#define MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM16 \
- MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_MEM16)
+#define MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM16 MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_MEM16)
#define DEFAULT_MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM16 (1024 * 1024)
/**
@@ -391,7 +380,7 @@
* cannot process such a request while a memory fill operation
* is in progress.
*/
-#define MM_INTERNAL_MAX_FILL_DATA_MEM16 MM_INTERNAL_CFGVAL(MAX_FILL_DATA_MEM16)
+#define MM_INTERNAL_MAX_FILL_DATA_MEM16 MM_INTERNAL_CFGVAL(MAX_FILL_DATA_MEM16)
#define DEFAULT_MM_INTERNAL_MAX_FILL_DATA_MEM16 (1024 * 1024)
/**
@@ -420,8 +409,7 @@
* of MM being late responding to housekeeping requests since it
* cannot process such a request while a load or dump is in progress.
*/
-#define MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM8 \
- MM_INTERNAL_CFGVAL(MAX_LOAD_FILE_DATA_MEM8)
+#define MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM8 MM_INTERNAL_CFGVAL(MAX_LOAD_FILE_DATA_MEM8)
#define DEFAULT_MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM8 (1024 * 1024)
/**
@@ -437,8 +425,7 @@
* of MM being late responding to housekeeping requests since it
* cannot process such a request while a load or dump is in progress.
*/
-#define MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM8 \
- MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_MEM8)
+#define MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM8 MM_INTERNAL_CFGVAL(MAX_DUMP_FILE_DATA_MEM8)
#define DEFAULT_MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM8 (1024 * 1024)
/**
@@ -455,7 +442,7 @@
* cannot process such a request while a memory fill operation
* is in progress.
*/
-#define MM_INTERNAL_MAX_FILL_DATA_MEM8 MM_INTERNAL_CFGVAL(MAX_FILL_DATA_MEM8)
+#define MM_INTERNAL_MAX_FILL_DATA_MEM8 MM_INTERNAL_CFGVAL(MAX_FILL_DATA_MEM8)
#define DEFAULT_MM_INTERNAL_MAX_FILL_DATA_MEM8 (1024 * 1024)
/**
@@ -474,7 +461,7 @@
* to housekeeping requests since it cannot process such a request
* while a memory operation is in progress.
*/
-#define MM_INTERNAL_PROCESSOR_CYCLE MM_INTERNAL_CFGVAL(PROCESSOR_CYCLE)
+#define MM_INTERNAL_PROCESSOR_CYCLE MM_INTERNAL_CFGVAL(PROCESSOR_CYCLE)
#define DEFAULT_MM_INTERNAL_PROCESSOR_CYCLE 0
/**
@@ -491,7 +478,7 @@
* Must be defined as a numeric value that is greater than
* or equal to zero.
*/
-#define MM_INTERNAL_MISSION_REV MM_INTERNAL_CFGVAL(MISSION_REV)
+#define MM_INTERNAL_MISSION_REV MM_INTERNAL_CFGVAL(MISSION_REV)
#define DEFAULT_MM_INTERNAL_MISSION_REV 0
/**
@@ -507,10 +494,8 @@
* Message tail "from address: 0xFFFFFFFF" 33 characters including NUL on
* 64-bit system
*/
-#define MM_INTERNAL_MAX_DUMP_INEVENT_BYTES \
- MM_INTERNAL_CFGVAL(MAX_DUMP_INEVENT_BYTES)
-#define DEFAULT_MM_INTERNAL_MAX_DUMP_INEVENT_BYTES \
- ((CFE_MISSION_EVS_MAX_MESSAGE_LENGTH - (13 + 33)) / 5)
+#define MM_INTERNAL_MAX_DUMP_INEVENT_BYTES MM_INTERNAL_CFGVAL(MAX_DUMP_INEVENT_BYTES)
+#define DEFAULT_MM_INTERNAL_MAX_DUMP_INEVENT_BYTES ((CFE_MISSION_EVS_MAX_MESSAGE_LENGTH - (13 + 33)) / 5)
/**
* \brief Dump in an event scratch string size
@@ -519,8 +504,7 @@
* the dump in event message string. Set it to the size of the
* largest piece shown above including room for a NUL terminator.
*/
-#define MM_INTERNAL_DUMPINEVENT_TEMP_CHARS \
- MM_INTERNAL_CFGVAL(DUMPINEVENT_TEMP_CHARS)
+#define MM_INTERNAL_DUMPINEVENT_TEMP_CHARS MM_INTERNAL_CFGVAL(DUMPINEVENT_TEMP_CHARS)
#define DEFAULT_MM_INTERNAL_DUMPINEVENT_TEMP_CHARS 36
/**
@@ -534,7 +518,7 @@
* This must be one of the CRC types supported by the
* #CFE_ES_CalculateCRC function.
*/
-#define MM_INTERNAL_DUMP_FILE_CRC_TYPE MM_INTERNAL_CFGVAL(DUMP_FILE_CRC_TYPE)
+#define MM_INTERNAL_DUMP_FILE_CRC_TYPE MM_INTERNAL_CFGVAL(DUMP_FILE_CRC_TYPE)
#define DEFAULT_MM_INTERNAL_DUMP_FILE_CRC_TYPE CFE_MISSION_ES_DEFAULT_CRC
/**
@@ -548,7 +532,7 @@
* This must be one of the CRC types supported by the
* #CFE_ES_CalculateCRC function.
*/
-#define MM_INTERNAL_LOAD_WID_CRC_TYPE MM_INTERNAL_CFGVAL(LOAD_WID_CRC_TYPE)
+#define MM_INTERNAL_LOAD_WID_CRC_TYPE MM_INTERNAL_CFGVAL(LOAD_WID_CRC_TYPE)
#define DEFAULT_MM_INTERNAL_LOAD_WID_CRC_TYPE CFE_MISSION_ES_DEFAULT_CRC
/**
@@ -562,41 +546,36 @@
* This must be one of the CRC types supported by the
* #CFE_ES_CalculateCRC function.
*/
-#define MM_INTERNAL_LOAD_FILE_CRC_TYPE MM_INTERNAL_CFGVAL(LOAD_FILE_CRC_TYPE)
+#define MM_INTERNAL_LOAD_FILE_CRC_TYPE MM_INTERNAL_CFGVAL(LOAD_FILE_CRC_TYPE)
#define DEFAULT_MM_INTERNAL_LOAD_FILE_CRC_TYPE CFE_MISSION_ES_DEFAULT_CRC
/**
* \brief Misc Initialization Values
*/
-#define MM_INTERNAL_CLEAR_SYMNAME MM_INTERNAL_CFGVAL(CLEAR_SYMNAME)
-#define DEFAULT_MM_INTERNAL_CLEAR_SYMNAME \
- '\0' /**< \brief Used to clear out symbol name strings */
+#define MM_INTERNAL_CLEAR_SYMNAME MM_INTERNAL_CFGVAL(CLEAR_SYMNAME)
+#define DEFAULT_MM_INTERNAL_CLEAR_SYMNAME '\0' /**< \brief Used to clear out symbol name strings */
-#define MM_INTERNAL_CLEAR_FNAME MM_INTERNAL_CFGVAL(CLEAR_FNAME)
-#define DEFAULT_MM_INTERNAL_CLEAR_FNAME \
- '\0' /**< \brief Used to clear out file name strings */
+#define MM_INTERNAL_CLEAR_FNAME MM_INTERNAL_CFGVAL(CLEAR_FNAME)
+#define DEFAULT_MM_INTERNAL_CLEAR_FNAME '\0' /**< \brief Used to clear out file name strings */
-#define MM_INTERNAL_CLEAR_ADDR MM_INTERNAL_CFGVAL(CLEAR_ADDR)
-#define DEFAULT_MM_INTERNAL_CLEAR_ADDR \
- 0 /**< \brief Used to clear out memory address variables */
+#define MM_INTERNAL_CLEAR_ADDR MM_INTERNAL_CFGVAL(CLEAR_ADDR)
+#define DEFAULT_MM_INTERNAL_CLEAR_ADDR 0 /**< \brief Used to clear out memory address variables */
-#define MM_INTERNAL_CLEAR_PATTERN MM_INTERNAL_CFGVAL(CLEAR_PATTERN)
-#define DEFAULT_MM_INTERNAL_CLEAR_PATTERN \
- 0 /**< \brief Used to clear out fill and test patterns */
+#define MM_INTERNAL_CLEAR_PATTERN MM_INTERNAL_CFGVAL(CLEAR_PATTERN)
+#define DEFAULT_MM_INTERNAL_CLEAR_PATTERN 0 /**< \brief Used to clear out fill and test patterns */
/**
* \brief MM Data Sizes for Peeks and Pokes
*/
-#define MM_INTERNAL_BYTE_BIT_WIDTH MM_INTERNAL_CFGVAL(BYTE_BIT_WIDTH)
+#define MM_INTERNAL_BYTE_BIT_WIDTH MM_INTERNAL_CFGVAL(BYTE_BIT_WIDTH)
#define DEFAULT_MM_INTERNAL_BYTE_BIT_WIDTH 8 /**< \brief Byte bit width */
-#define MM_INTERNAL_WORD_BIT_WIDTH MM_INTERNAL_CFGVAL(WORD_BIT_WIDTH)
+#define MM_INTERNAL_WORD_BIT_WIDTH MM_INTERNAL_CFGVAL(WORD_BIT_WIDTH)
#define DEFAULT_MM_INTERNAL_WORD_BIT_WIDTH 16 /**< \brief Word bit width */
-#define MM_INTERNAL_DWORD_BIT_WIDTH MM_INTERNAL_CFGVAL(DWORD_BIT_WIDTH)
-#define DEFAULT_MM_INTERNAL_DWORD_BIT_WIDTH \
- 32 /**< \brief Double word bit width */
+#define MM_INTERNAL_DWORD_BIT_WIDTH MM_INTERNAL_CFGVAL(DWORD_BIT_WIDTH)
+#define DEFAULT_MM_INTERNAL_DWORD_BIT_WIDTH 32 /**< \brief Double word bit width */
#endif /* MM_INTERNAL_CFG_H */
\ No newline at end of file
diff --git a/fsw/inc/mm_topicids.h b/fsw/inc/mm_topicids.h
index e2eaa99..e4d004b 100644
--- a/fsw/inc/mm_topicids.h
+++ b/fsw/inc/mm_topicids.h
@@ -22,14 +22,14 @@
#include "mm_topicid_values.h"
/* Command topic IDs */
-#define MM_MISSION_CMD_TOPICID MM_MISSION_TIDVAL(CMD)
+#define MM_MISSION_CMD_TOPICID MM_MISSION_TIDVAL(CMD)
#define DEFAULT_MM_MISSION_CMD_TOPICID 0x88
-#define MM_MISSION_SEND_HK_TOPICID MM_MISSION_TIDVAL(SEND_HK)
+#define MM_MISSION_SEND_HK_TOPICID MM_MISSION_TIDVAL(SEND_HK)
#define DEFAULT_MM_MISSION_SEND_HK_TOPICID 0x89
/* Telemetry topic IDs */
-#define MM_MISSION_HK_TLM_TOPICID MM_MISSION_TIDVAL(HK_TLM)
+#define MM_MISSION_HK_TLM_TOPICID MM_MISSION_TIDVAL(HK_TLM)
#define DEFAULT_MM_MISSION_HK_TLM_TOPICID 0x87
#endif /* MM_TOPICIDS_H */
\ No newline at end of file
diff --git a/fsw/src/mm_app.c b/fsw/src/mm_app.c
index afc573d..d2803db 100644
--- a/fsw/src/mm_app.c
+++ b/fsw/src/mm_app.c
@@ -49,71 +49,79 @@ MM_AppData_t MM_AppData;
/* MM application entry point and main process loop */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-void MM_AppMain(void) {
- CFE_Status_t Status = CFE_SUCCESS;
- CFE_SB_Buffer_t *BufPtr = NULL;
-
- /*
- ** Create the first Performance Log entry
- */
- CFE_ES_PerfLogEntry(MM_APPMAIN_PERF_ID);
-
- /*
- ** Perform application specific initialization
- */
- Status = MM_AppInit();
- if (Status != CFE_SUCCESS) {
- MM_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR;
- }
-
- /*
- ** Application main loop
- */
- while (CFE_ES_RunLoop(&MM_AppData.RunStatus) == true) {
+void MM_AppMain(void)
+{
+ CFE_Status_t Status = CFE_SUCCESS;
+ CFE_SB_Buffer_t *BufPtr = NULL;
+
/*
- ** Performance Log exit stamp
+ ** Create the first Performance Log entry
*/
- CFE_ES_PerfLogExit(MM_APPMAIN_PERF_ID);
+ CFE_ES_PerfLogEntry(MM_APPMAIN_PERF_ID);
/*
- ** Pend on the arrival of the next Software Bus message
+ ** Perform application specific initialization
*/
- Status = CFE_SB_ReceiveBuffer(&BufPtr, MM_AppData.CmdPipe,
- MM_INTERNAL_SB_TIMEOUT);
+ Status = MM_AppInit();
+ if (Status != CFE_SUCCESS)
+ {
+ MM_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR;
+ }
+
/*
- ** Performance Log entry stamp
+ ** Application main loop
*/
- CFE_ES_PerfLogEntry(MM_APPMAIN_PERF_ID);
+ while (CFE_ES_RunLoop(&MM_AppData.RunStatus) == true)
+ {
+ /*
+ ** Performance Log exit stamp
+ */
+ CFE_ES_PerfLogExit(MM_APPMAIN_PERF_ID);
+
+ /*
+ ** Pend on the arrival of the next Software Bus message
+ */
+ Status = CFE_SB_ReceiveBuffer(&BufPtr, MM_AppData.CmdPipe, MM_INTERNAL_SB_TIMEOUT);
+ /*
+ ** Performance Log entry stamp
+ */
+ CFE_ES_PerfLogEntry(MM_APPMAIN_PERF_ID);
+
+ /*
+ ** Check the return status from the software bus
+ */
+ if ((Status == CFE_SUCCESS) && (BufPtr != NULL))
+ {
+ /* Process Software Bus message */
+ MM_TaskPipe(BufPtr);
+ }
+ else if (Status == CFE_SB_TIME_OUT)
+ {
+ /* No action, but also no error */
+ }
+ else
+ {
+ /*
+ ** Exit on pipe read error
+ */
+ CFE_EVS_SendEvent(MM_PIPE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "SB Pipe Read Error, App will exit. RC = 0x%08X",
+ (unsigned int)Status);
+
+ MM_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR;
+ }
+ } /* end CFS_ES_RunLoop while */
/*
- ** Check the return status from the software bus
+ ** Performance Log exit stamp
*/
- if ((Status == CFE_SUCCESS) && (BufPtr != NULL)) {
- /* Process Software Bus message */
- MM_TaskPipe(BufPtr);
- } else if (Status == CFE_SB_TIME_OUT) {
- /* No action, but also no error */
- } else {
- /*
- ** Exit on pipe read error
- */
- CFE_EVS_SendEvent(MM_PIPE_ERR_EID, CFE_EVS_EventType_ERROR,
- "SB Pipe Read Error, App will exit. RC = 0x%08X",
- (unsigned int)Status);
-
- MM_AppData.RunStatus = CFE_ES_RunStatus_APP_ERROR;
- }
- } /* end CFS_ES_RunLoop while */
-
- /*
- ** Performance Log exit stamp
- */
- CFE_ES_PerfLogExit(MM_APPMAIN_PERF_ID);
+ CFE_ES_PerfLogExit(MM_APPMAIN_PERF_ID);
- /*
- ** Exit the application
- */
- CFE_ES_ExitApp(MM_AppData.RunStatus);
+ /*
+ ** Exit the application
+ */
+ CFE_ES_ExitApp(MM_AppData.RunStatus);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -121,101 +129,107 @@ void MM_AppMain(void) {
/* MM initialization */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_AppInit(void) {
- CFE_Status_t Status = CFE_SUCCESS;
-
- /*
- ** MM doesn't use the critical data store and
- ** doesn't need to identify power on vs. processor resets.
- ** If this changes add it here as shown in the qq_app.c template
- */
-
- /*
- ** Setup the RunStatus variable
- */
- MM_AppData.RunStatus = CFE_ES_RunStatus_APP_RUN;
-
- /*
- ** Initialize application command execution counters
- */
- MM_AppData.HkTlm.Payload.CmdCounter = 0;
- MM_AppData.HkTlm.Payload.ErrCounter = 0;
-
- /*
- ** Register for event services
- */
- Status = CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY);
-
- if (Status != CFE_SUCCESS) {
- CFE_ES_WriteToSysLog(
- "MM App: Error Registering For Event Services, RC = 0x%08X\n",
- (unsigned int)Status);
- return Status;
- }
-
- /*
- ** Initialize the local housekeeping telemetry packet (clear user data area)
- */
- CFE_MSG_Init(CFE_MSG_PTR(MM_AppData.HkTlm.TelemetryHeader),
- CFE_SB_ValueToMsgId(MM_HK_TLM_MID), sizeof(MM_HkTlm_t));
-
- /*
- ** Create Software Bus message pipe
- */
- Status = CFE_SB_CreatePipe(&MM_AppData.CmdPipe, MM_INTERNAL_CMD_PIPE_DEPTH,
- MM_INTERNAL_CMD_PIPE_NAME);
- if (Status != CFE_SUCCESS) {
- CFE_EVS_SendEvent(MM_CR_PIPE_ERR_EID, CFE_EVS_EventType_ERROR,
- "Error Creating SB Pipe, RC = 0x%08X",
- (unsigned int)Status);
- return Status;
- }
-
- /*
- ** Subscribe to Housekeeping request commands
- */
- Status =
- CFE_SB_Subscribe(CFE_SB_ValueToMsgId(MM_SEND_HK_MID), MM_AppData.CmdPipe);
- if (Status != CFE_SUCCESS) {
- CFE_EVS_SendEvent(MM_HK_SUB_ERR_EID, CFE_EVS_EventType_ERROR,
- "Error Subscribing to HK Request, RC = 0x%08X",
- (unsigned int)Status);
- return Status;
- }
-
- /*
- ** Subscribe to MM ground command packets
- */
- Status =
- CFE_SB_Subscribe(CFE_SB_ValueToMsgId(MM_CMD_MID), MM_AppData.CmdPipe);
- if (Status != CFE_SUCCESS) {
- CFE_EVS_SendEvent(MM_CMD_SUB_ERR_EID, CFE_EVS_EventType_ERROR,
- "Error Subscribing to MM Command, RC = 0x%08X",
- (unsigned int)Status);
- return Status;
- }
-
- /*
- ** MM doesn't use tables. If this changes add table registration
- ** and initialization here as shown in the qq_app.c template
- */
-
- /*
- ** MM doesn't use the critical data store. If this changes add CDS
- ** creation here as shown in the qq_app.c template
- */
-
- /*
- ** Initialize MM housekeeping information
- */
- MM_ResetHk();
-
- /*
- ** Application startup event message
- */
- CFE_EVS_SendEvent(MM_INIT_INF_EID, CFE_EVS_EventType_INFORMATION,
- "MM Initialized. Version %d.%d.%d.%d", MM_MAJOR_VERSION,
- MM_MINOR_VERSION, MM_REVISION, MM_INTERNAL_MISSION_REV);
-
- return CFE_SUCCESS;
-}
\ No newline at end of file
+CFE_Status_t MM_AppInit(void)
+{
+ CFE_Status_t Status = CFE_SUCCESS;
+
+ /*
+ ** MM doesn't use the critical data store and
+ ** doesn't need to identify power on vs. processor resets.
+ ** If this changes add it here as shown in the qq_app.c template
+ */
+
+ /*
+ ** Setup the RunStatus variable
+ */
+ MM_AppData.RunStatus = CFE_ES_RunStatus_APP_RUN;
+
+ /*
+ ** Initialize application command execution counters
+ */
+ MM_AppData.HkTlm.Payload.CommandCounter = 0;
+ MM_AppData.HkTlm.Payload.CommandErrorCounter = 0;
+
+ /*
+ ** Register for event services
+ */
+ Status = CFE_EVS_Register(NULL, 0, CFE_EVS_EventFilter_BINARY);
+
+ if (Status != CFE_SUCCESS)
+ {
+ CFE_ES_WriteToSysLog("MM App: Error Registering For Event Services, RC = 0x%08X\n", (unsigned int)Status);
+ return Status;
+ }
+
+ /*
+ ** Initialize the local housekeeping telemetry packet (clear user data area)
+ */
+ CFE_MSG_Init(CFE_MSG_PTR(MM_AppData.HkTlm.TelemetryHeader), CFE_SB_ValueToMsgId(MM_HK_TLM_MID), sizeof(MM_HkTlm_t));
+
+ /*
+ ** Create Software Bus message pipe
+ */
+ Status = CFE_SB_CreatePipe(&MM_AppData.CmdPipe, MM_INTERNAL_CMD_PIPE_DEPTH, MM_INTERNAL_CMD_PIPE_NAME);
+ if (Status != CFE_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_CR_PIPE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Error Creating SB Pipe, RC = 0x%08X",
+ (unsigned int)Status);
+ return Status;
+ }
+
+ /*
+ ** Subscribe to Housekeeping request commands
+ */
+ Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(MM_SEND_HK_MID), MM_AppData.CmdPipe);
+ if (Status != CFE_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_HK_SUB_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Error Subscribing to HK Request, RC = 0x%08X",
+ (unsigned int)Status);
+ return Status;
+ }
+
+ /*
+ ** Subscribe to MM ground command packets
+ */
+ Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(MM_CMD_MID), MM_AppData.CmdPipe);
+ if (Status != CFE_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_CMD_SUB_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Error Subscribing to MM Command, RC = 0x%08X",
+ (unsigned int)Status);
+ return Status;
+ }
+
+ /*
+ ** MM doesn't use tables. If this changes add table registration
+ ** and initialization here as shown in the qq_app.c template
+ */
+
+ /*
+ ** MM doesn't use the critical data store. If this changes add CDS
+ ** creation here as shown in the qq_app.c template
+ */
+
+ /*
+ ** Initialize MM housekeeping information
+ */
+ MM_ResetHk();
+
+ /*
+ ** Application startup event message
+ */
+ CFE_EVS_SendEvent(MM_INIT_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "MM Initialized. Version %d.%d.%d.%d",
+ MM_MAJOR_VERSION,
+ MM_MINOR_VERSION,
+ MM_REVISION,
+ MM_INTERNAL_MISSION_REV);
+
+ return CFE_SUCCESS;
+}
diff --git a/fsw/src/mm_app.h b/fsw/src/mm_app.h
index 697337c..bfd0566 100644
--- a/fsw/src/mm_app.h
+++ b/fsw/src/mm_app.h
@@ -24,9 +24,10 @@
#ifndef MM_APP_H
#define MM_APP_H
-/************************************************************************
- * Includes
- ************************************************************************/
+/* ======== */
+/* Includes */
+/* ======== */
+
#include "cfe.h"
#include "mm_mission_cfg.h"
#include "mm_msg.h"
@@ -40,16 +41,14 @@
* \name MM Command verification selection
* \{
*/
-#define MM_VERIFY_DUMP 0 /**< \brief Verify dump parameters */
-#define MM_VERIFY_LOAD 1 /**< \brief Verify load parameters */
+#define MM_VERIFY_DUMP 0 /**< \brief Verify dump parameters */
+#define MM_VERIFY_LOAD 1 /**< \brief Verify load parameters */
#define MM_VERIFY_EVENT 2 /**< \brief Verify dump in event parameters */
-#define MM_VERIFY_FILL 3 /**< \brief Verify fill parameters */
-#define MM_VERIFY_WID \
- 4 /**< \brief Verify write interrupts disabled parameters */
+#define MM_VERIFY_FILL 3 /**< \brief Verify fill parameters */
+#define MM_VERIFY_WID 4 /**< \brief Verify write interrupts disabled parameters */
/**\}*/
-#define MM_MAX_MEM_TYPE_STR_LEN \
- 11 /**< \brief Maximum memory type string length */
+#define MM_MAX_MEM_TYPE_STR_LEN 11 /**< \brief Maximum memory type string length */
/************************************************************************
* Type Definitions
@@ -58,19 +57,17 @@
/**
* \brief MM global data structure
*/
-typedef struct {
- MM_HkTlm_t HkTlm; /**< \brief Housekeeping telemetry packet */
+typedef struct
+{
+ MM_HkTlm_t HkTlm; /**< \brief Housekeeping telemetry packet */
- CFE_SB_PipeId_t CmdPipe; /**< \brief Command pipe ID */
+ CFE_SB_PipeId_t CmdPipe; /**< \brief Command pipe ID */
- uint32 RunStatus; /**< \brief Application run status */
+ uint32 RunStatus; /**< \brief Application run status */
- size_t LoadBuffer[MM_INTERNAL_MAX_LOAD_DATA_SEG /
- 4]; /**< \brief Load file i/o buffer */
- size_t DumpBuffer[MM_INTERNAL_MAX_DUMP_DATA_SEG /
- 4]; /**< \brief Dump file i/o buffer */
- size_t FillBuffer[MM_INTERNAL_MAX_FILL_DATA_SEG /
- 4]; /**< \brief Fill memory buffer */
+ size_t LoadBuffer[MM_INTERNAL_MAX_LOAD_DATA_SEG / 4]; /**< \brief Load file i/o buffer */
+ size_t DumpBuffer[MM_INTERNAL_MAX_DUMP_DATA_SEG / 4]; /**< \brief Dump file i/o buffer */
+ size_t FillBuffer[MM_INTERNAL_MAX_FILL_DATA_SEG / 4]; /**< \brief Fill memory buffer */
} MM_AppData_t;
/** \brief Memory Manager application global */
diff --git a/fsw/src/mm_cmds.c b/fsw/src/mm_cmds.c
index 8fc56a6..c614790 100644
--- a/fsw/src/mm_cmds.c
+++ b/fsw/src/mm_cmds.c
@@ -56,19 +56,20 @@
/* Housekeeping request */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_SendHkCmd(const MM_SendHkCmd_t *Msg) {
- /*
- ** Send housekeeping telemetry packet
- */
- CFE_SB_TimeStampMsg(CFE_MSG_PTR(MM_AppData.HkTlm.TelemetryHeader));
- CFE_SB_TransmitMsg(CFE_MSG_PTR(MM_AppData.HkTlm.TelemetryHeader), true);
-
- /*
- ** This command does not affect the command execution counter
- */
-
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+CFE_Status_t MM_SendHkCmd(const MM_SendHkCmd_t *Msg)
+{
+ /*
+ ** Send housekeeping telemetry packet
+ */
+ CFE_SB_TimeStampMsg(CFE_MSG_PTR(MM_AppData.HkTlm.TelemetryHeader));
+ CFE_SB_TransmitMsg(CFE_MSG_PTR(MM_AppData.HkTlm.TelemetryHeader), true);
+
+ /*
+ ** This command does not affect the command execution counter
+ */
+
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -76,16 +77,21 @@ CFE_Status_t MM_SendHkCmd(const MM_SendHkCmd_t *Msg) {
/* Noop command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_NoopCmd(const MM_NoopCmd_t *Msg) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_NOOP;
- MM_AppData.HkTlm.Payload.CmdCounter++;
-
- CFE_EVS_SendEvent(MM_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION,
- "No-op command. Version %d.%d.%d.%d", MM_MAJOR_VERSION,
- MM_MINOR_VERSION, MM_REVISION, MM_INTERNAL_MISSION_REV);
+CFE_Status_t MM_NoopCmd(const MM_NoopCmd_t *Msg)
+{
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_NOOP;
+ MM_AppData.HkTlm.Payload.CommandCounter++;
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+ CFE_EVS_SendEvent(MM_NOOP_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "No-op command. Version %d.%d.%d.%d",
+ MM_MAJOR_VERSION,
+ MM_MINOR_VERSION,
+ MM_REVISION,
+ MM_INTERNAL_MISSION_REV);
+
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -93,16 +99,16 @@ CFE_Status_t MM_NoopCmd(const MM_NoopCmd_t *Msg) {
/* Reset counters command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_ResetCountersCmd(const MM_ResetCountersCmd_t *Msg) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_RESET;
- MM_AppData.HkTlm.Payload.CmdCounter = 0;
- MM_AppData.HkTlm.Payload.ErrCounter = 0;
+CFE_Status_t MM_ResetCountersCmd(const MM_ResetCountersCmd_t *Msg)
+{
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_RESET;
+ MM_AppData.HkTlm.Payload.CommandCounter = 0;
+ MM_AppData.HkTlm.Payload.CommandErrorCounter = 0;
- CFE_EVS_SendEvent(MM_RESET_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Reset counters command received");
+ CFE_EVS_SendEvent(MM_RESET_INF_EID, CFE_EVS_EventType_INFORMATION, "Reset counters command received");
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -110,48 +116,58 @@ CFE_Status_t MM_ResetCountersCmd(const MM_ResetCountersCmd_t *Msg) {
/* Lookup symbol name command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_LookupSymCmd(const MM_LookupSymCmd_t *Msg) {
- int32 OS_Status;
- cpuaddr ResolvedAddr = 0;
- char SymName[CFE_MISSION_MAX_PATH_LEN];
-
- /* Make sure string is null terminated before attempting to process it */
- CFE_SB_MessageStringGet(SymName, Msg->Payload.SymName, NULL, sizeof(SymName),
- sizeof(Msg->Payload.SymName));
-
- /*
- ** Check if the symbol name string is a nul string
- */
- if (OS_strnlen(SymName, CFE_MISSION_MAX_PATH_LEN) == 0) {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_SYMNAME_NUL_ERR_EID, CFE_EVS_EventType_ERROR,
- "NUL (empty) string specified as symbol name");
- } else {
+CFE_Status_t MM_LookupSymCmd(const MM_LookupSymCmd_t *Msg)
+{
+ int32 OS_Status;
+ cpuaddr ResolvedAddr = 0;
+ char SymName[CFE_MISSION_MAX_PATH_LEN];
+
+ /* Make sure string is null terminated before attempting to process it */
+ CFE_SB_MessageStringGet(SymName, Msg->Payload.SymName, NULL, sizeof(SymName), sizeof(Msg->Payload.SymName));
+
/*
- ** If symbol name is not an empty string look it up using the OSAL API
+ ** Check if the symbol name string is a nul string
*/
- OS_Status = OS_SymbolLookup(&ResolvedAddr, SymName);
- if (OS_Status == OS_SUCCESS) {
- /* Update telemetry */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_SYM_LOOKUP;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(ResolvedAddr);
-
- MM_AppData.HkTlm.Payload.CmdCounter++;
- CFE_EVS_SendEvent(MM_SYM_LOOKUP_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Symbol Lookup Command: Name = '%s' Addr = %p", SymName,
- (void *)ResolvedAddr);
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'",
- SymName);
+ if (OS_strnlen(SymName, CFE_MISSION_MAX_PATH_LEN) == 0)
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_SYMNAME_NUL_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "NUL (empty) string specified as symbol name");
}
+ else
+ {
+ /*
+ ** If symbol name is not an empty string look it up using the OSAL API
+ */
+ OS_Status = OS_SymbolLookup(&ResolvedAddr, SymName);
+ if (OS_Status == OS_SUCCESS)
+ {
+ /* Update telemetry */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_SYM_LOOKUP;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(ResolvedAddr);
+
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ CFE_EVS_SendEvent(MM_SYM_LOOKUP_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Symbol Lookup Command: Name = '%s' Addr = %p",
+ SymName,
+ (void *)ResolvedAddr);
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'",
+ SymName);
+ }
- } /* end OS_strnlen(Msg->Payload.SymName, CFE_MISSION_MAX_PATH_LEN) == 0 else
- */
+ } /* end OS_strnlen(Msg->Payload.SymName, CFE_MISSION_MAX_PATH_LEN) == 0 else
+ */
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -159,45 +175,52 @@ CFE_Status_t MM_LookupSymCmd(const MM_LookupSymCmd_t *Msg) {
/* Dump symbol table to file command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_SymTblToFileCmd(const MM_SymTblToFileCmd_t *Msg) {
- char FileName[CFE_MISSION_MAX_PATH_LEN];
- int32 OS_Status;
-
- /* Make sure string is null terminated before attempting to process it */
- CFE_SB_MessageStringGet(FileName, Msg->Payload.FileName, NULL,
- sizeof(FileName), sizeof(Msg->Payload.FileName));
-
- /*
- ** Check if the filename string is a nul string
- */
- if (OS_strnlen(FileName, CFE_MISSION_MAX_PATH_LEN) == 0) {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_SYMFILENAME_NUL_ERR_EID, CFE_EVS_EventType_ERROR,
- "NUL (empty) string specified as symbol dump file name");
- } else {
- OS_Status =
- OS_SymbolTableDump(FileName, MM_INTERNAL_MAX_DUMP_FILE_DATA_SYMTBL);
- if (OS_Status == OS_SUCCESS) {
- /* Update telemetry */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_SYMTBL_SAVE;
- snprintf(MM_AppData.HkTlm.Payload.FileName, CFE_MISSION_MAX_PATH_LEN,
- "%s", FileName);
-
- MM_AppData.HkTlm.Payload.CmdCounter++;
- CFE_EVS_SendEvent(
- MM_SYMTBL_TO_FILE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Symbol Table Dump to File Started: Name = '%s'", FileName);
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(
- MM_SYMTBL_TO_FILE_FAIL_ERR_EID, CFE_EVS_EventType_ERROR,
- "Error dumping symbol table, OS_Status= 0x%X, File='%s'",
- (unsigned int)OS_Status, FileName);
+CFE_Status_t MM_SymTblToFileCmd(const MM_SymTblToFileCmd_t *Msg)
+{
+ char FileName[CFE_MISSION_MAX_PATH_LEN];
+ int32 OS_Status;
+
+ /* Make sure string is null terminated before attempting to process it */
+ CFE_SB_MessageStringGet(FileName, Msg->Payload.FileName, NULL, sizeof(FileName), sizeof(Msg->Payload.FileName));
+
+ /*
+ ** Check if the filename string is a nul string
+ */
+ if (OS_strnlen(FileName, CFE_MISSION_MAX_PATH_LEN) == 0)
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_SYMFILENAME_NUL_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "NUL (empty) string specified as symbol dump file name");
}
- } /* end OS_strnlen(FileName, CFE_MISSION_MAX_PATH_LEN) == 0 else */
+ else
+ {
+ OS_Status = OS_SymbolTableDump(FileName, MM_INTERNAL_MAX_DUMP_FILE_DATA_SYMTBL);
+ if (OS_Status == OS_SUCCESS)
+ {
+ /* Update telemetry */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_SYMTBL_SAVE;
+ snprintf(MM_AppData.HkTlm.Payload.FileName, CFE_MISSION_MAX_PATH_LEN, "%s", FileName);
+
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ CFE_EVS_SendEvent(MM_SYMTBL_TO_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Symbol Table Dump to File Started: Name = '%s'",
+ FileName);
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_SYMTBL_TO_FILE_FAIL_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Error dumping symbol table, OS_Status= 0x%X, File='%s'",
+ (unsigned int)OS_Status,
+ FileName);
+ }
+ } /* end OS_strnlen(FileName, CFE_MISSION_MAX_PATH_LEN) == 0 else */
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -205,33 +228,39 @@ CFE_Status_t MM_SymTblToFileCmd(const MM_SymTblToFileCmd_t *Msg) {
/* EEPROM write-enable command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_EepromWriteEnaCmd(const MM_EepromWriteEnaCmd_t *Msg) {
- CFE_Status_t cFE_Status;
-
- /*
- ** Call the cFE to write-enable the requested bank
- */
- cFE_Status = CFE_PSP_EepromWriteEnable(Msg->Payload.Bank);
- if (cFE_Status == CFE_PSP_SUCCESS) {
- /* Update telemetry */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_EEPROMWRITE_ENA;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_EEPROM;
-
- MM_AppData.HkTlm.Payload.CmdCounter++;
- CFE_EVS_SendEvent(MM_EEPROM_WRITE_ENA_INF_EID,
- CFE_EVS_EventType_INFORMATION,
- "EEPROM bank %d write enabled, cFE_Status= 0x%X",
- (int)Msg->Payload.Bank, (unsigned int)cFE_Status);
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(
- MM_EEPROM_WRITE_ENA_ERR_EID, CFE_EVS_EventType_ERROR,
- "Error requesting EEPROM bank %d write enable, cFE_Status= 0x%X",
- (int)Msg->Payload.Bank, (unsigned int)cFE_Status);
- }
-
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+CFE_Status_t MM_EepromWriteEnaCmd(const MM_EepromWriteEnaCmd_t *Msg)
+{
+ CFE_Status_t cFE_Status;
+
+ /*
+ ** Call the cFE to write-enable the requested bank
+ */
+ cFE_Status = CFE_PSP_EepromWriteEnable(Msg->Payload.Bank);
+ if (cFE_Status == CFE_PSP_SUCCESS)
+ {
+ /* Update telemetry */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_EEPROMWRITE_ENA;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_EEPROM;
+
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ CFE_EVS_SendEvent(MM_EEPROM_WRITE_ENA_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "EEPROM bank %d write enabled, cFE_Status= 0x%X",
+ (int)Msg->Payload.Bank,
+ (unsigned int)cFE_Status);
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_EEPROM_WRITE_ENA_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Error requesting EEPROM bank %d write enable, cFE_Status= 0x%X",
+ (int)Msg->Payload.Bank,
+ (unsigned int)cFE_Status);
+ }
+
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -239,33 +268,39 @@ CFE_Status_t MM_EepromWriteEnaCmd(const MM_EepromWriteEnaCmd_t *Msg) {
/* EEPROM write-disable command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_EepromWriteDisCmd(const MM_EepromWriteDisCmd_t *Msg) {
- CFE_Status_t cFE_Status;
-
- /*
- ** Call the cFE to write-enable the requested bank
- */
- cFE_Status = CFE_PSP_EepromWriteDisable(Msg->Payload.Bank);
- if (cFE_Status == CFE_PSP_SUCCESS) {
- /* Update telemetry */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_EEPROMWRITE_DIS;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_EEPROM;
-
- MM_AppData.HkTlm.Payload.CmdCounter++;
- CFE_EVS_SendEvent(MM_EEPROM_WRITE_DIS_INF_EID,
- CFE_EVS_EventType_INFORMATION,
- "EEPROM bank %d write disabled, cFE_Status= 0x%X",
- (int)Msg->Payload.Bank, (unsigned int)cFE_Status);
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(
- MM_EEPROM_WRITE_DIS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Error requesting EEPROM bank %d write disable, cFE_Status= 0x%X",
- (int)Msg->Payload.Bank, (unsigned int)cFE_Status);
- }
-
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+CFE_Status_t MM_EepromWriteDisCmd(const MM_EepromWriteDisCmd_t *Msg)
+{
+ CFE_Status_t cFE_Status;
+
+ /*
+ ** Call the cFE to write-enable the requested bank
+ */
+ cFE_Status = CFE_PSP_EepromWriteDisable(Msg->Payload.Bank);
+ if (cFE_Status == CFE_PSP_SUCCESS)
+ {
+ /* Update telemetry */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_EEPROMWRITE_DIS;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_EEPROM;
+
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ CFE_EVS_SendEvent(MM_EEPROM_WRITE_DIS_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "EEPROM bank %d write disabled, cFE_Status= 0x%X",
+ (int)Msg->Payload.Bank,
+ (unsigned int)cFE_Status);
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_EEPROM_WRITE_DIS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Error requesting EEPROM bank %d write disable, cFE_Status= 0x%X",
+ (int)Msg->Payload.Bank,
+ (unsigned int)cFE_Status);
+ }
+
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -273,52 +308,64 @@ CFE_Status_t MM_EepromWriteDisCmd(const MM_EepromWriteDisCmd_t *Msg) {
/* Memory poke ground command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_PokeCmd(const MM_PokeCmd_t *Msg) {
- cpuaddr DestAddress = 0;
- MM_SymAddr_t DestSymAddress;
- int32 Status;
-
- DestSymAddress = Msg->Payload.DestSymAddress;
-
- /* Resolve the symbolic address in command message */
- Status = MM_ResolveSymAddr(&(DestSymAddress), &DestAddress);
-
- if (Status == OS_SUCCESS) {
- /* Run necessary checks on command parameters */
- Status = MM_VerifyPeekPokeParams(DestAddress, Msg->Payload.MemType,
- Msg->Payload.DataSize);
-
- /* Check the specified memory type and call the appropriate routine */
- if (Status == OS_SUCCESS) {
- /* Check if we need special EEPROM processing */
- if (Msg->Payload.MemType == MM_MemType_EEPROM) {
- Status = MM_PokeEeprom(Msg, DestAddress);
- } else {
- /*
- ** We can use this routine for all other memory types
- * (including the optional ones)
- */
- Status = MM_PokeMem(Msg, DestAddress);
- }
-
- if (Status == CFE_PSP_SUCCESS) {
- MM_AppData.HkTlm.Payload.CmdCounter++;
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- }
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- } /* end MM_VerifyPeekPokeParams if */
- } /* end MM_ResolveSymAddr */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'",
- DestSymAddress.SymName);
- }
-
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+CFE_Status_t MM_PokeCmd(const MM_PokeCmd_t *Msg)
+{
+ cpuaddr DestAddress = 0;
+ MM_SymAddr_t DestSymAddress;
+ int32 Status;
+
+ DestSymAddress = Msg->Payload.DestSymAddress;
+
+ /* Resolve the symbolic address in command message */
+ Status = MM_ResolveSymAddr(&(DestSymAddress), &DestAddress);
+
+ if (Status == OS_SUCCESS)
+ {
+ /* Run necessary checks on command parameters */
+ Status = MM_VerifyPeekPokeParams(DestAddress, Msg->Payload.MemType, Msg->Payload.DataSize);
+
+ /* Check the specified memory type and call the appropriate routine */
+ if (Status == OS_SUCCESS)
+ {
+ /* Check if we need special EEPROM processing */
+ if (Msg->Payload.MemType == MM_MemType_EEPROM)
+ {
+ Status = MM_PokeEeprom(Msg, DestAddress);
+ }
+ else
+ {
+ /*
+ ** We can use this routine for all other memory types
+ * (including the optional ones)
+ */
+ Status = MM_PokeMem(Msg, DestAddress);
+ }
+
+ if (Status == CFE_PSP_SUCCESS)
+ {
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ }
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ } /* end MM_VerifyPeekPokeParams if */
+ } /* end MM_ResolveSymAddr */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'",
+ DestSymAddress.SymName);
+ }
+
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -327,67 +374,76 @@ CFE_Status_t MM_PokeCmd(const MM_PokeCmd_t *Msg) {
/* Only valid for RAM addresses */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_LoadMemWIDCmd(const MM_LoadMemWIDCmd_t *Msg) {
- uint32 ComputedCRC;
- cpuaddr DestAddress = 0;
- MM_SymAddr_t DestSymAddress;
+CFE_Status_t MM_LoadMemWIDCmd(const MM_LoadMemWIDCmd_t *Msg)
+{
+ uint32 ComputedCRC;
+ cpuaddr DestAddress = 0;
+ MM_SymAddr_t DestSymAddress;
- DestSymAddress = Msg->Payload.DestSymAddress;
+ DestSymAddress = Msg->Payload.DestSymAddress;
- /* Resolve the symbolic address in command message */
- if (MM_ResolveSymAddr(&(DestSymAddress), &DestAddress) == OS_SUCCESS) {
- /*
- ** Run some necessary checks on command parameters
- ** NOTE: A load with interrupts disabled command is only valid for RAM
- *addresses
- */
- if (MM_VerifyLoadDumpParams(DestAddress, MM_MemType_RAM,
- Msg->Payload.NumOfBytes,
- MM_VERIFY_WID) == CFE_PSP_SUCCESS) {
- /* Verify data integrity check value */
- ComputedCRC =
- CFE_ES_CalculateCRC(Msg->Payload.DataArray, Msg->Payload.NumOfBytes,
- 0, MM_INTERNAL_LOAD_WID_CRC_TYPE);
- /*
- ** If the CRC matches do the load
- */
- if (ComputedCRC == Msg->Payload.Crc) {
- /* Load input data to input memory address */
- memcpy((void *)DestAddress, Msg->Payload.DataArray,
- Msg->Payload.NumOfBytes);
-
- MM_AppData.HkTlm.Payload.CmdCounter++;
- CFE_EVS_SendEvent(
- MM_LOAD_WID_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Load Memory WID Command: Wrote %d bytes to address: %p",
- (int)Msg->Payload.NumOfBytes, (void *)DestAddress);
-
- /* Update last action statistics */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_LOAD_WID;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_RAM;
- MM_AppData.HkTlm.Payload.BytesProcessed = Msg->Payload.NumOfBytes;
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_LOAD_WID_CRC_ERR_EID, CFE_EVS_EventType_ERROR,
- "Interrupts Disabled Load CRC failure: Expected = "
- "0x%X Calculated = 0x%X",
- (unsigned int)Msg->Payload.Crc,
- (unsigned int)ComputedCRC);
- }
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- } /* end MM_VerifyLoadWIDParams */
- } /* end MM_ResolveSymAddr if */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'",
- DestSymAddress.SymName);
- }
-
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+ /* Resolve the symbolic address in command message */
+ if (MM_ResolveSymAddr(&(DestSymAddress), &DestAddress) == OS_SUCCESS)
+ {
+ /*
+ ** Run some necessary checks on command parameters
+ ** NOTE: A load with interrupts disabled command is only valid for RAM
+ *addresses
+ */
+ if (MM_VerifyLoadDumpParams(DestAddress, MM_MemType_RAM, Msg->Payload.NumOfBytes, MM_VERIFY_WID)
+ == CFE_PSP_SUCCESS)
+ {
+ /* Verify data integrity check value */
+ ComputedCRC =
+ CFE_ES_CalculateCRC(Msg->Payload.DataArray, Msg->Payload.NumOfBytes, 0, MM_INTERNAL_LOAD_WID_CRC_TYPE);
+ /*
+ ** If the CRC matches do the load
+ */
+ if (ComputedCRC == Msg->Payload.Crc)
+ {
+ /* Load input data to input memory address */
+ memcpy((void *)DestAddress, Msg->Payload.DataArray, Msg->Payload.NumOfBytes);
+
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ CFE_EVS_SendEvent(MM_LOAD_WID_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Load Memory WID Command: Wrote %d bytes to address: %p",
+ (int)Msg->Payload.NumOfBytes,
+ (void *)DestAddress);
+
+ /* Update last action statistics */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_LOAD_WID;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_RAM;
+ MM_AppData.HkTlm.Payload.BytesProcessed = Msg->Payload.NumOfBytes;
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_LOAD_WID_CRC_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Interrupts Disabled Load CRC failure: Expected = "
+ "0x%X Calculated = 0x%X",
+ (unsigned int)Msg->Payload.Crc,
+ (unsigned int)ComputedCRC);
+ }
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ } /* end MM_VerifyLoadWIDParams */
+ } /* end MM_ResolveSymAddr if */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'",
+ DestSymAddress.SymName);
+ }
+
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -395,172 +451,193 @@ CFE_Status_t MM_LoadMemWIDCmd(const MM_LoadMemWIDCmd_t *Msg) {
/* Load memory from a file command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_LoadMemFromFileCmd(const MM_LoadMemFromFileCmd_t *Msg) {
- int32 Status;
- osal_id_t FileHandle = OS_OBJECT_ID_UNDEFINED;
- cpuaddr DestAddress = 0;
- char FileName[CFE_MISSION_MAX_PATH_LEN];
- CFE_FS_Header_t CFEFileHeader;
- MM_LoadDumpFileHeader_t MMFileHeader;
- uint32 ComputedCRC;
- int32 LSeekSize;
-
- memset(&MMFileHeader, 0, sizeof(MMFileHeader));
-
- /* Make sure string is null terminated before attempting to process it */
- CFE_SB_MessageStringGet(FileName, Msg->Payload.FileName, NULL,
- sizeof(FileName), sizeof(Msg->Payload.FileName));
-
- /* Open load file for reading */
- Status =
- OS_OpenCreate(&FileHandle, FileName, OS_FILE_FLAG_NONE, OS_READ_ONLY);
- if (Status == OS_SUCCESS) {
- /* Read in the file headers */
- Status =
- MM_ReadFileHeaders(FileName, FileHandle, &CFEFileHeader, &MMFileHeader);
- if (Status == OS_SUCCESS) {
- /* Verify the file size is correct */
- Status = MM_VerifyLoadFileSize(FileName, &MMFileHeader);
- if (Status == OS_SUCCESS) {
- /* Verify data integrity check value */
- Status = MM_ComputeCRCFromFile(FileHandle, &ComputedCRC,
- MM_INTERNAL_LOAD_FILE_CRC_TYPE);
- if (Status == OS_SUCCESS) {
- /*
- ** Reset the file pointer to the start of the load data, need to do
- *this
- ** because MM_ComputeCRCFromFile reads to the end of file
- */
- LSeekSize = OS_lseek(
- FileHandle,
- (sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t)),
- OS_SEEK_SET);
- if (LSeekSize !=
- (sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t))) {
- Status = OS_ERROR;
- }
-
- /* Check the computed CRC against the file header CRC */
- if ((ComputedCRC == MMFileHeader.Crc) && (Status == OS_SUCCESS)) {
- /* Resolve symbolic address in file header */
- Status =
- MM_ResolveSymAddr(&(MMFileHeader.SymAddress), &DestAddress);
-
- if (Status == OS_SUCCESS) {
- /* Run necessary checks on command parameters */
- Status = MM_VerifyLoadDumpParams(
- DestAddress, MMFileHeader.MemType, MMFileHeader.NumOfBytes,
- MM_VERIFY_LOAD);
- if (Status == CFE_PSP_SUCCESS) {
- /* Call the load routine for the specified memory type */
- switch (MMFileHeader.MemType) {
- case MM_MemType_RAM:
- case MM_MemType_EEPROM:
- Status = MM_LoadMemFromFile(FileHandle, FileName,
- &MMFileHeader, DestAddress);
- break;
+CFE_Status_t MM_LoadMemFromFileCmd(const MM_LoadMemFromFileCmd_t *Msg)
+{
+ int32 Status;
+ osal_id_t FileHandle = OS_OBJECT_ID_UNDEFINED;
+ cpuaddr DestAddress = 0;
+ char FileName[CFE_MISSION_MAX_PATH_LEN];
+ CFE_FS_Header_t CFEFileHeader;
+ MM_LoadDumpFileHeader_t MMFileHeader;
+ uint32 ComputedCRC;
+ int32 LSeekSize;
+
+ memset(&MMFileHeader, 0, sizeof(MMFileHeader));
+
+ /* Make sure string is null terminated before attempting to process it */
+ CFE_SB_MessageStringGet(FileName, Msg->Payload.FileName, NULL, sizeof(FileName), sizeof(Msg->Payload.FileName));
+
+ /* Open load file for reading */
+ Status = OS_OpenCreate(&FileHandle, FileName, OS_FILE_FLAG_NONE, OS_READ_ONLY);
+ if (Status == OS_SUCCESS)
+ {
+ /* Read in the file headers */
+ Status = MM_ReadFileHeaders(FileName, FileHandle, &CFEFileHeader, &MMFileHeader);
+ if (Status == OS_SUCCESS)
+ {
+ /* Verify the file size is correct */
+ Status = MM_VerifyLoadFileSize(FileName, &MMFileHeader);
+ if (Status == OS_SUCCESS)
+ {
+ /* Verify data integrity check value */
+ Status = MM_ComputeCRCFromFile(FileHandle, &ComputedCRC, MM_INTERNAL_LOAD_FILE_CRC_TYPE);
+ if (Status == OS_SUCCESS)
+ {
+ /*
+ ** Reset the file pointer to the start of the load data, need to do
+ *this
+ ** because MM_ComputeCRCFromFile reads to the end of file
+ */
+ LSeekSize =
+ OS_lseek(FileHandle, (sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t)), OS_SEEK_SET);
+ if (LSeekSize != (sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t)))
+ {
+ Status = OS_ERROR;
+ }
+
+ /* Check the computed CRC against the file header CRC */
+ if ((ComputedCRC == MMFileHeader.Crc) && (Status == OS_SUCCESS))
+ {
+ /* Resolve symbolic address in file header */
+ Status = MM_ResolveSymAddr(&(MMFileHeader.SymAddress), &DestAddress);
+
+ if (Status == OS_SUCCESS)
+ {
+ /* Run necessary checks on command parameters */
+ Status = MM_VerifyLoadDumpParams(DestAddress,
+ MMFileHeader.MemType,
+ MMFileHeader.NumOfBytes,
+ MM_VERIFY_LOAD);
+ if (Status == CFE_PSP_SUCCESS)
+ {
+ /* Call the load routine for the specified memory type */
+ switch (MMFileHeader.MemType)
+ {
+ case MM_MemType_RAM:
+ case MM_MemType_EEPROM:
+ Status = MM_LoadMemFromFile(FileHandle, FileName, &MMFileHeader, DestAddress);
+ break;
#ifdef MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE
- case MM_MemType_MEM32:
- Status = MM_LoadMem32FromFile(FileHandle, FileName,
- &MMFileHeader, DestAddress);
- break;
+ case MM_MemType_MEM32:
+ Status = MM_LoadMem32FromFile(FileHandle, FileName, &MMFileHeader, DestAddress);
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE */
#ifdef MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE
- case MM_MemType_MEM16:
- Status = MM_LoadMem16FromFile(FileHandle, FileName,
- &MMFileHeader, DestAddress);
- break;
+ case MM_MemType_MEM16:
+ Status = MM_LoadMem16FromFile(FileHandle, FileName, &MMFileHeader, DestAddress);
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE */
#ifdef MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE
- case MM_MemType_MEM8:
- Status = MM_LoadMem8FromFile(FileHandle, FileName,
- &MMFileHeader, DestAddress);
- break;
+ case MM_MemType_MEM8:
+ Status = MM_LoadMem8FromFile(FileHandle, FileName, &MMFileHeader, DestAddress);
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE */
- /*
- ** We don't need a default case, a bad MemType will get caught
- ** in the MM_VerifyFileLoadParams function and we won't get here
- */
- default:
- Status = OS_ERROR;
- break;
- }
-
- if (Status == OS_SUCCESS) {
- MM_AppData.HkTlm.Payload.CmdCounter++;
- CFE_EVS_SendEvent(
- MM_LD_MEM_FILE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Load Memory From File Command: Loaded %d bytes to "
- "address %p from file '%s'",
- (int)MM_AppData.HkTlm.Payload.BytesProcessed,
- (void *)DestAddress, FileName);
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
+ /*
+ ** We don't need a default case, a bad MemType will get caught
+ ** in the MM_VerifyFileLoadParams function and we won't get here
+ */
+ default:
+ Status = OS_ERROR;
+ break;
+ }
+
+ if (Status == OS_SUCCESS)
+ {
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ CFE_EVS_SendEvent(MM_LD_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Load Memory From File Command: Loaded %d bytes to "
+ "address %p from file '%s'",
+ (int)MM_AppData.HkTlm.Payload.BytesProcessed,
+ (void *)DestAddress,
+ FileName);
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ }
+ } /* end MM_VerifyFileLoadParams if */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_FILE_LOAD_PARAMS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Load file failed parameters check: File = '%s'",
+ FileName);
+ }
+ } /* end MM_ResolveSymAddr if */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'",
+ MMFileHeader.SymAddress.SymName);
+ }
+
+ } /* end ComputedCRC == MMFileHeader.Crc if */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_LOAD_FILE_CRC_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Load file CRC failure: Expected = 0x%X "
+ "Calculated = 0x%X File = '%s'",
+ (unsigned int)MMFileHeader.Crc,
+ (unsigned int)ComputedCRC,
+ FileName);
+ }
+
+ } /* end MM_ComputeCRCFromFile if */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_COMPUTECRCFROMFILE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "MM_ComputeCRCFromFile error received: RC = 0x%08X File = '%s'",
+ (unsigned int)Status,
+ FileName);
}
- } /* end MM_VerifyFileLoadParams if */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(
- MM_FILE_LOAD_PARAMS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Load file failed parameters check: File = '%s'", FileName);
- }
- } /* end MM_ResolveSymAddr if */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(
- MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'",
- MMFileHeader.SymAddress.SymName);
}
-
- } /* end ComputedCRC == MMFileHeader.Crc if */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_LOAD_FILE_CRC_ERR_EID, CFE_EVS_EventType_ERROR,
- "Load file CRC failure: Expected = 0x%X "
- "Calculated = 0x%X File = '%s'",
- (unsigned int)MMFileHeader.Crc,
- (unsigned int)ComputedCRC, FileName);
- }
-
- } /* end MM_ComputeCRCFromFile if */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(
- MM_COMPUTECRCFROMFILE_ERR_EID, CFE_EVS_EventType_ERROR,
- "MM_ComputeCRCFromFile error received: RC = 0x%08X File = '%s'",
- (unsigned int)Status, FileName);
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ } /* end MM_VerifyLoadFileSize */
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ } /* end MM_ReadFileHeaders if */
+
+ /* Close the load file for all cases after the open call succeeds */
+ Status = OS_close(FileHandle);
+ if (Status != OS_SUCCESS)
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_OS_CLOSE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_close error received: RC = 0x%08X File = '%s'",
+ (unsigned int)Status,
+ FileName);
}
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- } /* end MM_VerifyLoadFileSize */
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- } /* end MM_ReadFileHeaders if */
-
- /* Close the load file for all cases after the open call succeeds */
- Status = OS_close(FileHandle);
- if (Status != OS_SUCCESS) {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_OS_CLOSE_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_close error received: RC = 0x%08X File = '%s'",
- (unsigned int)Status, FileName);
- }
- } /* end OS_OpenCreate if */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_OS_OPEN_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_OpenCreate error received: RC = %d File = '%s'",
- (int)Status, Msg->Payload.FileName);
- }
+ } /* end OS_OpenCreate if */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_OS_OPEN_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_OpenCreate error received: RC = %d File = '%s'",
+ (int)Status,
+ Msg->Payload.FileName);
+ }
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -568,77 +645,92 @@ CFE_Status_t MM_LoadMemFromFileCmd(const MM_LoadMemFromFileCmd_t *Msg) {
/* Fill memory command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_FillMemCmd(const MM_FillMemCmd_t *Msg) {
- cpuaddr DestAddress = 0;
- CFE_Status_t Status = CFE_SUCCESS;
- MM_SymAddr_t DestSymAddress = Msg->Payload.DestSymAddress;
-
- /* Resolve symbolic address */
- if (MM_ResolveSymAddr(&(DestSymAddress), &DestAddress) == OS_SUCCESS) {
- /* Run necessary checks on command parameters */
- if (MM_VerifyLoadDumpParams(DestAddress, Msg->Payload.MemType,
- Msg->Payload.NumOfBytes,
- MM_VERIFY_FILL) == CFE_SUCCESS) {
- switch (Msg->Payload.MemType) {
- case MM_MemType_RAM:
- case MM_MemType_EEPROM:
- MM_FillMem(DestAddress, Msg);
- break;
+CFE_Status_t MM_FillMemCmd(const MM_FillMemCmd_t *Msg)
+{
+ cpuaddr DestAddress = 0;
+ CFE_Status_t Status = CFE_SUCCESS;
+ MM_SymAddr_t DestSymAddress = Msg->Payload.DestSymAddress;
+
+ /* Resolve symbolic address */
+ if (MM_ResolveSymAddr(&(DestSymAddress), &DestAddress) == OS_SUCCESS)
+ {
+ /* Run necessary checks on command parameters */
+ if (MM_VerifyLoadDumpParams(DestAddress, Msg->Payload.MemType, Msg->Payload.NumOfBytes, MM_VERIFY_FILL)
+ == CFE_SUCCESS)
+ {
+ switch (Msg->Payload.MemType)
+ {
+ case MM_MemType_RAM:
+ case MM_MemType_EEPROM:
+ MM_FillMem(DestAddress, Msg);
+ break;
#ifdef MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE
- case MM_MemType_MEM32:
- Status = MM_FillMem32(DestAddress, Msg);
- break;
+ case MM_MemType_MEM32:
+ Status = MM_FillMem32(DestAddress, Msg);
+ break;
#endif
#ifdef MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE
- case MM_MemType_MEM16:
- Status = MM_FillMem16(DestAddress, Msg);
- break;
+ case MM_MemType_MEM16:
+ Status = MM_FillMem16(DestAddress, Msg);
+ break;
#endif
#ifdef MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE
- case MM_MemType_MEM8:
- Status = MM_FillMem8(DestAddress, Msg);
- break;
+ case MM_MemType_MEM8:
+ Status = MM_FillMem8(DestAddress, Msg);
+ break;
#endif
- /*
- ** We don't need a default case, a bad MemType will get caught
- ** in the MM_VerifyLoadDumpParams function and we won't get here
- */
- default:
- Status = CFE_PSP_ERROR;
- break;
- }
-
- if (Status == CFE_PSP_SUCCESS) {
- if (MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL) {
- MM_AppData.HkTlm.Payload.CmdCounter++;
- CFE_EVS_SendEvent(MM_FILL_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Fill Memory Command: Filled %d bytes at address: "
- "%p with pattern: 0x%08X",
- (int)MM_AppData.HkTlm.Payload.BytesProcessed,
- (void *)DestAddress,
- (unsigned int)MM_AppData.HkTlm.Payload.DataValue);
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
+ /*
+ ** We don't need a default case, a bad MemType will get caught
+ ** in the MM_VerifyLoadDumpParams function and we won't get here
+ */
+ default:
+ Status = CFE_PSP_ERROR;
+ break;
+ }
+
+ if (Status == CFE_PSP_SUCCESS)
+ {
+ if (MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL)
+ {
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ CFE_EVS_SendEvent(MM_FILL_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Fill Memory Command: Filled %d bytes at address: "
+ "%p with pattern: 0x%08X",
+ (int)MM_AppData.HkTlm.Payload.BytesProcessed,
+ (void *)DestAddress,
+ (unsigned int)MM_AppData.HkTlm.Payload.DataValue);
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ }
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ }
}
- } else {
- MM_AppData.HkTlm.Payload.CmdCounter++;
- }
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ }
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'",
+ DestSymAddress.SymName);
}
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'",
- DestSymAddress.SymName);
- }
-
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -646,46 +738,55 @@ CFE_Status_t MM_FillMemCmd(const MM_FillMemCmd_t *Msg) {
/* Memory peek command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_PeekCmd(const MM_PeekCmd_t *Msg) {
- cpuaddr SrcAddress = 0;
- MM_SymAddr_t SrcSymAddress;
- CFE_Status_t Status = OS_SUCCESS;
-
- SrcSymAddress = Msg->Payload.SrcSymAddress;
-
- /* Resolve the symbolic address in command message */
- Status = MM_ResolveSymAddr(&(SrcSymAddress), &SrcAddress);
-
- if (Status == OS_SUCCESS) {
- /* Run necessary checks on command parameters */
- Status = MM_VerifyPeekPokeParams(SrcAddress, Msg->Payload.MemType,
- Msg->Payload.DataSize);
-
- /* Check the specified memory type and call the appropriate routine */
- if (Status == OS_SUCCESS) {
- /*
- ** We use this single peek routine for all memory types
- ** (including the optional ones)
- */
- Status = MM_PeekMem(Msg, SrcAddress);
- if (Status == CFE_PSP_SUCCESS) {
- MM_AppData.HkTlm.Payload.CmdCounter++;
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- }
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
+CFE_Status_t MM_PeekCmd(const MM_PeekCmd_t *Msg)
+{
+ cpuaddr SrcAddress = 0;
+ MM_SymAddr_t SrcSymAddress;
+ CFE_Status_t Status = OS_SUCCESS;
+
+ SrcSymAddress = Msg->Payload.SrcSymAddress;
+
+ /* Resolve the symbolic address in command message */
+ Status = MM_ResolveSymAddr(&(SrcSymAddress), &SrcAddress);
+
+ if (Status == OS_SUCCESS)
+ {
+ /* Run necessary checks on command parameters */
+ Status = MM_VerifyPeekPokeParams(SrcAddress, Msg->Payload.MemType, Msg->Payload.DataSize);
+
+ /* Check the specified memory type and call the appropriate routine */
+ if (Status == OS_SUCCESS)
+ {
+ /*
+ ** We use this single peek routine for all memory types
+ ** (including the optional ones)
+ */
+ Status = MM_PeekMem(Msg, SrcAddress);
+ if (Status == CFE_PSP_SUCCESS)
+ {
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ }
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ }
+ } /* end MM_ResolveSymAddr if */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'",
+ Msg->Payload.SrcSymAddress.SymName);
}
- } /* end MM_ResolveSymAddr if */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'",
- Msg->Payload.SrcSymAddress.SymName);
- }
-
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -693,184 +794,206 @@ CFE_Status_t MM_PeekCmd(const MM_PeekCmd_t *Msg) {
/* Dump memory to file command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_DumpMemToFileCmd(const MM_DumpMemToFileCmd_t *Msg) {
- int32 Status;
- osal_id_t FileHandle = OS_OBJECT_ID_UNDEFINED;
- cpuaddr SrcAddress = 0;
- char FileName[CFE_MISSION_MAX_PATH_LEN];
- MM_SymAddr_t SrcSymAddress;
- CFE_FS_Header_t CFEFileHeader;
- MM_LoadDumpFileHeader_t MMFileHeader;
-
- SrcSymAddress = Msg->Payload.SrcSymAddress;
-
- /* Make sure strings are null terminated before attempting to process them */
- CFE_SB_MessageStringGet(FileName, Msg->Payload.FileName, NULL,
- sizeof(FileName), sizeof(Msg->Payload.FileName));
-
- /* Resolve the symbolic address in command message */
- Status = MM_ResolveSymAddr(&(SrcSymAddress), &SrcAddress);
-
- if (Status == OS_SUCCESS) {
- /* Run necessary checks on command parameters */
- Status = MM_VerifyLoadDumpParams(SrcAddress, Msg->Payload.MemType,
- Msg->Payload.NumOfBytes, MM_VERIFY_DUMP);
-
- if (Status == OS_SUCCESS) {
- /*
- ** Initialize the cFE primary file header structure
- */
- CFE_FS_InitHeader(&CFEFileHeader, MM_INTERNAL_CFE_HDR_DESCRIPTION,
- MM_INTERNAL_CFE_HDR_SUBTYPE);
-
- /*
- ** Initialize the MM secondary file header structure
- */
- memset(&MMFileHeader, 0, sizeof(MMFileHeader));
- MMFileHeader.SymAddress.SymName[0] = MM_INTERNAL_CLEAR_SYMNAME;
-
- /*
- ** Copy command data to file secondary header
- */
- MMFileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(SrcAddress);
- MMFileHeader.MemType = Msg->Payload.MemType;
- MMFileHeader.NumOfBytes = Msg->Payload.NumOfBytes;
-
- /*
- ** Create and open dump file
- */
- Status = OS_OpenCreate(&FileHandle, FileName,
- OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE,
- OS_READ_WRITE);
- if (Status == OS_SUCCESS) {
- /* Write the file headers */
- Status = MM_WriteFileHeaders(FileName, FileHandle, &CFEFileHeader,
- &MMFileHeader);
- if (Status == OS_SUCCESS) {
- switch (MMFileHeader.MemType) {
- case MM_MemType_RAM:
- case MM_MemType_EEPROM:
- Status = MM_DumpMemToFile(FileHandle, FileName, &MMFileHeader);
- break;
+CFE_Status_t MM_DumpMemToFileCmd(const MM_DumpMemToFileCmd_t *Msg)
+{
+ int32 Status;
+ osal_id_t FileHandle = OS_OBJECT_ID_UNDEFINED;
+ cpuaddr SrcAddress = 0;
+ char FileName[CFE_MISSION_MAX_PATH_LEN];
+ MM_SymAddr_t SrcSymAddress;
+ CFE_FS_Header_t CFEFileHeader;
+ MM_LoadDumpFileHeader_t MMFileHeader;
+
+ SrcSymAddress = Msg->Payload.SrcSymAddress;
+
+ /* Make sure strings are null terminated before attempting to process them */
+ CFE_SB_MessageStringGet(FileName, Msg->Payload.FileName, NULL, sizeof(FileName), sizeof(Msg->Payload.FileName));
+
+ /* Resolve the symbolic address in command message */
+ Status = MM_ResolveSymAddr(&(SrcSymAddress), &SrcAddress);
+
+ if (Status == OS_SUCCESS)
+ {
+ /* Run necessary checks on command parameters */
+ Status = MM_VerifyLoadDumpParams(SrcAddress, Msg->Payload.MemType, Msg->Payload.NumOfBytes, MM_VERIFY_DUMP);
+
+ if (Status == OS_SUCCESS)
+ {
+ /*
+ ** Initialize the cFE primary file header structure
+ */
+ CFE_FS_InitHeader(&CFEFileHeader, MM_INTERNAL_CFE_HDR_DESCRIPTION, MM_INTERNAL_CFE_HDR_SUBTYPE);
+
+ /*
+ ** Initialize the MM secondary file header structure
+ */
+ memset(&MMFileHeader, 0, sizeof(MMFileHeader));
+ MMFileHeader.SymAddress.SymName[0] = MM_INTERNAL_CLEAR_SYMNAME;
+
+ /*
+ ** Copy command data to file secondary header
+ */
+ MMFileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(SrcAddress);
+ MMFileHeader.MemType = Msg->Payload.MemType;
+ MMFileHeader.NumOfBytes = Msg->Payload.NumOfBytes;
+
+ /*
+ ** Create and open dump file
+ */
+ Status = OS_OpenCreate(&FileHandle, FileName, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_READ_WRITE);
+ if (Status == OS_SUCCESS)
+ {
+ /* Write the file headers */
+ Status = MM_WriteFileHeaders(FileName, FileHandle, &CFEFileHeader, &MMFileHeader);
+ if (Status == OS_SUCCESS)
+ {
+ switch (MMFileHeader.MemType)
+ {
+ case MM_MemType_RAM:
+ case MM_MemType_EEPROM:
+ Status = MM_DumpMemToFile(FileHandle, FileName, &MMFileHeader);
+ break;
#ifdef MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE
- case MM_MemType_MEM32:
- Status = MM_DumpMem32ToFile(FileHandle, FileName, &MMFileHeader);
- break;
+ case MM_MemType_MEM32:
+ Status = MM_DumpMem32ToFile(FileHandle, FileName, &MMFileHeader);
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE */
#ifdef MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE
- case MM_MemType_MEM16:
- Status = MM_DumpMem16ToFile(FileHandle, FileName, &MMFileHeader);
- break;
+ case MM_MemType_MEM16:
+ Status = MM_DumpMem16ToFile(FileHandle, FileName, &MMFileHeader);
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE */
#ifdef MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE
- case MM_MemType_MEM8:
- Status = MM_DumpMem8ToFile(FileHandle, FileName, &MMFileHeader);
- break;
+ case MM_MemType_MEM8:
+ Status = MM_DumpMem8ToFile(FileHandle, FileName, &MMFileHeader);
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE */
- default:
- /* This branch will never be executed. MMFileHeader.MemType will
- * always be valid value for this switch statement it is verified
- * via MM_VerifyFileLoadDumpParams */
- Status = CFE_PSP_ERROR;
- break;
- }
-
- if (Status == CFE_PSP_SUCCESS) {
- /*
- ** Compute CRC of dumped data
- */
- Status = OS_lseek(
- FileHandle,
- (sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t)),
- OS_SEEK_SET);
- if (Status !=
- (sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t))) {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- } else {
- Status = MM_ComputeCRCFromFile(FileHandle, &MMFileHeader.Crc,
- MM_INTERNAL_DUMP_FILE_CRC_TYPE);
- if (Status == OS_SUCCESS) {
- /*
- ** Rewrite the file headers. The subfunctions will take care of
- *moving
- ** the file pointer to the beginning of the file so we don't
- *need to do it
- ** here.
- */
- Status = MM_WriteFileHeaders(FileName, FileHandle,
- &CFEFileHeader, &MMFileHeader);
- if (Status == OS_SUCCESS) {
- /*
- ** Update last action statistics
- */
- MM_AppData.HkTlm.Payload.LastAction =
- MM_LastAction_DUMP_TO_FILE;
- MM_AppData.HkTlm.Payload.MemType = Msg->Payload.MemType;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(SrcAddress);
- MM_AppData.HkTlm.Payload.BytesProcessed =
- Msg->Payload.NumOfBytes;
- snprintf(MM_AppData.HkTlm.Payload.FileName,
- CFE_MISSION_MAX_PATH_LEN, "%s", FileName);
-
- MM_AppData.HkTlm.Payload.CmdCounter++;
- CFE_EVS_SendEvent(
- MM_DMP_MEM_FILE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Dump Memory To File Command: Dumped %d bytes from "
- "address %p to file '%s'",
- (int)MM_AppData.HkTlm.Payload.BytesProcessed,
- (void *)SrcAddress, FileName);
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
+ default:
+ /* This branch will never be executed. MMFileHeader.MemType will
+ * always be valid value for this switch statement it is verified
+ * via MM_VerifyFileLoadDumpParams */
+ Status = CFE_PSP_ERROR;
+ break;
+ }
+
+ if (Status == CFE_PSP_SUCCESS)
+ {
+ /*
+ ** Compute CRC of dumped data
+ */
+ Status = OS_lseek(FileHandle,
+ (sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t)),
+ OS_SEEK_SET);
+ if (Status != (sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t)))
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ }
+ else
+ {
+ Status =
+ MM_ComputeCRCFromFile(FileHandle, &MMFileHeader.Crc, MM_INTERNAL_DUMP_FILE_CRC_TYPE);
+ if (Status == OS_SUCCESS)
+ {
+ /*
+ ** Rewrite the file headers. The subfunctions will take care of
+ *moving
+ ** the file pointer to the beginning of the file so we don't
+ *need to do it
+ ** here.
+ */
+ Status = MM_WriteFileHeaders(FileName, FileHandle, &CFEFileHeader, &MMFileHeader);
+ if (Status == OS_SUCCESS)
+ {
+ /*
+ ** Update last action statistics
+ */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_DUMP_TO_FILE;
+ MM_AppData.HkTlm.Payload.MemType = Msg->Payload.MemType;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(SrcAddress);
+ MM_AppData.HkTlm.Payload.BytesProcessed = Msg->Payload.NumOfBytes;
+ snprintf(MM_AppData.HkTlm.Payload.FileName,
+ CFE_MISSION_MAX_PATH_LEN,
+ "%s",
+ FileName);
+
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ CFE_EVS_SendEvent(MM_DMP_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Dump Memory To File Command: Dumped %d bytes from "
+ "address %p to file '%s'",
+ (int)MM_AppData.HkTlm.Payload.BytesProcessed,
+ (void *)SrcAddress,
+ FileName);
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ }
+
+ } /* end MM_ComputeCRCFromFile if */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_COMPUTECRCFROMFILE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "MM_ComputeCRCFromFile error received: RC = "
+ "0x%08X File = '%s'",
+ (unsigned int)Status,
+ FileName);
+ }
+ }
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ }
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ } /* end MM_WriteFileHeaders if */
+
+ /* Close dump file */
+ if ((Status = OS_close(FileHandle)) != OS_SUCCESS)
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_OS_CLOSE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_close error received: RC = 0x%08X File = '%s'",
+ (unsigned int)Status,
+ FileName);
}
- } /* end MM_ComputeCRCFromFile if */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_COMPUTECRCFROMFILE_ERR_EID,
+ } /* end OS_OpenCreate if */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_OS_CREAT_ERR_EID,
CFE_EVS_EventType_ERROR,
- "MM_ComputeCRCFromFile error received: RC = "
- "0x%08X File = '%s'",
- (unsigned int)Status, FileName);
- }
+ "OS_OpenCreate error received: RC = %d File = '%s'",
+ (int)Status,
+ FileName);
}
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- }
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- } /* end MM_WriteFileHeaders if */
-
- /* Close dump file */
- if ((Status = OS_close(FileHandle)) != OS_SUCCESS) {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_OS_CLOSE_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_close error received: RC = 0x%08X File = '%s'",
- (unsigned int)Status, FileName);
}
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ } /* end MM_VerifyFileLoadDumpParams if */
+ } /* end MM_ResolveSymAddr if */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'",
+ SrcSymAddress.SymName);
+ }
- } /* end OS_OpenCreate if */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_OS_CREAT_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_OpenCreate error received: RC = %d File = '%s'",
- (int)Status, FileName);
- }
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- } /* end MM_VerifyFileLoadDumpParams if */
- } /* end MM_ResolveSymAddr if */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'",
- SrcSymAddress.SymName);
- }
-
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -878,105 +1001,116 @@ CFE_Status_t MM_DumpMemToFileCmd(const MM_DumpMemToFileCmd_t *Msg) {
/* Dump memory in event message command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_DumpInEventCmd(const MM_DumpInEventCmd_t *Msg) {
- uint32 i;
- int32 EventStringTotalLength = 0;
- cpuaddr SrcAddress = 0;
- uint8 *BytePtr;
- char TempString[MM_INTERNAL_DUMPINEVENT_TEMP_CHARS];
- const char HeaderString[] = "Memory Dump: ";
- static char EventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH];
- MM_SymAddr_t SrcSymAddress;
- int32 Status;
-
- /*
- ** Allocate a dump buffer. It's declared this way to ensure it stays
- ** longword aligned since MM_INTERNAL_MAX_DUMP_INEVENT_BYTES can be adjusted
- ** by changing the maximum event message string size.
- */
- uint32 DumpBuffer[(MM_INTERNAL_MAX_DUMP_INEVENT_BYTES + 3) / 4];
-
- SrcSymAddress = Msg->Payload.SrcSymAddress;
-
- /* Resolve the symbolic source address in the command message */
- Status = MM_ResolveSymAddr(&(SrcSymAddress), &SrcAddress);
-
- if (Status == OS_SUCCESS) {
- /* Run necessary checks on command parameters */
- Status = MM_VerifyLoadDumpParams(SrcAddress, Msg->Payload.MemType,
- Msg->Payload.NumOfBytes, MM_VERIFY_EVENT);
-
- if (Status == CFE_PSP_SUCCESS) {
- /* Fill a local data buffer with the dump words */
- Status = MM_FillDumpInEventBuffer(SrcAddress, Msg, (uint8 *)DumpBuffer);
-
- if (Status == CFE_PSP_SUCCESS) {
- /*
- ** Prepare event message string header
- ** 13 characters, not counting NUL terminator
- */
- CFE_SB_MessageStringGet(
- &EventString[EventStringTotalLength], HeaderString, NULL,
- sizeof(EventString) - EventStringTotalLength, sizeof(HeaderString));
- EventStringTotalLength =
- OS_strnlen(EventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH);
+CFE_Status_t MM_DumpInEventCmd(const MM_DumpInEventCmd_t *Msg)
+{
+ uint32 i;
+ int32 EventStringTotalLength = 0;
+ cpuaddr SrcAddress = 0;
+ uint8 *BytePtr;
+ char TempString[MM_INTERNAL_DUMPINEVENT_TEMP_CHARS];
+ const char HeaderString[] = "Memory Dump: ";
+ static char EventString[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH];
+ MM_SymAddr_t SrcSymAddress;
+ int32 Status;
- /*
- ** Build dump data string
- ** Each byte of data requires 5 characters of string space
- ** Note this really only allows up to ~15 bytes using default config
- */
- BytePtr = (uint8 *)DumpBuffer;
- for (i = 0; i < Msg->Payload.NumOfBytes; i++) {
- /* SAD: No need to check snprintf return; CFE_SB_MessageStringGet()
- * handles safe concatenation and prevents overflow */
- snprintf(TempString, MM_INTERNAL_DUMPINEVENT_TEMP_CHARS, "0x%02X ",
- *BytePtr);
- CFE_SB_MessageStringGet(
- &EventString[EventStringTotalLength], TempString, NULL,
- sizeof(EventString) - EventStringTotalLength, sizeof(TempString));
- EventStringTotalLength =
- OS_strnlen(EventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH);
- BytePtr++;
- }
+ /*
+ ** Allocate a dump buffer. It's declared this way to ensure it stays
+ ** longword aligned since MM_INTERNAL_MAX_DUMP_INEVENT_BYTES can be adjusted
+ ** by changing the maximum event message string size.
+ */
+ uint32 DumpBuffer[(MM_INTERNAL_MAX_DUMP_INEVENT_BYTES + 3) / 4];
- /*
- ** Append tail
- ** This adds up to 33 characters depending on pointer representation
- *including the NUL terminator
- */
- /* SAD: No need to check snprintf return; CFE_SB_MessageStringGet()
- * handles safe concatenation and prevents overflow */
- snprintf(TempString, MM_INTERNAL_DUMPINEVENT_TEMP_CHARS,
- "from address: %p", (void *)SrcAddress);
- CFE_SB_MessageStringGet(
- &EventString[EventStringTotalLength], TempString, NULL,
- sizeof(EventString) - EventStringTotalLength, sizeof(TempString));
-
- /* Send it out */
- CFE_EVS_SendEvent(MM_DUMP_INEVENT_INF_EID,
- CFE_EVS_EventType_INFORMATION, "%s", EventString);
+ SrcSymAddress = Msg->Payload.SrcSymAddress;
- /* Update telemetry */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_DUMP_INEVENT;
- MM_AppData.HkTlm.Payload.MemType = Msg->Payload.MemType;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(SrcAddress);
- MM_AppData.HkTlm.Payload.BytesProcessed = Msg->Payload.NumOfBytes;
- MM_AppData.HkTlm.Payload.CmdCounter++;
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- } /* end MM_FillDumpInEventBuffer if */
- } else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- } /* end MM_VerifyFileLoadDumpParams if */
- } /* end MM_ResolveSymAddr if */
- else {
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'",
- SrcSymAddress.SymName);
- }
-
- /* Nothing atypical needs to be done so return success */
- return CFE_SUCCESS;
-}
\ No newline at end of file
+ /* Resolve the symbolic source address in the command message */
+ Status = MM_ResolveSymAddr(&(SrcSymAddress), &SrcAddress);
+
+ if (Status == OS_SUCCESS)
+ {
+ /* Run necessary checks on command parameters */
+ Status = MM_VerifyLoadDumpParams(SrcAddress, Msg->Payload.MemType, Msg->Payload.NumOfBytes, MM_VERIFY_EVENT);
+
+ if (Status == CFE_PSP_SUCCESS)
+ {
+ /* Fill a local data buffer with the dump words */
+ Status = MM_FillDumpInEventBuffer(SrcAddress, Msg, (uint8 *)DumpBuffer);
+
+ if (Status == CFE_PSP_SUCCESS)
+ {
+ /*
+ ** Prepare event message string header
+ ** 13 characters, not counting NUL terminator
+ */
+ CFE_SB_MessageStringGet(&EventString[EventStringTotalLength],
+ HeaderString,
+ NULL,
+ sizeof(EventString) - EventStringTotalLength,
+ sizeof(HeaderString));
+ EventStringTotalLength = OS_strnlen(EventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH);
+
+ /*
+ ** Build dump data string
+ ** Each byte of data requires 5 characters of string space
+ ** Note this really only allows up to ~15 bytes using default config
+ */
+ BytePtr = (uint8 *)DumpBuffer;
+ for (i = 0; i < Msg->Payload.NumOfBytes; i++)
+ {
+ /* SAD: No need to check snprintf return; CFE_SB_MessageStringGet()
+ * handles safe concatenation and prevents overflow */
+ snprintf(TempString, MM_INTERNAL_DUMPINEVENT_TEMP_CHARS, "0x%02X ", *BytePtr);
+ CFE_SB_MessageStringGet(&EventString[EventStringTotalLength],
+ TempString,
+ NULL,
+ sizeof(EventString) - EventStringTotalLength,
+ sizeof(TempString));
+ EventStringTotalLength = OS_strnlen(EventString, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH);
+ BytePtr++;
+ }
+
+ /*
+ ** Append tail
+ ** This adds up to 33 characters depending on pointer representation
+ *including the NUL terminator
+ */
+ /* SAD: No need to check snprintf return; CFE_SB_MessageStringGet()
+ * handles safe concatenation and prevents overflow */
+ snprintf(TempString, MM_INTERNAL_DUMPINEVENT_TEMP_CHARS, "from address: %p", (void *)SrcAddress);
+ CFE_SB_MessageStringGet(&EventString[EventStringTotalLength],
+ TempString,
+ NULL,
+ sizeof(EventString) - EventStringTotalLength,
+ sizeof(TempString));
+
+ /* Send it out */
+ CFE_EVS_SendEvent(MM_DUMP_INEVENT_INF_EID, CFE_EVS_EventType_INFORMATION, "%s", EventString);
+
+ /* Update telemetry */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_DUMP_INEVENT;
+ MM_AppData.HkTlm.Payload.MemType = Msg->Payload.MemType;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(SrcAddress);
+ MM_AppData.HkTlm.Payload.BytesProcessed = Msg->Payload.NumOfBytes;
+ MM_AppData.HkTlm.Payload.CommandCounter++;
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ } /* end MM_FillDumpInEventBuffer if */
+ }
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ } /* end MM_VerifyFileLoadDumpParams if */
+ } /* end MM_ResolveSymAddr if */
+ else
+ {
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'",
+ SrcSymAddress.SymName);
+ }
+
+ /* Nothing atypical needs to be done so return success */
+ return CFE_SUCCESS;
+}
diff --git a/fsw/src/mm_dispatch.c b/fsw/src/mm_dispatch.c
index dea3ab7..586f32d 100644
--- a/fsw/src/mm_dispatch.c
+++ b/fsw/src/mm_dispatch.c
@@ -38,34 +38,37 @@
/* Verify command packet length */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
-bool MM_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr,
- size_t ExpectedLength) {
- bool result = true;
- size_t ActualLength = 0;
- CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID;
- CFE_MSG_FcnCode_t FcnCode = 0;
-
- CFE_MSG_GetSize(MsgPtr, &ActualLength);
-
- /*
- ** Verify the command packet length.
- */
- if (ExpectedLength != ActualLength) {
- CFE_MSG_GetMsgId(MsgPtr, &MsgId);
- CFE_MSG_GetFcnCode(MsgPtr, &FcnCode);
-
- CFE_EVS_SendEvent(
- MM_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid Msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u",
- (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode,
- (unsigned int)ActualLength, (unsigned int)ExpectedLength);
-
- result = false;
-
- MM_AppData.HkTlm.Payload.ErrCounter++;
- }
-
- return result;
+bool MM_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength)
+{
+ bool result = true;
+ size_t ActualLength = 0;
+ CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID;
+ CFE_MSG_FcnCode_t FcnCode = 0;
+
+ CFE_MSG_GetSize(MsgPtr, &ActualLength);
+
+ /*
+ ** Verify the command packet length.
+ */
+ if (ExpectedLength != ActualLength)
+ {
+ CFE_MSG_GetMsgId(MsgPtr, &MsgId);
+ CFE_MSG_GetFcnCode(MsgPtr, &FcnCode);
+
+ CFE_EVS_SendEvent(MM_CMD_LEN_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Invalid Msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u",
+ (unsigned int)CFE_SB_MsgIdToValue(MsgId),
+ (unsigned int)FcnCode,
+ (unsigned int)ActualLength,
+ (unsigned int)ExpectedLength);
+
+ result = false;
+
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ }
+
+ return result;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -73,97 +76,111 @@ bool MM_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr,
/* Process a command pipe message */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-void MM_ProcessGroundCommand(const CFE_SB_Buffer_t *BufPtr) {
- CFE_MSG_FcnCode_t CommandCode = 0;
-
- MM_ResetHk(); /* Clear all "Last Action" data */
-
- CFE_MSG_GetFcnCode(&BufPtr->Msg, &CommandCode);
- switch (CommandCode) {
- case MM_NOOP_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_NoopCmd_t))) {
- MM_NoopCmd((MM_NoopCmd_t *)BufPtr);
- }
- break;
-
- case MM_RESET_COUNTERS_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_ResetCountersCmd_t))) {
- MM_ResetCountersCmd((MM_ResetCountersCmd_t *)BufPtr);
- }
- break;
-
- case MM_PEEK_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_PeekCmd_t))) {
- MM_PeekCmd((MM_PeekCmd_t *)BufPtr);
- }
- break;
-
- case MM_POKE_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_PokeCmd_t))) {
- MM_PokeCmd((MM_PokeCmd_t *)BufPtr);
- }
- break;
-
- case MM_LOAD_MEM_WID_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_LoadMemWIDCmd_t))) {
- MM_LoadMemWIDCmd((MM_LoadMemWIDCmd_t *)BufPtr);
- }
- break;
-
- case MM_LOAD_MEM_FROM_FILE_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_LoadMemFromFileCmd_t))) {
- MM_LoadMemFromFileCmd((MM_LoadMemFromFileCmd_t *)BufPtr);
- }
- break;
-
- case MM_DUMP_MEM_TO_FILE_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_DumpMemToFileCmd_t))) {
- MM_DumpMemToFileCmd((MM_DumpMemToFileCmd_t *)BufPtr);
+void MM_ProcessGroundCommand(const CFE_SB_Buffer_t *BufPtr)
+{
+ CFE_MSG_FcnCode_t CommandCode = 0;
+
+ MM_ResetHk(); /* Clear all "Last Action" data */
+
+ CFE_MSG_GetFcnCode(&BufPtr->Msg, &CommandCode);
+ switch (CommandCode)
+ {
+ case MM_NOOP_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_NoopCmd_t)))
+ {
+ MM_NoopCmd((MM_NoopCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_RESET_COUNTERS_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_ResetCountersCmd_t)))
+ {
+ MM_ResetCountersCmd((MM_ResetCountersCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_PEEK_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_PeekCmd_t)))
+ {
+ MM_PeekCmd((MM_PeekCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_POKE_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_PokeCmd_t)))
+ {
+ MM_PokeCmd((MM_PokeCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_LOAD_MEM_WID_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_LoadMemWIDCmd_t)))
+ {
+ MM_LoadMemWIDCmd((MM_LoadMemWIDCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_LOAD_MEM_FROM_FILE_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_LoadMemFromFileCmd_t)))
+ {
+ MM_LoadMemFromFileCmd((MM_LoadMemFromFileCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_DUMP_MEM_TO_FILE_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_DumpMemToFileCmd_t)))
+ {
+ MM_DumpMemToFileCmd((MM_DumpMemToFileCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_DUMP_IN_EVENT_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_DumpInEventCmd_t)))
+ {
+ MM_DumpInEventCmd((MM_DumpInEventCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_FILL_MEM_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_FillMemCmd_t)))
+ {
+ MM_FillMemCmd((MM_FillMemCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_LOOKUP_SYM_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_LookupSymCmd_t)))
+ {
+ MM_LookupSymCmd((MM_LookupSymCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_SYM_TBL_TO_FILE_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_SymTblToFileCmd_t)))
+ {
+ MM_SymTblToFileCmd((MM_SymTblToFileCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_EEPROM_WRITE_ENA_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_EepromWriteEnaCmd_t)))
+ {
+ MM_EepromWriteEnaCmd((MM_EepromWriteEnaCmd_t *)BufPtr);
+ }
+ break;
+
+ case MM_EEPROM_WRITE_DIS_CC:
+ if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_EepromWriteDisCmd_t)))
+ {
+ MM_EepromWriteDisCmd((MM_EepromWriteDisCmd_t *)BufPtr);
+ }
+ break;
+
+ default:
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_CC_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid ground command code %d", CommandCode);
+ break;
}
- break;
-
- case MM_DUMP_IN_EVENT_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_DumpInEventCmd_t))) {
- MM_DumpInEventCmd((MM_DumpInEventCmd_t *)BufPtr);
- }
- break;
-
- case MM_FILL_MEM_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_FillMemCmd_t))) {
- MM_FillMemCmd((MM_FillMemCmd_t *)BufPtr);
- }
- break;
-
- case MM_LOOKUP_SYM_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_LookupSymCmd_t))) {
- MM_LookupSymCmd((MM_LookupSymCmd_t *)BufPtr);
- }
- break;
-
- case MM_SYM_TBL_TO_FILE_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_SymTblToFileCmd_t))) {
- MM_SymTblToFileCmd((MM_SymTblToFileCmd_t *)BufPtr);
- }
- break;
-
- case MM_EEPROM_WRITE_ENA_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_EepromWriteEnaCmd_t))) {
- MM_EepromWriteEnaCmd((MM_EepromWriteEnaCmd_t *)BufPtr);
- }
- break;
-
- case MM_EEPROM_WRITE_DIS_CC:
- if (MM_VerifyCmdLength(&BufPtr->Msg, sizeof(MM_EepromWriteDisCmd_t))) {
- MM_EepromWriteDisCmd((MM_EepromWriteDisCmd_t *)BufPtr);
- }
- break;
-
- default:
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_CC_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid ground command code %d", CommandCode);
- break;
- }
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
@@ -173,28 +190,48 @@ void MM_ProcessGroundCommand(const CFE_SB_Buffer_t *BufPtr) {
/* command pipe. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-void MM_TaskPipe(const CFE_SB_Buffer_t *BufPtr) {
- CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID;
-
- CFE_MSG_GetMsgId(&BufPtr->Msg, &MsgId);
-
- switch (CFE_SB_MsgIdToValue(MsgId)) {
- case MM_CMD_MID:
- MM_ProcessGroundCommand(BufPtr);
- break;
+void MM_TaskPipe(const CFE_SB_Buffer_t *BufPtr)
+{
+ static CFE_SB_MsgId_t CMD_MID = CFE_SB_MSGID_RESERVED;
+ static CFE_SB_MsgId_t SEND_HK_MID = CFE_SB_MSGID_RESERVED;
+
+ CFE_SB_MsgId_t MsgId = CFE_SB_INVALID_MSG_ID;
+
+ /* cache the local MID Values here, this avoids repeat lookups */
+ if (!CFE_SB_IsValidMsgId(CMD_MID))
+ {
+ /*
+ ** Initialize application MID values
+ */
+ CMD_MID = CFE_SB_ValueToMsgId(MM_CMD_MID);
+ SEND_HK_MID = CFE_SB_ValueToMsgId(MM_SEND_HK_MID);
+ }
- case MM_SEND_HK_MID:
- MM_SendHkCmd((MM_SendHkCmd_t *)BufPtr);
- break;
+ CFE_MSG_GetMsgId(&BufPtr->Msg, &MsgId);
- default:
- /*
- ** Unrecognized Message ID
- */
- MM_AppData.HkTlm.Payload.ErrCounter++;
- CFE_EVS_SendEvent(MM_MID_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid command pipe message ID: 0x%08lX",
- (unsigned long)CFE_SB_MsgIdToValue(MsgId));
- break;
- }
+ if (CFE_SB_MsgId_Equal(MsgId, CMD_MID))
+ {
+ /*
+ ** MM ground commands
+ */
+ MM_ProcessGroundCommand(BufPtr);
+ }
+ else if (CFE_SB_MsgId_Equal(MsgId, SEND_HK_MID))
+ {
+ /*
+ ** Housekeeping telemetry request
+ */
+ MM_SendHkCmd((MM_SendHkCmd_t *)BufPtr);
+ }
+ else
+ {
+ /*
+ ** Unrecognized Message ID
+ */
+ MM_AppData.HkTlm.Payload.CommandErrorCounter++;
+ CFE_EVS_SendEvent(MM_MID_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Invalid command pipe message ID: 0x%08lX",
+ (unsigned long)CFE_SB_MsgIdToValue(MsgId));
+ }
}
diff --git a/fsw/src/mm_dump.c b/fsw/src/mm_dump.c
index 7c0fe11..84145b0 100644
--- a/fsw/src/mm_dump.c
+++ b/fsw/src/mm_dump.c
@@ -44,80 +44,92 @@ extern MM_AppData_t MM_AppData;
/* Read 8,16, or 32 bits of data from any given input address */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_PeekMem(const MM_PeekCmd_t *CmdPtr, cpuaddr SrcAddress) {
- uint8 ByteValue = 0;
- uint16 WordValue = 0;
- uint32 DWordValue = 0;
- int32 PSP_Status = CFE_PSP_ERROR_NOT_IMPLEMENTED;
- size_t BytesProcessed = 0;
- uint32 DataValue = 0;
- size_t DataSize = 0;
- uint32 EventID = 0;
-
- /*
- ** Read the requested number of bytes and report in an event message
- */
- switch (CmdPtr->Payload.DataSize) {
- case MM_INTERNAL_BYTE_BIT_WIDTH:
-
- PSP_Status = CFE_PSP_MemRead8(SrcAddress, &ByteValue);
- DataSize = 8;
- if (PSP_Status == CFE_PSP_SUCCESS) {
- DataValue = (uint32)ByteValue;
- BytesProcessed = sizeof(uint8);
- EventID = MM_PEEK_BYTE_INF_EID;
- }
- break;
-
- case MM_INTERNAL_WORD_BIT_WIDTH:
+int32 MM_PeekMem(const MM_PeekCmd_t *CmdPtr, cpuaddr SrcAddress)
+{
+ uint8 ByteValue = 0;
+ uint16 WordValue = 0;
+ uint32 DWordValue = 0;
+ int32 PSP_Status = CFE_PSP_ERROR_NOT_IMPLEMENTED;
+ size_t BytesProcessed = 0;
+ uint32 DataValue = 0;
+ size_t DataSize = 0;
+ uint32 EventID = 0;
- PSP_Status = CFE_PSP_MemRead16(SrcAddress, &WordValue);
- DataSize = 16;
- if (PSP_Status == CFE_PSP_SUCCESS) {
- DataValue = (uint32)WordValue;
- BytesProcessed = sizeof(uint16);
- EventID = MM_PEEK_WORD_INF_EID;
+ /*
+ ** Read the requested number of bytes and report in an event message
+ */
+ switch (CmdPtr->Payload.DataSize)
+ {
+ case MM_INTERNAL_BYTE_BIT_WIDTH:
+
+ PSP_Status = CFE_PSP_MemRead8(SrcAddress, &ByteValue);
+ DataSize = 8;
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ DataValue = (uint32)ByteValue;
+ BytesProcessed = sizeof(uint8);
+ EventID = MM_PEEK_BYTE_INF_EID;
+ }
+ break;
+
+ case MM_INTERNAL_WORD_BIT_WIDTH:
+
+ PSP_Status = CFE_PSP_MemRead16(SrcAddress, &WordValue);
+ DataSize = 16;
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ DataValue = (uint32)WordValue;
+ BytesProcessed = sizeof(uint16);
+ EventID = MM_PEEK_WORD_INF_EID;
+ }
+ break;
+
+ case MM_INTERNAL_DWORD_BIT_WIDTH:
+
+ PSP_Status = CFE_PSP_MemRead32(SrcAddress, &DWordValue);
+ DataSize = 32;
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ DataValue = DWordValue;
+ BytesProcessed = sizeof(uint32);
+ EventID = MM_PEEK_DWORD_INF_EID;
+ }
+ break;
+
+ /*
+ ** We don't need a default case, a bad DataSize will get caught
+ ** in the MM_VerifyPeekPokeParams function and we won't get here
+ */
+ default:
+ break;
}
- break;
- case MM_INTERNAL_DWORD_BIT_WIDTH:
-
- PSP_Status = CFE_PSP_MemRead32(SrcAddress, &DWordValue);
- DataSize = 32;
- if (PSP_Status == CFE_PSP_SUCCESS) {
- DataValue = DWordValue;
- BytesProcessed = sizeof(uint32);
- EventID = MM_PEEK_DWORD_INF_EID;
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_PEEK;
+ MM_AppData.HkTlm.Payload.MemType = CmdPtr->Payload.MemType;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(SrcAddress);
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ MM_AppData.HkTlm.Payload.DataValue = DataValue;
+
+ CFE_EVS_SendEvent(EventID,
+ CFE_EVS_EventType_INFORMATION,
+ "Peek Command: Addr = %p Size = %u bits Data = 0x%08X",
+ (void *)SrcAddress,
+ (unsigned int)DataSize,
+ (unsigned int)DataValue);
+ }
+ else
+ {
+ CFE_EVS_SendEvent(MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=%d, Address=%p, MemType=MEM%u",
+ (int)PSP_Status,
+ (void *)SrcAddress,
+ (unsigned int)DataSize);
}
- break;
-
- /*
- ** We don't need a default case, a bad DataSize will get caught
- ** in the MM_VerifyPeekPokeParams function and we won't get here
- */
- default:
- break;
- }
-
- if (PSP_Status == CFE_PSP_SUCCESS) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_PEEK;
- MM_AppData.HkTlm.Payload.MemType = CmdPtr->Payload.MemType;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(SrcAddress);
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- MM_AppData.HkTlm.Payload.DataValue = DataValue;
-
- CFE_EVS_SendEvent(EventID, CFE_EVS_EventType_INFORMATION,
- "Peek Command: Addr = %p Size = %u bits Data = 0x%08X",
- (void *)SrcAddress, (unsigned int)DataSize,
- (unsigned int)DataValue);
- } else {
- CFE_EVS_SendEvent(MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=%d, Address=%p, MemType=MEM%u",
- (int)PSP_Status, (void *)SrcAddress,
- (unsigned int)DataSize);
- }
-
- return PSP_Status;
+
+ return PSP_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -125,56 +137,66 @@ int32 MM_PeekMem(const MM_PeekCmd_t *CmdPtr, cpuaddr SrcAddress) {
/* Dump the requested number of bytes from memory to a file */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_DumpMemToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader) {
- int32 OS_Status = OS_SUCCESS;
- uint32 BytesRemaining = FileHeader->NumOfBytes;
- size_t BytesProcessed = 0;
- size_t SegmentSize = MM_INTERNAL_MAX_DUMP_DATA_SEG;
- uint8 *SourcePtr = CFE_ES_MEMADDRESS_TO_PTR(FileHeader->SymAddress.Offset);
- uint8 *ioBuffer = (uint8 *)&MM_AppData.DumpBuffer[0];
-
- while (BytesRemaining != 0) {
- if (BytesRemaining < MM_INTERNAL_MAX_DUMP_DATA_SEG) {
- SegmentSize = BytesRemaining;
+int32 MM_DumpMemToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader)
+{
+ int32 OS_Status = OS_SUCCESS;
+ uint32 BytesRemaining = FileHeader->NumOfBytes;
+ size_t BytesProcessed = 0;
+ size_t SegmentSize = MM_INTERNAL_MAX_DUMP_DATA_SEG;
+ uint8 *SourcePtr = CFE_ES_MEMADDRESS_TO_PTR(FileHeader->SymAddress.Offset);
+ uint8 *ioBuffer = (uint8 *)&MM_AppData.DumpBuffer[0];
+
+ while (BytesRemaining != 0)
+ {
+ if (BytesRemaining < MM_INTERNAL_MAX_DUMP_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
+
+ memcpy(ioBuffer, SourcePtr, SegmentSize);
+
+ OS_Status = OS_write(FileHandle, ioBuffer, SegmentSize);
+ if (OS_Status == SegmentSize)
+ {
+ SourcePtr += SegmentSize;
+ BytesRemaining -= SegmentSize;
+ BytesProcessed += SegmentSize;
+
+ /* Prevent CPU hogging between dump segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
+
+ OS_Status = OS_SUCCESS;
+ }
+ else
+ {
+ BytesRemaining = 0;
+ CFE_EVS_SendEvent(MM_OS_WRITE_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_write error received: RC = %d, Expected = %u, File = '%s'",
+ (int)OS_Status,
+ (unsigned int)SegmentSize,
+ FileName);
+ }
}
- memcpy(ioBuffer, SourcePtr, SegmentSize);
-
- OS_Status = OS_write(FileHandle, ioBuffer, SegmentSize);
- if (OS_Status == SegmentSize) {
- SourcePtr += SegmentSize;
- BytesRemaining -= SegmentSize;
- BytesProcessed += SegmentSize;
-
- /* Prevent CPU hogging between dump segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
- }
-
- OS_Status = OS_SUCCESS;
- } else {
- BytesRemaining = 0;
- CFE_EVS_SendEvent(
- MM_OS_WRITE_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_write error received: RC = %d, Expected = %u, File = '%s'",
- (int)OS_Status, (unsigned int)SegmentSize, FileName);
+ /* Update last action statistics */
+ if (BytesProcessed == FileHeader->NumOfBytes)
+ {
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_DUMP_TO_FILE;
+ MM_AppData.HkTlm.Payload.MemType = FileHeader->MemType;
+ MM_AppData.HkTlm.Payload.Address = FileHeader->SymAddress.Offset;
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ strncpy(MM_AppData.HkTlm.Payload.FileName, FileName, CFE_MISSION_MAX_PATH_LEN);
+ }
+ else
+ {
+ OS_Status = OS_ERROR;
}
- }
-
- /* Update last action statistics */
- if (BytesProcessed == FileHeader->NumOfBytes) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_DUMP_TO_FILE;
- MM_AppData.HkTlm.Payload.MemType = FileHeader->MemType;
- MM_AppData.HkTlm.Payload.Address = FileHeader->SymAddress.Offset;
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- strncpy(MM_AppData.HkTlm.Payload.FileName, FileName,
- CFE_MISSION_MAX_PATH_LEN);
- } else {
- OS_Status = OS_ERROR;
- }
-
- return OS_Status;
+
+ return OS_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -182,43 +204,53 @@ int32 MM_DumpMemToFile(osal_id_t FileHandle, const char *FileName,
/* Write the cFE primary and MM secondary file headers */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_WriteFileHeaders(const char *FileName, osal_id_t FileHandle,
- CFE_FS_Header_t *CFEHeader,
- const MM_LoadDumpFileHeader_t *MMHeader) {
- int32 OS_Status;
-
- /*
- ** Write out the primary cFE file header
- */
- OS_Status = CFE_FS_WriteHeader(FileHandle, CFEHeader);
- if (OS_Status != sizeof(CFE_FS_Header_t)) {
- /* We either got an error or didn't write as much data as expected */
- OS_Status = OS_ERR_INVALID_SIZE;
- CFE_EVS_SendEvent(
- MM_CFE_FS_WRITEHDR_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_FS_WriteHeader error received: RC = %d Expected = %d File = '%s'",
- (int)OS_Status, (int)sizeof(CFE_FS_Header_t), FileName);
-
- } /* end CFE_FS_WriteHeader if */
- else {
+int32 MM_WriteFileHeaders(const char *FileName,
+ osal_id_t FileHandle,
+ CFE_FS_Header_t *CFEHeader,
+ const MM_LoadDumpFileHeader_t *MMHeader)
+{
+ int32 OS_Status;
+
/*
- ** Write out the secondary MM file header
+ ** Write out the primary cFE file header
*/
- OS_Status = OS_write(FileHandle, MMHeader, sizeof(MM_LoadDumpFileHeader_t));
- if (OS_Status != sizeof(MM_LoadDumpFileHeader_t)) {
- /* We either got an error or didn't read as much data as expected */
- OS_Status = OS_ERR_INVALID_SIZE;
- CFE_EVS_SendEvent(
- MM_OS_WRITE_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_write error received: RC = %d Expected = %u File = '%s'",
- (int)OS_Status, (unsigned int)sizeof(MM_LoadDumpFileHeader_t),
- FileName);
- } else {
- OS_Status = OS_SUCCESS;
- }
- } /* end CFE_FS_WriteHeader else */
-
- return OS_Status;
+ OS_Status = CFE_FS_WriteHeader(FileHandle, CFEHeader);
+ if (OS_Status != sizeof(CFE_FS_Header_t))
+ {
+ /* We either got an error or didn't write as much data as expected */
+ OS_Status = OS_ERR_INVALID_SIZE;
+ CFE_EVS_SendEvent(MM_CFE_FS_WRITEHDR_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_FS_WriteHeader error received: RC = %d Expected = %d File = '%s'",
+ (int)OS_Status,
+ (int)sizeof(CFE_FS_Header_t),
+ FileName);
+
+ } /* end CFE_FS_WriteHeader if */
+ else
+ {
+ /*
+ ** Write out the secondary MM file header
+ */
+ OS_Status = OS_write(FileHandle, MMHeader, sizeof(MM_LoadDumpFileHeader_t));
+ if (OS_Status != sizeof(MM_LoadDumpFileHeader_t))
+ {
+ /* We either got an error or didn't read as much data as expected */
+ OS_Status = OS_ERR_INVALID_SIZE;
+ CFE_EVS_SendEvent(MM_OS_WRITE_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_write error received: RC = %d Expected = %u File = '%s'",
+ (int)OS_Status,
+ (unsigned int)sizeof(MM_LoadDumpFileHeader_t),
+ FileName);
+ }
+ else
+ {
+ OS_Status = OS_SUCCESS;
+ }
+ } /* end CFE_FS_WriteHeader else */
+
+ return OS_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -226,95 +258,112 @@ int32 MM_WriteFileHeaders(const char *FileName, osal_id_t FileHandle,
/* Fill a buffer with data to be dumped in an event message string */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_FillDumpInEventBuffer(cpuaddr SrcAddress,
- const MM_DumpInEventCmd_t *CmdPtr,
- void *DumpBuffer) {
-#if defined(MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE) || \
- defined(MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE) || \
- defined(MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE)
- uint32 i;
+int32 MM_FillDumpInEventBuffer(cpuaddr SrcAddress, const MM_DumpInEventCmd_t *CmdPtr, void *DumpBuffer)
+{
+#if defined(MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE) || defined(MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE) \
+ || defined(MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE)
+ uint32 i;
#endif
- /* cppcheck-suppress unusedVariable */
- int32 PSP_Status;
+ /* cppcheck-suppress unusedVariable */
+ int32 PSP_Status;
- /* Initialize buffer */
- memset(DumpBuffer, 0, MM_INTERNAL_MAX_DUMP_INEVENT_BYTES);
+ /* Initialize buffer */
+ memset(DumpBuffer, 0, MM_INTERNAL_MAX_DUMP_INEVENT_BYTES);
- switch (CmdPtr->Payload.MemType) {
- case MM_MemType_RAM:
- case MM_MemType_EEPROM:
- memcpy((void *)DumpBuffer, (void *)SrcAddress, CmdPtr->Payload.NumOfBytes);
- PSP_Status = CFE_PSP_SUCCESS;
+ switch (CmdPtr->Payload.MemType)
+ {
+ case MM_MemType_RAM:
+ case MM_MemType_EEPROM:
+ memcpy((void *)DumpBuffer, (void *)SrcAddress, CmdPtr->Payload.NumOfBytes);
+ PSP_Status = CFE_PSP_SUCCESS;
- break;
+ break;
#ifdef MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE
- case MM_MemType_MEM32:
- for (i = 0; i < (CmdPtr->Payload.NumOfBytes / 4); i++) {
- PSP_Status = CFE_PSP_MemRead32(SrcAddress, (uint32 *)DumpBuffer);
- if (PSP_Status == CFE_PSP_SUCCESS) {
- SrcAddress += sizeof(uint32);
- DumpBuffer = (uint8 *)DumpBuffer + sizeof(uint32);
- } else {
- /* CFE_PSP_MemRead32 error */
- CFE_EVS_SendEvent(
- MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM32",
- (int)PSP_Status, (void *)SrcAddress, (void *)DumpBuffer);
- /* Stop load dump buffer loop */
- break;
- }
- }
- break;
+ case MM_MemType_MEM32:
+ for (i = 0; i < (CmdPtr->Payload.NumOfBytes / 4); i++)
+ {
+ PSP_Status = CFE_PSP_MemRead32(SrcAddress, (uint32 *)DumpBuffer);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ SrcAddress += sizeof(uint32);
+ DumpBuffer = (uint8 *)DumpBuffer + sizeof(uint32);
+ }
+ else
+ {
+ /* CFE_PSP_MemRead32 error */
+ CFE_EVS_SendEvent(MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM32",
+ (int)PSP_Status,
+ (void *)SrcAddress,
+ (void *)DumpBuffer);
+ /* Stop load dump buffer loop */
+ break;
+ }
+ }
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE */
#ifdef MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE
- case MM_MemType_MEM16:
- for (i = 0; i < (CmdPtr->Payload.NumOfBytes / 2); i++) {
- PSP_Status = CFE_PSP_MemRead16(SrcAddress, (uint16 *)DumpBuffer);
- if (PSP_Status == CFE_PSP_SUCCESS) {
- SrcAddress += sizeof(uint16);
- DumpBuffer = (uint8 *)DumpBuffer + sizeof(uint16);
- } else {
- /* CFE_PSP_MemRead16 error */
- CFE_EVS_SendEvent(
- MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM16",
- (int)PSP_Status, (void *)SrcAddress, (void *)DumpBuffer);
- /* Stop load dump buffer loop */
- break;
- }
- }
- break;
+ case MM_MemType_MEM16:
+ for (i = 0; i < (CmdPtr->Payload.NumOfBytes / 2); i++)
+ {
+ PSP_Status = CFE_PSP_MemRead16(SrcAddress, (uint16 *)DumpBuffer);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ SrcAddress += sizeof(uint16);
+ DumpBuffer = (uint8 *)DumpBuffer + sizeof(uint16);
+ }
+ else
+ {
+ /* CFE_PSP_MemRead16 error */
+ CFE_EVS_SendEvent(MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM16",
+ (int)PSP_Status,
+ (void *)SrcAddress,
+ (void *)DumpBuffer);
+ /* Stop load dump buffer loop */
+ break;
+ }
+ }
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE */
#ifdef MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE
- case MM_MemType_MEM8:
- for (i = 0; i < CmdPtr->Payload.NumOfBytes; i++) {
- PSP_Status = CFE_PSP_MemRead8(SrcAddress, (uint8 *)DumpBuffer);
- if (PSP_Status == CFE_PSP_SUCCESS) {
- SrcAddress++;
- DumpBuffer = (uint8 *)DumpBuffer + 1;
- } else {
- /* CFE_PSP_MemRead8 error */
- CFE_EVS_SendEvent(
- MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM8",
- (int)PSP_Status, (void *)SrcAddress, (void *)DumpBuffer);
- /* Stop load dump buffer loop */
- break;
- }
- }
- break;
+ case MM_MemType_MEM8:
+ for (i = 0; i < CmdPtr->Payload.NumOfBytes; i++)
+ {
+ PSP_Status = CFE_PSP_MemRead8(SrcAddress, (uint8 *)DumpBuffer);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ SrcAddress++;
+ DumpBuffer = (uint8 *)DumpBuffer + 1;
+ }
+ else
+ {
+ /* CFE_PSP_MemRead8 error */
+ CFE_EVS_SendEvent(MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM8",
+ (int)PSP_Status,
+ (void *)SrcAddress,
+ (void *)DumpBuffer);
+ /* Stop load dump buffer loop */
+ break;
+ }
+ }
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE */
- default:
- /* This branch will never be executed. CmdPtr->Payload.MemType will always
- * be valid value for this switch statement it is verified via
- * MM_VerifyFileLoadDumpParams */
- PSP_Status = CFE_PSP_ERROR;
- break;
+ default:
+ /* This branch will never be executed. CmdPtr->Payload.MemType will always
+ * be valid value for this switch statement it is verified via
+ * MM_VerifyFileLoadDumpParams */
+ PSP_Status = CFE_PSP_ERROR;
+ break;
- } /* end CmdPtr->Payload.MemType switch */
+ } /* end CmdPtr->Payload.MemType switch */
- return PSP_Status;
+ return PSP_Status;
}
diff --git a/fsw/src/mm_dump.h b/fsw/src/mm_dump.h
index ee95a2b..eb17bc5 100644
--- a/fsw/src/mm_dump.h
+++ b/fsw/src/mm_dump.h
@@ -69,8 +69,7 @@ int32 MM_PeekMem(const MM_PeekCmd_t *CmdPtr, cpuaddr SrcAddress);
*
* \return Execution status
*/
-int32 MM_DumpMemToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader);
+int32 MM_DumpMemToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader);
/**
* \brief Write the cFE primary and MM secondary file headers
@@ -94,8 +93,9 @@ int32 MM_DumpMemToFile(osal_id_t FileHandle, const char *FileName,
*
* \return Execution status
*/
-int32 MM_WriteFileHeaders(const char *FileName, osal_id_t FileHandle,
- CFE_FS_Header_t *CFEHeader,
+int32 MM_WriteFileHeaders(const char *FileName,
+ osal_id_t FileHandle,
+ CFE_FS_Header_t *CFEHeader,
const MM_LoadDumpFileHeader_t *MMHeader);
/**
@@ -116,8 +116,6 @@ int32 MM_WriteFileHeaders(const char *FileName, osal_id_t FileHandle,
*
* \return Execution status
*/
-int32 MM_FillDumpInEventBuffer(cpuaddr SrcAddress,
- const MM_DumpInEventCmd_t *CmdPtr,
- void *DumpBuffer);
+int32 MM_FillDumpInEventBuffer(cpuaddr SrcAddress, const MM_DumpInEventCmd_t *CmdPtr, void *DumpBuffer);
#endif
diff --git a/fsw/src/mm_eds_dispatch.c b/fsw/src/mm_eds_dispatch.c
index c67ea1a..eec942e 100644
--- a/fsw/src/mm_eds_dispatch.c
+++ b/fsw/src/mm_eds_dispatch.c
@@ -66,33 +66,44 @@ static const EdsDispatchTable_EdsComponent_MM_Application_CFE_SB_Telecommand_t M
/* command pipe. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-void MM_TaskPipe(const CFE_SB_Buffer_t *BufPtr) {
- CFE_Status_t Status;
- CFE_SB_MsgId_t MsgId;
- CFE_MSG_Size_t MsgSize;
- CFE_MSG_FcnCode_t MsgFc;
+void MM_TaskPipe(const CFE_SB_Buffer_t *BufPtr)
+{
+ CFE_Status_t Status;
+ CFE_SB_MsgId_t MsgId;
+ CFE_MSG_Size_t MsgSize;
+ CFE_MSG_FcnCode_t MsgFc;
- Status = EdsDispatch_EdsComponent_MM_Application_Telecommand(
- BufPtr, &MM_TC_DISPATCH_TABLE);
+ Status = EdsDispatch_EdsComponent_MM_Application_Telecommand(BufPtr, &MM_TC_DISPATCH_TABLE);
- if (Status != CFE_SUCCESS) {
- CFE_MSG_GetMsgId(&BufPtr->Msg, &MsgId);
- CFE_MSG_GetSize(&BufPtr->Msg, &MsgSize);
- CFE_MSG_GetFcnCode(&BufPtr->Msg, &MsgFc);
- ++MM_AppData.HkTlm.Payload.ErrCounter;
+ if (Status != CFE_SUCCESS)
+ {
+ CFE_MSG_GetMsgId(&BufPtr->Msg, &MsgId);
+ CFE_MSG_GetSize(&BufPtr->Msg, &MsgSize);
+ CFE_MSG_GetFcnCode(&BufPtr->Msg, &MsgFc);
+ ++MM_AppData.HkTlm.Payload.CommandErrorCounter;
- if (Status == CFE_STATUS_UNKNOWN_MSG_ID) {
- CFE_EVS_SendEvent(MM_MID_ERR_EID, CFE_EVS_EventType_ERROR,
- "MM: invalid command packet,MID = 0x%x",
- (unsigned int)CFE_SB_MsgIdToValue(MsgId));
- } else if (Status == CFE_STATUS_WRONG_MSG_LENGTH) {
- CFE_EVS_SendEvent(MM_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
- "MM: Invalid Msg length: ID = 0x%X, CC = %u, Len = %u",
- (unsigned int)CFE_SB_MsgIdToValue(MsgId),
- (unsigned int)MsgFc, (unsigned int)MsgSize);
- } else {
- CFE_EVS_SendEvent(MM_CC_ERR_EID, CFE_EVS_EventType_ERROR,
- "MM: Invalid ground command code: CC = %d", (int)MsgFc);
+ if (Status == CFE_STATUS_UNKNOWN_MSG_ID)
+ {
+ CFE_EVS_SendEvent(MM_MID_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "MM: invalid command packet,MID = 0x%x",
+ (unsigned int)CFE_SB_MsgIdToValue(MsgId));
+ }
+ else if (Status == CFE_STATUS_WRONG_MSG_LENGTH)
+ {
+ CFE_EVS_SendEvent(MM_CMD_LEN_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "MM: Invalid Msg length: ID = 0x%X, CC = %u, Len = %u",
+ (unsigned int)CFE_SB_MsgIdToValue(MsgId),
+ (unsigned int)MsgFc,
+ (unsigned int)MsgSize);
+ }
+ else
+ {
+ CFE_EVS_SendEvent(MM_CC_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "MM: Invalid ground command code: CC = %d",
+ (int)MsgFc);
+ }
}
- }
-}
\ No newline at end of file
+}
diff --git a/fsw/src/mm_load.c b/fsw/src/mm_load.c
index e2c04f2..49e8e0a 100644
--- a/fsw/src/mm_load.c
+++ b/fsw/src/mm_load.c
@@ -46,77 +46,86 @@ extern MM_AppData_t MM_AppData;
/* Write 8, 16, or 32 bits of data to any RAM memory address */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_PokeMem(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress) {
- uint8 ByteValue;
- uint16 WordValue;
- CFE_Status_t PSP_Status = CFE_PSP_ERROR_NOT_IMPLEMENTED;
- uint32 DataValue = 0;
- size_t BytesProcessed = 0;
- size_t DataSize = 0; /* only used for giving MEM type/size in events */
- uint32 EventID = 0;
-
- /* Write input number of bits to destination address */
- switch (CmdPtr->Payload.DataSize) {
- case MM_INTERNAL_BYTE_BIT_WIDTH:
- ByteValue = (uint8)CmdPtr->Payload.Data;
- DataValue = (uint32)ByteValue;
- BytesProcessed = sizeof(uint8);
- DataSize = 8;
- if ((PSP_Status = CFE_PSP_MemWrite8(DestAddress, ByteValue)) ==
- CFE_PSP_SUCCESS) {
- EventID = MM_POKE_BYTE_INF_EID;
+CFE_Status_t MM_PokeMem(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress)
+{
+ uint8 ByteValue;
+ uint16 WordValue;
+ CFE_Status_t PSP_Status = CFE_PSP_ERROR_NOT_IMPLEMENTED;
+ uint32 DataValue = 0;
+ size_t BytesProcessed = 0;
+ size_t DataSize = 0; /* only used for giving MEM type/size in events */
+ uint32 EventID = 0;
+
+ /* Write input number of bits to destination address */
+ switch (CmdPtr->Payload.DataSize)
+ {
+ case MM_INTERNAL_BYTE_BIT_WIDTH:
+ ByteValue = (uint8)CmdPtr->Payload.Data;
+ DataValue = (uint32)ByteValue;
+ BytesProcessed = sizeof(uint8);
+ DataSize = 8;
+ if ((PSP_Status = CFE_PSP_MemWrite8(DestAddress, ByteValue)) == CFE_PSP_SUCCESS)
+ {
+ EventID = MM_POKE_BYTE_INF_EID;
+ }
+ break;
+
+ case MM_INTERNAL_WORD_BIT_WIDTH:
+ WordValue = (uint16)CmdPtr->Payload.Data;
+ DataValue = (uint32)WordValue;
+ BytesProcessed = sizeof(uint16);
+ DataSize = 16;
+ if ((PSP_Status = CFE_PSP_MemWrite16(DestAddress, WordValue)) == CFE_PSP_SUCCESS)
+ {
+ EventID = MM_POKE_WORD_INF_EID;
+ }
+ break;
+
+ case MM_INTERNAL_DWORD_BIT_WIDTH:
+ DataValue = CmdPtr->Payload.Data;
+ BytesProcessed = sizeof(uint32);
+ DataSize = 32;
+ if ((PSP_Status = CFE_PSP_MemWrite32(DestAddress, DataValue)) == CFE_PSP_SUCCESS)
+ {
+ EventID = MM_POKE_DWORD_INF_EID;
+ }
+ break;
+
+ /*
+ ** We don't need a default case, a bad DataSize will get caught
+ ** in the MM_VerifyPeekPokeParams function and we won't get here
+ */
+ default:
+ break;
}
- break;
-
- case MM_INTERNAL_WORD_BIT_WIDTH:
- WordValue = (uint16)CmdPtr->Payload.Data;
- DataValue = (uint32)WordValue;
- BytesProcessed = sizeof(uint16);
- DataSize = 16;
- if ((PSP_Status = CFE_PSP_MemWrite16(DestAddress, WordValue)) ==
- CFE_PSP_SUCCESS) {
- EventID = MM_POKE_WORD_INF_EID;
+
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* Update cmd counter and last action stats */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_POKE;
+ MM_AppData.HkTlm.Payload.MemType = CmdPtr->Payload.MemType;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
+ MM_AppData.HkTlm.Payload.DataValue = DataValue;
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+
+ CFE_EVS_SendEvent(EventID,
+ CFE_EVS_EventType_INFORMATION,
+ "Poke Command: Addr = %p, Size = %u bits, Data = 0x%08X",
+ (void *)DestAddress,
+ (unsigned int)DataSize,
+ (unsigned int)DataValue);
}
- break;
-
- case MM_INTERNAL_DWORD_BIT_WIDTH:
- DataValue = CmdPtr->Payload.Data;
- BytesProcessed = sizeof(uint32);
- DataSize = 32;
- if ((PSP_Status = CFE_PSP_MemWrite32(DestAddress, DataValue)) ==
- CFE_PSP_SUCCESS) {
- EventID = MM_POKE_DWORD_INF_EID;
+ else
+ {
+ CFE_EVS_SendEvent(MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM%u",
+ (unsigned int)PSP_Status,
+ (void *)DestAddress,
+ (unsigned int)DataSize);
}
- break;
-
- /*
- ** We don't need a default case, a bad DataSize will get caught
- ** in the MM_VerifyPeekPokeParams function and we won't get here
- */
- default:
- break;
- }
-
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* Update cmd counter and last action stats */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_POKE;
- MM_AppData.HkTlm.Payload.MemType = CmdPtr->Payload.MemType;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
- MM_AppData.HkTlm.Payload.DataValue = DataValue;
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- CFE_EVS_SendEvent(EventID, CFE_EVS_EventType_INFORMATION,
- "Poke Command: Addr = %p, Size = %u bits, Data = 0x%08X",
- (void *)DestAddress, (unsigned int)DataSize,
- (unsigned int)DataValue);
- } else {
- CFE_EVS_SendEvent(
- MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM%u",
- (unsigned int)PSP_Status, (void *)DestAddress, (unsigned int)DataSize);
- }
-
- return PSP_Status;
+ return PSP_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -124,89 +133,108 @@ CFE_Status_t MM_PokeMem(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress) {
/* Write 8, 16, or 32 bits of data to any EEPROM memory address */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-CFE_Status_t MM_PokeEeprom(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress) {
- uint8 ByteValue;
- uint16 WordValue;
- CFE_Status_t PSP_Status = CFE_PSP_ERROR_NOT_IMPLEMENTED;
- uint32 DataValue = 0;
- size_t BytesProcessed = 0;
-
- CFE_ES_PerfLogEntry(MM_EEPROM_POKE_PERF_ID);
-
- /* Write input number of bits to destination address */
- switch (CmdPtr->Payload.DataSize) {
- case MM_INTERNAL_BYTE_BIT_WIDTH:
- ByteValue = (uint8)CmdPtr->Payload.Data;
- DataValue = (uint32)ByteValue;
- BytesProcessed = sizeof(uint8);
- PSP_Status = CFE_PSP_EepromWrite8(DestAddress, ByteValue);
- if (PSP_Status != CFE_PSP_SUCCESS) {
- CFE_EVS_SendEvent(
- MM_OS_EEPROMWRITE8_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_EepromWrite8 error received: RC = 0x%08X, Addr = %p",
- (unsigned int)PSP_Status, (void *)DestAddress);
- } else {
- CFE_EVS_SendEvent(MM_POKE_BYTE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Poke Command: Addr = %p, Size = 8 bits, Data = 0x%02X",
- (void *)DestAddress, ByteValue);
- }
- break;
-
- case MM_INTERNAL_WORD_BIT_WIDTH:
- WordValue = (uint16)CmdPtr->Payload.Data;
- DataValue = (uint32)WordValue;
- BytesProcessed = sizeof(uint16);
- PSP_Status = CFE_PSP_EepromWrite16(DestAddress, WordValue);
- if (PSP_Status != CFE_PSP_SUCCESS) {
- CFE_EVS_SendEvent(
- MM_OS_EEPROMWRITE16_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_EepromWrite16 error received: RC = 0x%08X, Addr = %p",
- (unsigned int)PSP_Status, (void *)DestAddress);
- } else {
- CFE_EVS_SendEvent(
- MM_POKE_WORD_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Poke Command: Addr = %p, Size = 16 bits, Data = 0x%04X",
- (void *)DestAddress, WordValue);
+CFE_Status_t MM_PokeEeprom(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress)
+{
+ uint8 ByteValue;
+ uint16 WordValue;
+ CFE_Status_t PSP_Status = CFE_PSP_ERROR_NOT_IMPLEMENTED;
+ uint32 DataValue = 0;
+ size_t BytesProcessed = 0;
+
+ CFE_ES_PerfLogEntry(MM_EEPROM_POKE_PERF_ID);
+
+ /* Write input number of bits to destination address */
+ switch (CmdPtr->Payload.DataSize)
+ {
+ case MM_INTERNAL_BYTE_BIT_WIDTH:
+ ByteValue = (uint8)CmdPtr->Payload.Data;
+ DataValue = (uint32)ByteValue;
+ BytesProcessed = sizeof(uint8);
+ PSP_Status = CFE_PSP_EepromWrite8(DestAddress, ByteValue);
+ if (PSP_Status != CFE_PSP_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_OS_EEPROMWRITE8_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_EepromWrite8 error received: RC = 0x%08X, Addr = %p",
+ (unsigned int)PSP_Status,
+ (void *)DestAddress);
+ }
+ else
+ {
+ CFE_EVS_SendEvent(MM_POKE_BYTE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Poke Command: Addr = %p, Size = 8 bits, Data = 0x%02X",
+ (void *)DestAddress,
+ ByteValue);
+ }
+ break;
+
+ case MM_INTERNAL_WORD_BIT_WIDTH:
+ WordValue = (uint16)CmdPtr->Payload.Data;
+ DataValue = (uint32)WordValue;
+ BytesProcessed = sizeof(uint16);
+ PSP_Status = CFE_PSP_EepromWrite16(DestAddress, WordValue);
+ if (PSP_Status != CFE_PSP_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_OS_EEPROMWRITE16_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_EepromWrite16 error received: RC = 0x%08X, Addr = %p",
+ (unsigned int)PSP_Status,
+ (void *)DestAddress);
+ }
+ else
+ {
+ CFE_EVS_SendEvent(MM_POKE_WORD_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Poke Command: Addr = %p, Size = 16 bits, Data = 0x%04X",
+ (void *)DestAddress,
+ WordValue);
+ }
+ break;
+
+ case MM_INTERNAL_DWORD_BIT_WIDTH:
+ DataValue = CmdPtr->Payload.Data;
+ BytesProcessed = sizeof(uint32);
+ PSP_Status = CFE_PSP_EepromWrite32(DestAddress, CmdPtr->Payload.Data);
+ if (PSP_Status != CFE_PSP_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_OS_EEPROMWRITE32_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_EepromWrite32 error received: RC = 0x%08X, Addr = %p",
+ (unsigned int)PSP_Status,
+ (void *)DestAddress);
+ }
+ else
+ {
+ CFE_EVS_SendEvent(MM_POKE_DWORD_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Poke Command: Addr = %p, Size = 32 bits, Data = 0x%08X",
+ (void *)DestAddress,
+ (unsigned int)(CmdPtr->Payload.Data));
+ }
+ break;
+
+ /*
+ ** We don't need a default case, a bad DataSize will get caught
+ ** in the MM_VerifyPeekPokeParams function and we won't get here
+ */
+ default:
+ break;
}
- break;
-
- case MM_INTERNAL_DWORD_BIT_WIDTH:
- DataValue = CmdPtr->Payload.Data;
- BytesProcessed = sizeof(uint32);
- PSP_Status = CFE_PSP_EepromWrite32(DestAddress, CmdPtr->Payload.Data);
- if (PSP_Status != CFE_PSP_SUCCESS) {
- CFE_EVS_SendEvent(
- MM_OS_EEPROMWRITE32_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_EepromWrite32 error received: RC = 0x%08X, Addr = %p",
- (unsigned int)PSP_Status, (void *)DestAddress);
- } else {
- CFE_EVS_SendEvent(
- MM_POKE_DWORD_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Poke Command: Addr = %p, Size = 32 bits, Data = 0x%08X",
- (void *)DestAddress, (unsigned int)(CmdPtr->Payload.Data));
+
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* Update cmd counter and last action stats */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_POKE;
+ MM_AppData.HkTlm.Payload.MemType = CmdPtr->Payload.MemType;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
+ MM_AppData.HkTlm.Payload.DataValue = DataValue;
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
}
- break;
-
- /*
- ** We don't need a default case, a bad DataSize will get caught
- ** in the MM_VerifyPeekPokeParams function and we won't get here
- */
- default:
- break;
- }
-
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* Update cmd counter and last action stats */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_POKE;
- MM_AppData.HkTlm.Payload.MemType = CmdPtr->Payload.MemType;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
- MM_AppData.HkTlm.Payload.DataValue = DataValue;
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- }
- CFE_ES_PerfLogExit(MM_EEPROM_POKE_PERF_ID);
+ CFE_ES_PerfLogExit(MM_EEPROM_POKE_PERF_ID);
- return PSP_Status;
+ return PSP_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -214,65 +242,78 @@ CFE_Status_t MM_PokeEeprom(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress) {
/* Loads memory from a file */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_LoadMemFromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMemFromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress) {
- int32 BytesRemaining = FileHeader->NumOfBytes;
- size_t BytesProcessed = 0;
- size_t SegmentSize = MM_INTERNAL_MAX_LOAD_DATA_SEG;
- uint8 *ioBuffer = (uint8 *)&MM_AppData.LoadBuffer[0];
- uint8 *TargetPointer = (uint8 *)DestAddress;
- int32 Status = OS_SUCCESS;
- int32 ReadLength;
-
- if (FileHeader->MemType == MM_MemType_EEPROM) {
- CFE_ES_PerfLogEntry(MM_EEPROM_FILELOAD_PERF_ID);
- }
-
- while (BytesRemaining != 0) {
- if (BytesRemaining < MM_INTERNAL_MAX_LOAD_DATA_SEG) {
- SegmentSize = BytesRemaining;
+ cpuaddr DestAddress)
+{
+ int32 BytesRemaining = FileHeader->NumOfBytes;
+ size_t BytesProcessed = 0;
+ size_t SegmentSize = MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ uint8 *ioBuffer = (uint8 *)&MM_AppData.LoadBuffer[0];
+ uint8 *TargetPointer = (uint8 *)DestAddress;
+ int32 Status = OS_SUCCESS;
+ int32 ReadLength;
+
+ if (FileHeader->MemType == MM_MemType_EEPROM)
+ {
+ CFE_ES_PerfLogEntry(MM_EEPROM_FILELOAD_PERF_ID);
}
- if ((ReadLength = OS_read(FileHandle, ioBuffer, SegmentSize)) ==
- SegmentSize) {
- memcpy(TargetPointer, ioBuffer, SegmentSize);
-
- BytesRemaining -= SegmentSize;
- BytesProcessed += SegmentSize;
- TargetPointer += SegmentSize;
-
- /* Prevent CPU hogging between load segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
- }
- } else {
- BytesRemaining = 0;
- Status = OS_ERROR;
- CFE_EVS_SendEvent(
- MM_OS_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_read error received: RC = 0x%08X Expected = %u File = '%s'",
- (unsigned int)ReadLength, (unsigned int)SegmentSize, FileName);
+ while (BytesRemaining != 0)
+ {
+ if (BytesRemaining < MM_INTERNAL_MAX_LOAD_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
+
+ if ((ReadLength = OS_read(FileHandle, ioBuffer, SegmentSize)) == SegmentSize)
+ {
+ memcpy(TargetPointer, ioBuffer, SegmentSize);
+
+ BytesRemaining -= SegmentSize;
+ BytesProcessed += SegmentSize;
+ TargetPointer += SegmentSize;
+
+ /* Prevent CPU hogging between load segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
+ }
+ else
+ {
+ BytesRemaining = 0;
+ Status = OS_ERROR;
+ CFE_EVS_SendEvent(MM_OS_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_read error received: RC = 0x%08X Expected = %u File = '%s'",
+ (unsigned int)ReadLength,
+ (unsigned int)SegmentSize,
+ FileName);
+ }
}
- }
- if (FileHeader->MemType == MM_MemType_EEPROM) {
- CFE_ES_PerfLogExit(MM_EEPROM_FILELOAD_PERF_ID);
- }
+ if (FileHeader->MemType == MM_MemType_EEPROM)
+ {
+ CFE_ES_PerfLogExit(MM_EEPROM_FILELOAD_PERF_ID);
+ }
- /* Update last action statistics */
- if (BytesProcessed == FileHeader->NumOfBytes) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_LOAD_FROM_FILE;
- MM_AppData.HkTlm.Payload.MemType = FileHeader->MemType;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- strncpy(MM_AppData.HkTlm.Payload.FileName, FileName,
- CFE_MISSION_MAX_PATH_LEN);
- } else {
- Status = OS_ERROR;
- }
+ /* Update last action statistics */
+ if (BytesProcessed == FileHeader->NumOfBytes)
+ {
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_LOAD_FROM_FILE;
+ MM_AppData.HkTlm.Payload.MemType = FileHeader->MemType;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ strncpy(MM_AppData.HkTlm.Payload.FileName, FileName, CFE_MISSION_MAX_PATH_LEN);
+ }
+ else
+ {
+ Status = OS_ERROR;
+ }
- return Status;
+ return Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -280,47 +321,54 @@ int32 MM_LoadMemFromFile(osal_id_t FileHandle, const char *FileName,
/* Verify load file size */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_VerifyLoadFileSize(const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader) {
- int32 OS_Status;
- size_t ExpectedSize;
- int32 ActualSize; /* The size returned by OS_stat is signed */
- os_fstat_t FileStats;
-
- memset(&FileStats, 0, sizeof(FileStats));
-
- /*
- ** Get the filesystem statistics on our load file
- */
- OS_Status = OS_stat(FileName, &FileStats);
- if (OS_Status != OS_SUCCESS) {
- CFE_EVS_SendEvent(MM_OS_STAT_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_stat error received: RC = 0x%08X File = '%s'",
- (unsigned int)OS_Status, FileName);
- } else {
+int32 MM_VerifyLoadFileSize(const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader)
+{
+ int32 OS_Status;
+ size_t ExpectedSize;
+ int32 ActualSize; /* The size returned by OS_stat is signed */
+ os_fstat_t FileStats;
+
+ memset(&FileStats, 0, sizeof(FileStats));
+
/*
- ** Check the reported size of the file against what it should be based
- ** upon the number of load bytes specified in the file header
+ ** Get the filesystem statistics on our load file
*/
- ActualSize = OS_FILESTAT_SIZE(FileStats);
- ExpectedSize = FileHeader->NumOfBytes + sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t);
- if (ActualSize != ExpectedSize) {
- OS_Status = OS_ERR_INVALID_SIZE;
-
- /*
- ** Note: passing FileStats.st_size in this event message will cause
- ** a segmentation fault under cygwin during unit testing, so we added
- ** the variable ActualSize to this function.
- */
- CFE_EVS_SendEvent(
- MM_LD_FILE_SIZE_ERR_EID, CFE_EVS_EventType_ERROR,
- "Load file size error: Reported by OS = %d Expected = %u File = '%s'",
- (int)ActualSize, (unsigned int)ExpectedSize, FileName);
+ OS_Status = OS_stat(FileName, &FileStats);
+ if (OS_Status != OS_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_OS_STAT_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_stat error received: RC = 0x%08X File = '%s'",
+ (unsigned int)OS_Status,
+ FileName);
+ }
+ else
+ {
+ /*
+ ** Check the reported size of the file against what it should be based
+ ** upon the number of load bytes specified in the file header
+ */
+ ActualSize = OS_FILESTAT_SIZE(FileStats);
+ ExpectedSize = FileHeader->NumOfBytes + sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t);
+ if (ActualSize != ExpectedSize)
+ {
+ OS_Status = OS_ERR_INVALID_SIZE;
+
+ /*
+ ** Note: passing FileStats.st_size in this event message will cause
+ ** a segmentation fault under cygwin during unit testing, so we added
+ ** the variable ActualSize to this function.
+ */
+ CFE_EVS_SendEvent(MM_LD_FILE_SIZE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Load file size error: Reported by OS = %d Expected = %u File = '%s'",
+ (int)ActualSize,
+ (unsigned int)ExpectedSize,
+ FileName);
+ }
}
- }
- return OS_Status;
+ return OS_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -328,45 +376,55 @@ int32 MM_VerifyLoadFileSize(const char *FileName,
/* Read the cFE primary and MM secondary file headers */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_ReadFileHeaders(const char *FileName, osal_id_t FileHandle,
- CFE_FS_Header_t *CFEHeader,
- MM_LoadDumpFileHeader_t *MMHeader) {
- int32 OS_Status;
-
- /*
- ** Read in the primary cFE file header
- */
- OS_Status = CFE_FS_ReadHeader(CFEHeader, FileHandle);
- if (OS_Status != sizeof(CFE_FS_Header_t)) {
- /* We either got an error or didn't read as much data as expected */
- CFE_EVS_SendEvent(MM_CFE_FS_READHDR_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_FS_ReadHeader error received: RC = 0x%08X Expected "
- "= %u File = '%s'",
- (unsigned int)OS_Status,
- (unsigned int)sizeof(CFE_FS_Header_t), FileName);
-
- OS_Status = OS_ERR_INVALID_SIZE;
- } /* end CFE_FS_ReadHeader if */
- else {
+int32 MM_ReadFileHeaders(const char *FileName,
+ osal_id_t FileHandle,
+ CFE_FS_Header_t *CFEHeader,
+ MM_LoadDumpFileHeader_t *MMHeader)
+{
+ int32 OS_Status;
+
/*
- ** Read in the secondary MM file header
+ ** Read in the primary cFE file header
*/
- OS_Status = OS_read(FileHandle, MMHeader, sizeof(MM_LoadDumpFileHeader_t));
- if (OS_Status != sizeof(MM_LoadDumpFileHeader_t)) {
- /* We either got an error or didn't read as much data as expected */
- CFE_EVS_SendEvent(
- MM_OS_READ_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_read error received: RC = 0x%08X Expected = %u File = '%s'",
- (unsigned int)OS_Status,
- (unsigned int)sizeof(MM_LoadDumpFileHeader_t), FileName);
-
- OS_Status = OS_ERR_INVALID_SIZE;
- } else {
- OS_Status = OS_SUCCESS;
- } /* end OS_read if */
- } /* end CFE_FS_ReadHeader else */
-
- return OS_Status;
+ OS_Status = CFE_FS_ReadHeader(CFEHeader, FileHandle);
+ if (OS_Status != sizeof(CFE_FS_Header_t))
+ {
+ /* We either got an error or didn't read as much data as expected */
+ CFE_EVS_SendEvent(MM_CFE_FS_READHDR_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_FS_ReadHeader error received: RC = 0x%08X Expected "
+ "= %u File = '%s'",
+ (unsigned int)OS_Status,
+ (unsigned int)sizeof(CFE_FS_Header_t),
+ FileName);
+
+ OS_Status = OS_ERR_INVALID_SIZE;
+ } /* end CFE_FS_ReadHeader if */
+ else
+ {
+ /*
+ ** Read in the secondary MM file header
+ */
+ OS_Status = OS_read(FileHandle, MMHeader, sizeof(MM_LoadDumpFileHeader_t));
+ if (OS_Status != sizeof(MM_LoadDumpFileHeader_t))
+ {
+ /* We either got an error or didn't read as much data as expected */
+ CFE_EVS_SendEvent(MM_OS_READ_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_read error received: RC = 0x%08X Expected = %u File = '%s'",
+ (unsigned int)OS_Status,
+ (unsigned int)sizeof(MM_LoadDumpFileHeader_t),
+ FileName);
+
+ OS_Status = OS_ERR_INVALID_SIZE;
+ }
+ else
+ {
+ OS_Status = OS_SUCCESS;
+ } /* end OS_read if */
+ } /* end CFE_FS_ReadHeader else */
+
+ return OS_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -374,54 +432,61 @@ int32 MM_ReadFileHeaders(const char *FileName, osal_id_t FileHandle,
/* Fill memory with the command specified fill pattern */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-void MM_FillMem(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
- uint16 i;
- size_t BytesProcessed = 0;
- uint32 BytesRemaining = CmdPtr->Payload.NumOfBytes;
- uint32 SegmentSize = MM_INTERNAL_MAX_FILL_DATA_SEG;
- uint8 *TargetPointer = (uint8 *)DestAddress;
- uint8 *FillBuffer = (uint8 *)&MM_AppData.FillBuffer[0];
-
- /* Create a scratch buffer with one fill segment */
- for (i = 0; i < (MM_INTERNAL_MAX_FILL_DATA_SEG / sizeof(uint32)); i++) {
- FillBuffer[i] = CmdPtr->Payload.FillPattern;
- }
-
- /* Start EEPROM performance monitor */
- if (CmdPtr->Payload.MemType == MM_MemType_EEPROM) {
- CFE_ES_PerfLogEntry(MM_EEPROM_FILL_PERF_ID);
- }
-
- /* Fill memory one segment at a time */
- while (BytesRemaining != 0) {
- /* Last fill segment may be partial size */
- if (BytesRemaining < MM_INTERNAL_MAX_FILL_DATA_SEG) {
- SegmentSize = BytesRemaining;
+void MM_FillMem(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr)
+{
+ uint16 i;
+ size_t BytesProcessed = 0;
+ uint32 BytesRemaining = CmdPtr->Payload.NumOfBytes;
+ uint32 SegmentSize = MM_INTERNAL_MAX_FILL_DATA_SEG;
+ uint8 *TargetPointer = (uint8 *)DestAddress;
+ uint8 *FillBuffer = (uint8 *)&MM_AppData.FillBuffer[0];
+
+ /* Create a scratch buffer with one fill segment */
+ for (i = 0; i < (MM_INTERNAL_MAX_FILL_DATA_SEG / sizeof(uint32)); i++)
+ {
+ FillBuffer[i] = CmdPtr->Payload.FillPattern;
}
- memcpy(TargetPointer, FillBuffer, SegmentSize);
-
- TargetPointer += SegmentSize;
- BytesProcessed += SegmentSize;
- BytesRemaining -= SegmentSize;
+ /* Start EEPROM performance monitor */
+ if (CmdPtr->Payload.MemType == MM_MemType_EEPROM)
+ {
+ CFE_ES_PerfLogEntry(MM_EEPROM_FILL_PERF_ID);
+ }
- /* Prevent CPU hogging between load segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
+ /* Fill memory one segment at a time */
+ while (BytesRemaining != 0)
+ {
+ /* Last fill segment may be partial size */
+ if (BytesRemaining < MM_INTERNAL_MAX_FILL_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
+
+ memcpy(TargetPointer, FillBuffer, SegmentSize);
+
+ TargetPointer += SegmentSize;
+ BytesProcessed += SegmentSize;
+ BytesRemaining -= SegmentSize;
+
+ /* Prevent CPU hogging between load segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
}
- }
- /* Stop EEPROM performance monitor */
- if (CmdPtr->Payload.MemType == MM_MemType_EEPROM) {
- CFE_ES_PerfLogExit(MM_EEPROM_FILL_PERF_ID);
- }
+ /* Stop EEPROM performance monitor */
+ if (CmdPtr->Payload.MemType == MM_MemType_EEPROM)
+ {
+ CFE_ES_PerfLogExit(MM_EEPROM_FILL_PERF_ID);
+ }
- /* Update last action statistics */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
- MM_AppData.HkTlm.Payload.MemType = CmdPtr->Payload.MemType;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
- MM_AppData.HkTlm.Payload.DataValue = CmdPtr->Payload.FillPattern;
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ /* Update last action statistics */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
+ MM_AppData.HkTlm.Payload.MemType = CmdPtr->Payload.MemType;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
+ MM_AppData.HkTlm.Payload.DataValue = CmdPtr->Payload.FillPattern;
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- return;
+ return;
}
diff --git a/fsw/src/mm_load.h b/fsw/src/mm_load.h
index 79c3e05..001db98 100644
--- a/fsw/src/mm_load.h
+++ b/fsw/src/mm_load.h
@@ -105,9 +105,10 @@ bool MM_LoadMemWID(const MM_LoadMemWIDCmd_t *CmdPtr, cpuaddr DestAddress);
*
* \return Execution status
*/
-int32 MM_LoadMemFromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMemFromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress);
+ cpuaddr DestAddress);
/**
* \brief Verify load file size
@@ -127,8 +128,7 @@ int32 MM_LoadMemFromFile(osal_id_t FileHandle, const char *FileName,
*
* \return Execution status
*/
-int32 MM_VerifyLoadFileSize(const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader);
+int32 MM_VerifyLoadFileSize(const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader);
/**
* \brief Read the cFE primary and MM secondary file headers
@@ -152,8 +152,9 @@ int32 MM_VerifyLoadFileSize(const char *FileName,
*
* \return Execution status
*/
-int32 MM_ReadFileHeaders(const char *FileName, osal_id_t FileHandle,
- CFE_FS_Header_t *CFEHeader,
+int32 MM_ReadFileHeaders(const char *FileName,
+ osal_id_t FileHandle,
+ CFE_FS_Header_t *CFEHeader,
MM_LoadDumpFileHeader_t *MMHeader);
/**
diff --git a/fsw/src/mm_mem16.c b/fsw/src/mm_mem16.c
index abc8b38..19bf448 100644
--- a/fsw/src/mm_mem16.c
+++ b/fsw/src/mm_mem16.c
@@ -48,76 +48,93 @@ extern MM_AppData_t MM_AppData;
/* Load memory from a file using only 16 bit wide writes */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_LoadMem16FromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMem16FromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress) {
- uint32 i;
- int32 ReadLength;
- CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
- size_t BytesProcessed = 0;
- int32 BytesRemaining = FileHeader->NumOfBytes;
- uint16 *DataPointer16 = (uint16 *)DestAddress;
- uint16 *ioBuffer16 = (uint16 *)&MM_AppData.LoadBuffer[0];
- size_t SegmentSize = MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ cpuaddr DestAddress)
+{
+ uint32 i;
+ int32 ReadLength;
+ CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
+ size_t BytesProcessed = 0;
+ int32 BytesRemaining = FileHeader->NumOfBytes;
+ uint16 *DataPointer16 = (uint16 *)DestAddress;
+ uint16 *ioBuffer16 = (uint16 *)&MM_AppData.LoadBuffer[0];
+ size_t SegmentSize = MM_INTERNAL_MAX_LOAD_DATA_SEG;
- while (BytesRemaining != 0) {
- if (BytesRemaining < MM_INTERNAL_MAX_LOAD_DATA_SEG) {
- SegmentSize = BytesRemaining;
- }
+ while (BytesRemaining != 0)
+ {
+ if (BytesRemaining < MM_INTERNAL_MAX_LOAD_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
- /* Read file data into i/o buffer */
- if ((ReadLength = OS_read(FileHandle, ioBuffer16, SegmentSize)) !=
- SegmentSize) {
- BytesRemaining = 0;
- PSP_Status = CFE_PSP_ERROR;
- CFE_EVS_SendEvent(
- MM_OS_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_read error received: RC = 0x%08X Expected = %u File = '%s'",
- (unsigned int)ReadLength, (unsigned int)SegmentSize, FileName);
- } else {
- /* Load memory from i/o buffer using 16 bit wide writes */
- for (i = 0; i < (SegmentSize / sizeof(uint16)); i++) {
- PSP_Status = CFE_PSP_MemWrite16((cpuaddr)DataPointer16, ioBuffer16[i]);
- if (PSP_Status == CFE_PSP_SUCCESS) {
- DataPointer16++;
- } else {
- /* CFE_PSP_MemWrite16 error */
- BytesRemaining = 0;
- PSP_Status = CFE_PSP_ERROR;
- CFE_EVS_SendEvent(
- MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM16",
- (unsigned int)PSP_Status, (void *)DataPointer16);
- /* Stop load segment loop */
- break;
+ /* Read file data into i/o buffer */
+ if ((ReadLength = OS_read(FileHandle, ioBuffer16, SegmentSize)) != SegmentSize)
+ {
+ BytesRemaining = 0;
+ PSP_Status = CFE_PSP_ERROR;
+ CFE_EVS_SendEvent(MM_OS_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_read error received: RC = 0x%08X Expected = %u File = '%s'",
+ (unsigned int)ReadLength,
+ (unsigned int)SegmentSize,
+ FileName);
}
- }
+ else
+ {
+ /* Load memory from i/o buffer using 16 bit wide writes */
+ for (i = 0; i < (SegmentSize / sizeof(uint16)); i++)
+ {
+ PSP_Status = CFE_PSP_MemWrite16((cpuaddr)DataPointer16, ioBuffer16[i]);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ DataPointer16++;
+ }
+ else
+ {
+ /* CFE_PSP_MemWrite16 error */
+ BytesRemaining = 0;
+ PSP_Status = CFE_PSP_ERROR;
+ CFE_EVS_SendEvent(MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM16",
+ (unsigned int)PSP_Status,
+ (void *)DataPointer16);
+ /* Stop load segment loop */
+ break;
+ }
+ }
- if (PSP_Status == CFE_PSP_SUCCESS) {
- BytesProcessed += SegmentSize;
- BytesRemaining -= SegmentSize;
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ BytesProcessed += SegmentSize;
+ BytesRemaining -= SegmentSize;
- /* Prevent CPU hogging between load segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
+ /* Prevent CPU hogging between load segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
+ }
}
- }
}
- }
- /* Update last action statistics */
- if (BytesProcessed == FileHeader->NumOfBytes) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_LOAD_FROM_FILE;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM16;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- strncpy(MM_AppData.HkTlm.Payload.FileName, FileName,
- CFE_MISSION_MAX_PATH_LEN);
- } else {
- PSP_Status = CFE_PSP_ERROR;
- }
+ /* Update last action statistics */
+ if (BytesProcessed == FileHeader->NumOfBytes)
+ {
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_LOAD_FROM_FILE;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM16;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ strncpy(MM_AppData.HkTlm.Payload.FileName, FileName, CFE_MISSION_MAX_PATH_LEN);
+ }
+ else
+ {
+ PSP_Status = CFE_PSP_ERROR;
+ }
- return PSP_Status;
+ return PSP_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -126,77 +143,88 @@ int32 MM_LoadMem16FromFile(osal_id_t FileHandle, const char *FileName,
/* only 16 bit wide reads */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_DumpMem16ToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader) {
- int32 OS_Status;
- CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
- uint32 i;
- size_t BytesProcessed = 0;
- uint32 BytesRemaining = FileHeader->NumOfBytes;
- uint16 *DataPointer16 =
- CFE_ES_MEMADDRESS_TO_PTR(FileHeader->SymAddress.Offset);
- uint16 *ioBuffer16 = (uint16 *)&MM_AppData.DumpBuffer[0];
- size_t SegmentSize = MM_INTERNAL_MAX_DUMP_DATA_SEG;
+int32 MM_DumpMem16ToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader)
+{
+ int32 OS_Status;
+ CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
+ uint32 i;
+ size_t BytesProcessed = 0;
+ uint32 BytesRemaining = FileHeader->NumOfBytes;
+ uint16 *DataPointer16 = CFE_ES_MEMADDRESS_TO_PTR(FileHeader->SymAddress.Offset);
+ uint16 *ioBuffer16 = (uint16 *)&MM_AppData.DumpBuffer[0];
+ size_t SegmentSize = MM_INTERNAL_MAX_DUMP_DATA_SEG;
- while (BytesRemaining != 0) {
- if (BytesRemaining < MM_INTERNAL_MAX_DUMP_DATA_SEG) {
- SegmentSize = BytesRemaining;
- }
+ while (BytesRemaining != 0)
+ {
+ if (BytesRemaining < MM_INTERNAL_MAX_DUMP_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
- /* Load RAM data into i/o buffer */
- for (i = 0; i < (SegmentSize / sizeof(uint16)); i++) {
- if ((PSP_Status = CFE_PSP_MemRead16((cpuaddr)DataPointer16,
- &ioBuffer16[i])) == CFE_PSP_SUCCESS) {
- DataPointer16++;
- } else {
- /* CFE_PSP_MemRead16 error */
- BytesRemaining = 0;
- CFE_EVS_SendEvent(
- MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM16",
- (unsigned int)PSP_Status, (void *)DataPointer16,
- (void *)&ioBuffer16[i]);
- /* Stop load i/o buffer loop */
- break;
- }
- }
+ /* Load RAM data into i/o buffer */
+ for (i = 0; i < (SegmentSize / sizeof(uint16)); i++)
+ {
+ if ((PSP_Status = CFE_PSP_MemRead16((cpuaddr)DataPointer16, &ioBuffer16[i])) == CFE_PSP_SUCCESS)
+ {
+ DataPointer16++;
+ }
+ else
+ {
+ /* CFE_PSP_MemRead16 error */
+ BytesRemaining = 0;
+ CFE_EVS_SendEvent(MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM16",
+ (unsigned int)PSP_Status,
+ (void *)DataPointer16,
+ (void *)&ioBuffer16[i]);
+ /* Stop load i/o buffer loop */
+ break;
+ }
+ }
- /* Check for error loading i/o buffer */
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* Write i/o buffer contents to file */
- if ((OS_Status = OS_write(FileHandle, ioBuffer16, SegmentSize)) ==
- SegmentSize) {
- /* Update process counters */
- BytesRemaining -= SegmentSize;
- BytesProcessed += SegmentSize;
+ /* Check for error loading i/o buffer */
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* Write i/o buffer contents to file */
+ if ((OS_Status = OS_write(FileHandle, ioBuffer16, SegmentSize)) == SegmentSize)
+ {
+ /* Update process counters */
+ BytesRemaining -= SegmentSize;
+ BytesProcessed += SegmentSize;
- /* Prevent CPU hogging between dump segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
+ /* Prevent CPU hogging between dump segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
+ }
+ else
+ {
+ /* OS_write error */
+ PSP_Status = CFE_PSP_ERROR;
+ BytesRemaining = 0;
+ CFE_EVS_SendEvent(MM_OS_WRITE_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_write error received: RC = 0x%08X Expected = %u File = '%s'",
+ (unsigned int)OS_Status,
+ (unsigned int)SegmentSize,
+ FileName);
+ }
}
- } else {
- /* OS_write error */
- PSP_Status = CFE_PSP_ERROR;
- BytesRemaining = 0;
- CFE_EVS_SendEvent(
- MM_OS_WRITE_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_write error received: RC = 0x%08X Expected = %u File = '%s'",
- (unsigned int)OS_Status, (unsigned int)SegmentSize, FileName);
- }
}
- }
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* Update last action statistics */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_DUMP_TO_FILE;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM16;
- MM_AppData.HkTlm.Payload.Address = FileHeader->SymAddress.Offset;
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- strncpy(MM_AppData.HkTlm.Payload.FileName, FileName,
- CFE_MISSION_MAX_PATH_LEN);
- }
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* Update last action statistics */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_DUMP_TO_FILE;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM16;
+ MM_AppData.HkTlm.Payload.Address = FileHeader->SymAddress.Offset;
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ strncpy(MM_AppData.HkTlm.Payload.FileName, FileName, CFE_MISSION_MAX_PATH_LEN);
+ }
- return PSP_Status;
+ return PSP_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -205,73 +233,88 @@ int32 MM_DumpMem16ToFile(osal_id_t FileHandle, const char *FileName,
/* 16 bit wide writes */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_FillMem16(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
- uint32 i;
- CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
- size_t BytesProcessed = 0;
- uint32 BytesRemaining = CmdPtr->Payload.NumOfBytes;
- uint32 NewBytesRemaining;
- uint16 FillPattern16 = (uint16)CmdPtr->Payload.FillPattern;
- uint16 *DataPointer16 = (uint16 *)DestAddress;
- size_t SegmentSize = MM_INTERNAL_MAX_FILL_DATA_SEG;
-
- /* Check fill size and warn if not a multiple of 2 */
- if ((BytesRemaining % 2) != 0) {
- NewBytesRemaining = BytesRemaining - (BytesRemaining % 2);
- CFE_EVS_SendEvent(
- MM_FILL_MEM16_ALIGN_WARN_INF_EID, CFE_EVS_EventType_INFORMATION,
- "MM_FillMem16 NumOfBytes not multiple of 2. Reducing from %u to %u.",
- (unsigned int)BytesRemaining, (unsigned int)NewBytesRemaining);
- BytesRemaining = NewBytesRemaining;
- }
+int32 MM_FillMem16(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr)
+{
+ uint32 i;
+ CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
+ size_t BytesProcessed = 0;
+ uint32 BytesRemaining = CmdPtr->Payload.NumOfBytes;
+ uint32 NewBytesRemaining;
+ uint16 FillPattern16 = (uint16)CmdPtr->Payload.FillPattern;
+ uint16 *DataPointer16 = (uint16 *)DestAddress;
+ size_t SegmentSize = MM_INTERNAL_MAX_FILL_DATA_SEG;
- while (BytesRemaining != 0) {
- /* Set size of next segment */
- if (BytesRemaining < MM_INTERNAL_MAX_FILL_DATA_SEG) {
- SegmentSize = BytesRemaining;
+ /* Check fill size and warn if not a multiple of 2 */
+ if ((BytesRemaining % 2) != 0)
+ {
+ NewBytesRemaining = BytesRemaining - (BytesRemaining % 2);
+ CFE_EVS_SendEvent(MM_FILL_MEM16_ALIGN_WARN_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "MM_FillMem16 NumOfBytes not multiple of 2. Reducing from %u to %u.",
+ (unsigned int)BytesRemaining,
+ (unsigned int)NewBytesRemaining);
+ BytesRemaining = NewBytesRemaining;
}
- /* Fill next segment */
- for (i = 0; i < (SegmentSize / sizeof(uint16)); i++) {
- PSP_Status = CFE_PSP_MemWrite16((cpuaddr)DataPointer16, FillPattern16);
- if (PSP_Status == CFE_PSP_SUCCESS) {
- DataPointer16++;
- } else {
- /* CFE_PSP_MemWrite16 error */
- BytesRemaining = 0;
- CFE_EVS_SendEvent(
- MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM16",
- (unsigned int)PSP_Status, (void *)DataPointer16);
- /* Stop fill segment loop */
- break;
- }
- }
+ while (BytesRemaining != 0)
+ {
+ /* Set size of next segment */
+ if (BytesRemaining < MM_INTERNAL_MAX_FILL_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
+
+ /* Fill next segment */
+ for (i = 0; i < (SegmentSize / sizeof(uint16)); i++)
+ {
+ PSP_Status = CFE_PSP_MemWrite16((cpuaddr)DataPointer16, FillPattern16);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ DataPointer16++;
+ }
+ else
+ {
+ /* CFE_PSP_MemWrite16 error */
+ BytesRemaining = 0;
+ CFE_EVS_SendEvent(MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM16",
+ (unsigned int)PSP_Status,
+ (void *)DataPointer16);
+ /* Stop fill segment loop */
+ break;
+ }
+ }
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* Update process counters */
- BytesRemaining -= SegmentSize;
- BytesProcessed += SegmentSize;
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* Update process counters */
+ BytesRemaining -= SegmentSize;
+ BytesProcessed += SegmentSize;
- /* Prevent CPU hogging between fill segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
- }
+ /* Prevent CPU hogging between fill segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
+ }
}
- }
- /* Update last action statistics */
- if (BytesProcessed == CmdPtr->Payload.NumOfBytes) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM16;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
- MM_AppData.HkTlm.Payload.DataValue = (uint32)FillPattern16;
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- } else {
- PSP_Status = CFE_PSP_ERROR;
- }
+ /* Update last action statistics */
+ if (BytesProcessed == CmdPtr->Payload.NumOfBytes)
+ {
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM16;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
+ MM_AppData.HkTlm.Payload.DataValue = (uint32)FillPattern16;
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ }
+ else
+ {
+ PSP_Status = CFE_PSP_ERROR;
+ }
- return PSP_Status;
+ return PSP_Status;
}
#endif /* MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE */
diff --git a/fsw/src/mm_mem16.h b/fsw/src/mm_mem16.h
index a4620e4..6cd7e90 100644
--- a/fsw/src/mm_mem16.h
+++ b/fsw/src/mm_mem16.h
@@ -56,9 +56,10 @@
*
* \return Execution status
*/
-int32 MM_LoadMem16FromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMem16FromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress);
+ cpuaddr DestAddress);
/**
* \brief Memory16 dump to file
@@ -79,8 +80,7 @@ int32 MM_LoadMem16FromFile(osal_id_t FileHandle, const char *FileName,
*
* \return Execution status
*/
-int32 MM_DumpMem16ToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader);
+int32 MM_DumpMem16ToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader);
/**
* \brief Fill memory16
diff --git a/fsw/src/mm_mem32.c b/fsw/src/mm_mem32.c
index df63ca6..fc59112 100644
--- a/fsw/src/mm_mem32.c
+++ b/fsw/src/mm_mem32.c
@@ -48,75 +48,92 @@ extern MM_AppData_t MM_AppData;
/* Load memory from a file using only 32 bit wide writes */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_LoadMem32FromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMem32FromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress) {
- uint32 i;
- int32 ReadLength;
- CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
- size_t BytesProcessed = 0;
- int32 BytesRemaining = FileHeader->NumOfBytes;
- uint32 *DataPointer32 = (uint32 *)DestAddress;
- uint32 *ioBuffer32 = (uint32 *)&MM_AppData.LoadBuffer[0];
- size_t SegmentSize = MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ cpuaddr DestAddress)
+{
+ uint32 i;
+ int32 ReadLength;
+ CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
+ size_t BytesProcessed = 0;
+ int32 BytesRemaining = FileHeader->NumOfBytes;
+ uint32 *DataPointer32 = (uint32 *)DestAddress;
+ uint32 *ioBuffer32 = (uint32 *)&MM_AppData.LoadBuffer[0];
+ size_t SegmentSize = MM_INTERNAL_MAX_LOAD_DATA_SEG;
- while (BytesRemaining != 0) {
- if (BytesRemaining < MM_INTERNAL_MAX_LOAD_DATA_SEG) {
- SegmentSize = BytesRemaining;
- }
+ while (BytesRemaining != 0)
+ {
+ if (BytesRemaining < MM_INTERNAL_MAX_LOAD_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
- /* Read file data into i/o buffer */
- if ((ReadLength = OS_read(FileHandle, ioBuffer32, SegmentSize)) !=
- SegmentSize) {
- BytesRemaining = 0;
- PSP_Status = CFE_PSP_ERROR;
- CFE_EVS_SendEvent(
- MM_OS_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_read error received: RC = 0x%08X Expected = %u File = '%s'",
- (unsigned int)ReadLength, (unsigned int)SegmentSize, FileName);
- } else {
- /* Load memory from i/o buffer using 32 bit wide writes */
- for (i = 0; i < (SegmentSize / sizeof(uint32)); i++) {
- PSP_Status = CFE_PSP_MemWrite32((cpuaddr)DataPointer32, ioBuffer32[i]);
- if (PSP_Status == CFE_PSP_SUCCESS) {
- DataPointer32++;
- } else {
- /* CFE_PSP_MemWrite32 error */
- BytesRemaining = 0;
- CFE_EVS_SendEvent(
- MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=%d, Address=%p, MemType=MEM32",
- (int)PSP_Status, (void *)DataPointer32);
- /* Stop load segment loop */
- break;
+ /* Read file data into i/o buffer */
+ if ((ReadLength = OS_read(FileHandle, ioBuffer32, SegmentSize)) != SegmentSize)
+ {
+ BytesRemaining = 0;
+ PSP_Status = CFE_PSP_ERROR;
+ CFE_EVS_SendEvent(MM_OS_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_read error received: RC = 0x%08X Expected = %u File = '%s'",
+ (unsigned int)ReadLength,
+ (unsigned int)SegmentSize,
+ FileName);
}
- }
+ else
+ {
+ /* Load memory from i/o buffer using 32 bit wide writes */
+ for (i = 0; i < (SegmentSize / sizeof(uint32)); i++)
+ {
+ PSP_Status = CFE_PSP_MemWrite32((cpuaddr)DataPointer32, ioBuffer32[i]);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ DataPointer32++;
+ }
+ else
+ {
+ /* CFE_PSP_MemWrite32 error */
+ BytesRemaining = 0;
+ CFE_EVS_SendEvent(MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=%d, Address=%p, MemType=MEM32",
+ (int)PSP_Status,
+ (void *)DataPointer32);
+ /* Stop load segment loop */
+ break;
+ }
+ }
- if (PSP_Status == CFE_PSP_SUCCESS) {
- BytesProcessed += SegmentSize;
- BytesRemaining -= SegmentSize;
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ BytesProcessed += SegmentSize;
+ BytesRemaining -= SegmentSize;
- /* Prevent CPU hogging between load segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
+ /* Prevent CPU hogging between load segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
+ }
}
- }
}
- }
- /* Update last action statistics */
- if (BytesProcessed == FileHeader->NumOfBytes) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_LOAD_FROM_FILE;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM32;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- strncpy(MM_AppData.HkTlm.Payload.FileName, FileName,
- CFE_MISSION_MAX_PATH_LEN);
- } else {
- PSP_Status = CFE_PSP_ERROR;
- }
+ /* Update last action statistics */
+ if (BytesProcessed == FileHeader->NumOfBytes)
+ {
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_LOAD_FROM_FILE;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM32;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ strncpy(MM_AppData.HkTlm.Payload.FileName, FileName, CFE_MISSION_MAX_PATH_LEN);
+ }
+ else
+ {
+ PSP_Status = CFE_PSP_ERROR;
+ }
- return PSP_Status;
+ return PSP_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -125,77 +142,89 @@ int32 MM_LoadMem32FromFile(osal_id_t FileHandle, const char *FileName,
/* only 32 bit wide reads */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_DumpMem32ToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader) {
- int32 OS_Status;
- CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
- uint32 i;
- size_t BytesProcessed = 0;
- uint32 BytesRemaining = FileHeader->NumOfBytes;
- uint32 *DataPointer32 =
- CFE_ES_MEMADDRESS_TO_PTR(FileHeader->SymAddress.Offset);
- uint32 *ioBuffer32 = (uint32 *)&MM_AppData.DumpBuffer[0];
- size_t SegmentSize = MM_INTERNAL_MAX_DUMP_DATA_SEG;
+int32 MM_DumpMem32ToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader)
+{
+ int32 OS_Status;
+ CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
+ uint32 i;
+ size_t BytesProcessed = 0;
+ uint32 BytesRemaining = FileHeader->NumOfBytes;
+ uint32 *DataPointer32 = CFE_ES_MEMADDRESS_TO_PTR(FileHeader->SymAddress.Offset);
+ uint32 *ioBuffer32 = (uint32 *)&MM_AppData.DumpBuffer[0];
+ size_t SegmentSize = MM_INTERNAL_MAX_DUMP_DATA_SEG;
- while (BytesRemaining != 0) {
- if (BytesRemaining < MM_INTERNAL_MAX_DUMP_DATA_SEG) {
- SegmentSize = BytesRemaining;
- }
+ while (BytesRemaining != 0)
+ {
+ if (BytesRemaining < MM_INTERNAL_MAX_DUMP_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
- /* Load RAM data into i/o buffer */
- for (i = 0; i < (SegmentSize / sizeof(uint32)); i++) {
- PSP_Status = CFE_PSP_MemRead32((cpuaddr)DataPointer32, &ioBuffer32[i]);
- if (PSP_Status == CFE_PSP_SUCCESS) {
- DataPointer32++;
- } else {
- /* CFE_PSP_MemRead32 error */
- BytesRemaining = 0;
- CFE_EVS_SendEvent(
- MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM32",
- (unsigned int)PSP_Status, (void *)DataPointer32,
- (void *)&ioBuffer32[i]);
- /* Stop load i/o buffer loop */
- break;
- }
- }
+ /* Load RAM data into i/o buffer */
+ for (i = 0; i < (SegmentSize / sizeof(uint32)); i++)
+ {
+ PSP_Status = CFE_PSP_MemRead32((cpuaddr)DataPointer32, &ioBuffer32[i]);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ DataPointer32++;
+ }
+ else
+ {
+ /* CFE_PSP_MemRead32 error */
+ BytesRemaining = 0;
+ CFE_EVS_SendEvent(MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM32",
+ (unsigned int)PSP_Status,
+ (void *)DataPointer32,
+ (void *)&ioBuffer32[i]);
+ /* Stop load i/o buffer loop */
+ break;
+ }
+ }
- /* Check for error loading i/o buffer */
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* Write i/o buffer contents to file */
- if ((OS_Status = OS_write(FileHandle, ioBuffer32, SegmentSize)) ==
- SegmentSize) {
- /* Update process counters */
- BytesRemaining -= SegmentSize;
- BytesProcessed += SegmentSize;
+ /* Check for error loading i/o buffer */
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* Write i/o buffer contents to file */
+ if ((OS_Status = OS_write(FileHandle, ioBuffer32, SegmentSize)) == SegmentSize)
+ {
+ /* Update process counters */
+ BytesRemaining -= SegmentSize;
+ BytesProcessed += SegmentSize;
- /* Prevent CPU hogging between dump segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
+ /* Prevent CPU hogging between dump segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
+ }
+ else
+ {
+ /* OS_write error */
+ PSP_Status = CFE_PSP_ERROR;
+ BytesRemaining = 0;
+ CFE_EVS_SendEvent(MM_OS_WRITE_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_write error received: RC = 0x%08X Expected = %u File = '%s'",
+ (unsigned int)OS_Status,
+ (unsigned int)SegmentSize,
+ FileName);
+ }
}
- } else {
- /* OS_write error */
- PSP_Status = CFE_PSP_ERROR;
- BytesRemaining = 0;
- CFE_EVS_SendEvent(
- MM_OS_WRITE_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_write error received: RC = 0x%08X Expected = %u File = '%s'",
- (unsigned int)OS_Status, (unsigned int)SegmentSize, FileName);
- }
}
- }
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* Update last action statistics */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_DUMP_TO_FILE;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM32;
- MM_AppData.HkTlm.Payload.Address = FileHeader->SymAddress.Offset;
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- strncpy(MM_AppData.HkTlm.Payload.FileName, FileName,
- CFE_MISSION_MAX_PATH_LEN);
- }
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* Update last action statistics */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_DUMP_TO_FILE;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM32;
+ MM_AppData.HkTlm.Payload.Address = FileHeader->SymAddress.Offset;
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ strncpy(MM_AppData.HkTlm.Payload.FileName, FileName, CFE_MISSION_MAX_PATH_LEN);
+ }
- return PSP_Status;
+ return PSP_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -204,73 +233,88 @@ int32 MM_DumpMem32ToFile(osal_id_t FileHandle, const char *FileName,
/* 32 bit wide writes */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_FillMem32(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
- uint32 i;
- CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
- size_t BytesProcessed = 0;
- uint32 BytesRemaining = CmdPtr->Payload.NumOfBytes;
- uint32 NewBytesRemaining;
- uint32 FillPattern32 = CmdPtr->Payload.FillPattern;
- uint32 *DataPointer32 = (uint32 *)(DestAddress);
- size_t SegmentSize = MM_INTERNAL_MAX_FILL_DATA_SEG;
-
- /* Check fill size and warn if not a multiple of 4 */
- if ((BytesRemaining % 4) != 0) {
- NewBytesRemaining = BytesRemaining - (BytesRemaining % 4);
- CFE_EVS_SendEvent(
- MM_FILL_MEM32_ALIGN_WARN_INF_EID, CFE_EVS_EventType_INFORMATION,
- "MM_FillMem32 NumOfBytes not multiple of 4. Reducing from %d to %d.",
- (int)BytesRemaining, (int)NewBytesRemaining);
- BytesRemaining = NewBytesRemaining;
- }
+int32 MM_FillMem32(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr)
+{
+ uint32 i;
+ CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
+ size_t BytesProcessed = 0;
+ uint32 BytesRemaining = CmdPtr->Payload.NumOfBytes;
+ uint32 NewBytesRemaining;
+ uint32 FillPattern32 = CmdPtr->Payload.FillPattern;
+ uint32 *DataPointer32 = (uint32 *)(DestAddress);
+ size_t SegmentSize = MM_INTERNAL_MAX_FILL_DATA_SEG;
- while (BytesRemaining != 0) {
- /* Set size of next segment */
- if (BytesRemaining < MM_INTERNAL_MAX_FILL_DATA_SEG) {
- SegmentSize = BytesRemaining;
+ /* Check fill size and warn if not a multiple of 4 */
+ if ((BytesRemaining % 4) != 0)
+ {
+ NewBytesRemaining = BytesRemaining - (BytesRemaining % 4);
+ CFE_EVS_SendEvent(MM_FILL_MEM32_ALIGN_WARN_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "MM_FillMem32 NumOfBytes not multiple of 4. Reducing from %d to %d.",
+ (int)BytesRemaining,
+ (int)NewBytesRemaining);
+ BytesRemaining = NewBytesRemaining;
}
- /* Fill next segment */
- for (i = 0; i < (SegmentSize / sizeof(uint32)); i++) {
- PSP_Status = CFE_PSP_MemWrite32((cpuaddr)DataPointer32, FillPattern32);
- if (PSP_Status == CFE_PSP_SUCCESS) {
- DataPointer32++;
- } else {
- /* CFE_PSP_MemWrite32 error */
- BytesRemaining = 0;
- CFE_EVS_SendEvent(
- MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM32",
- (unsigned int)PSP_Status, (void *)DataPointer32);
- /* Stop fill segment loop */
- break;
- }
- }
+ while (BytesRemaining != 0)
+ {
+ /* Set size of next segment */
+ if (BytesRemaining < MM_INTERNAL_MAX_FILL_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
+
+ /* Fill next segment */
+ for (i = 0; i < (SegmentSize / sizeof(uint32)); i++)
+ {
+ PSP_Status = CFE_PSP_MemWrite32((cpuaddr)DataPointer32, FillPattern32);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ DataPointer32++;
+ }
+ else
+ {
+ /* CFE_PSP_MemWrite32 error */
+ BytesRemaining = 0;
+ CFE_EVS_SendEvent(MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM32",
+ (unsigned int)PSP_Status,
+ (void *)DataPointer32);
+ /* Stop fill segment loop */
+ break;
+ }
+ }
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* Update process counters */
- BytesRemaining -= SegmentSize;
- BytesProcessed += SegmentSize;
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* Update process counters */
+ BytesRemaining -= SegmentSize;
+ BytesProcessed += SegmentSize;
- /* Prevent CPU hogging between fill segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
- }
+ /* Prevent CPU hogging between fill segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
+ }
}
- }
- /* Update last action statistics */
- if (BytesProcessed == CmdPtr->Payload.NumOfBytes) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM32;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
- MM_AppData.HkTlm.Payload.DataValue = FillPattern32;
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- } else {
- PSP_Status = CFE_PSP_ERROR;
- }
+ /* Update last action statistics */
+ if (BytesProcessed == CmdPtr->Payload.NumOfBytes)
+ {
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM32;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
+ MM_AppData.HkTlm.Payload.DataValue = FillPattern32;
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ }
+ else
+ {
+ PSP_Status = CFE_PSP_ERROR;
+ }
- return PSP_Status;
+ return PSP_Status;
}
#endif /* MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE */
diff --git a/fsw/src/mm_mem32.h b/fsw/src/mm_mem32.h
index 7b9e4b8..f7dcb91 100644
--- a/fsw/src/mm_mem32.h
+++ b/fsw/src/mm_mem32.h
@@ -56,9 +56,10 @@
*
* \return Execution status
*/
-int32 MM_LoadMem32FromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMem32FromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress);
+ cpuaddr DestAddress);
/**
* \brief Memory32 dump to file
@@ -79,8 +80,7 @@ int32 MM_LoadMem32FromFile(osal_id_t FileHandle, const char *FileName,
*
* \return Execution status
*/
-int32 MM_DumpMem32ToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader);
+int32 MM_DumpMem32ToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader);
/**
* \brief Fill memory32
diff --git a/fsw/src/mm_mem8.c b/fsw/src/mm_mem8.c
index 55f80fa..93471f3 100644
--- a/fsw/src/mm_mem8.c
+++ b/fsw/src/mm_mem8.c
@@ -48,75 +48,92 @@ extern MM_AppData_t MM_AppData;
/* Load memory from a file using only 8 bit wide writes */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_LoadMem8FromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMem8FromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress) {
- uint32 i;
- int32 ReadLength;
- CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
- size_t BytesProcessed = 0;
- int32 BytesRemaining = FileHeader->NumOfBytes;
- uint8 *DataPointer8 = (uint8 *)DestAddress;
- uint8 *ioBuffer8 = (uint8 *)&MM_AppData.LoadBuffer[0];
- size_t SegmentSize = MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ cpuaddr DestAddress)
+{
+ uint32 i;
+ int32 ReadLength;
+ CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
+ size_t BytesProcessed = 0;
+ int32 BytesRemaining = FileHeader->NumOfBytes;
+ uint8 *DataPointer8 = (uint8 *)DestAddress;
+ uint8 *ioBuffer8 = (uint8 *)&MM_AppData.LoadBuffer[0];
+ size_t SegmentSize = MM_INTERNAL_MAX_LOAD_DATA_SEG;
- while (BytesRemaining != 0) {
- if (BytesRemaining < MM_INTERNAL_MAX_LOAD_DATA_SEG) {
- SegmentSize = BytesRemaining;
- }
+ while (BytesRemaining != 0)
+ {
+ if (BytesRemaining < MM_INTERNAL_MAX_LOAD_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
- /* Read file data into i/o buffer */
- if ((ReadLength = OS_read(FileHandle, ioBuffer8, SegmentSize)) !=
- SegmentSize) {
- BytesRemaining = 0;
- PSP_Status = CFE_PSP_ERROR;
- CFE_EVS_SendEvent(
- MM_OS_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_read error received: RC = 0x%08X Expected = %u File = '%s'",
- (unsigned int)ReadLength, (unsigned int)SegmentSize, FileName);
- } else {
- /* Load memory from i/o buffer using 8 bit wide writes */
- for (i = 0; i < SegmentSize; i++) {
- PSP_Status = CFE_PSP_MemWrite8((cpuaddr)DataPointer8, ioBuffer8[i]);
- if (PSP_Status == CFE_PSP_SUCCESS) {
- DataPointer8++;
- } else {
- /* CFE_PSP_MemWrite8 error */
- BytesRemaining = 0;
- CFE_EVS_SendEvent(
- MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM8",
- (unsigned int)PSP_Status, (void *)DataPointer8);
- /* Stop load segment loop */
- break;
+ /* Read file data into i/o buffer */
+ if ((ReadLength = OS_read(FileHandle, ioBuffer8, SegmentSize)) != SegmentSize)
+ {
+ BytesRemaining = 0;
+ PSP_Status = CFE_PSP_ERROR;
+ CFE_EVS_SendEvent(MM_OS_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_read error received: RC = 0x%08X Expected = %u File = '%s'",
+ (unsigned int)ReadLength,
+ (unsigned int)SegmentSize,
+ FileName);
}
- }
+ else
+ {
+ /* Load memory from i/o buffer using 8 bit wide writes */
+ for (i = 0; i < SegmentSize; i++)
+ {
+ PSP_Status = CFE_PSP_MemWrite8((cpuaddr)DataPointer8, ioBuffer8[i]);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ DataPointer8++;
+ }
+ else
+ {
+ /* CFE_PSP_MemWrite8 error */
+ BytesRemaining = 0;
+ CFE_EVS_SendEvent(MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM8",
+ (unsigned int)PSP_Status,
+ (void *)DataPointer8);
+ /* Stop load segment loop */
+ break;
+ }
+ }
- if (PSP_Status == CFE_PSP_SUCCESS) {
- BytesProcessed += SegmentSize;
- BytesRemaining -= SegmentSize;
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ BytesProcessed += SegmentSize;
+ BytesRemaining -= SegmentSize;
- /* Prevent CPU hogging between load segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
+ /* Prevent CPU hogging between load segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
+ }
}
- }
}
- }
- /* Update last action statistics */
- if (BytesProcessed == FileHeader->NumOfBytes) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_LOAD_FROM_FILE;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM8;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- strncpy(MM_AppData.HkTlm.Payload.FileName, FileName,
- CFE_MISSION_MAX_PATH_LEN);
- } else {
- PSP_Status = CFE_PSP_ERROR;
- }
+ /* Update last action statistics */
+ if (BytesProcessed == FileHeader->NumOfBytes)
+ {
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_LOAD_FROM_FILE;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM8;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ strncpy(MM_AppData.HkTlm.Payload.FileName, FileName, CFE_MISSION_MAX_PATH_LEN);
+ }
+ else
+ {
+ PSP_Status = CFE_PSP_ERROR;
+ }
- return PSP_Status;
+ return PSP_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -125,76 +142,88 @@ int32 MM_LoadMem8FromFile(osal_id_t FileHandle, const char *FileName,
/* only 8 bit wide reads */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_DumpMem8ToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader) {
- int32 OS_Status;
- CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
- uint32 i;
- size_t BytesProcessed = 0;
- uint32 BytesRemaining = FileHeader->NumOfBytes;
- uint8 *DataPointer8 = CFE_ES_MEMADDRESS_TO_PTR(FileHeader->SymAddress.Offset);
- uint8 *ioBuffer8 = (uint8 *)&MM_AppData.DumpBuffer[0];
- size_t SegmentSize = MM_INTERNAL_MAX_DUMP_DATA_SEG;
+int32 MM_DumpMem8ToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader)
+{
+ int32 OS_Status;
+ CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
+ uint32 i;
+ size_t BytesProcessed = 0;
+ uint32 BytesRemaining = FileHeader->NumOfBytes;
+ uint8 *DataPointer8 = CFE_ES_MEMADDRESS_TO_PTR(FileHeader->SymAddress.Offset);
+ uint8 *ioBuffer8 = (uint8 *)&MM_AppData.DumpBuffer[0];
+ size_t SegmentSize = MM_INTERNAL_MAX_DUMP_DATA_SEG;
- while (BytesRemaining != 0) {
- if (BytesRemaining < MM_INTERNAL_MAX_DUMP_DATA_SEG) {
- SegmentSize = BytesRemaining;
- }
+ while (BytesRemaining != 0)
+ {
+ if (BytesRemaining < MM_INTERNAL_MAX_DUMP_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
- /* Load RAM data into i/o buffer */
- for (i = 0; i < SegmentSize; i++) {
- if ((PSP_Status = CFE_PSP_MemRead8((cpuaddr)DataPointer8,
- &ioBuffer8[i])) == CFE_PSP_SUCCESS) {
- DataPointer8++;
- } else {
- /* CFE_PSP_MemRead8 error */
- BytesRemaining = 0;
- CFE_EVS_SendEvent(
- MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM8",
- (unsigned int)PSP_Status, (void *)DataPointer8,
- (void *)&ioBuffer8[i]);
- /* Stop load i/o buffer loop */
- break;
- }
- }
+ /* Load RAM data into i/o buffer */
+ for (i = 0; i < SegmentSize; i++)
+ {
+ if ((PSP_Status = CFE_PSP_MemRead8((cpuaddr)DataPointer8, &ioBuffer8[i])) == CFE_PSP_SUCCESS)
+ {
+ DataPointer8++;
+ }
+ else
+ {
+ /* CFE_PSP_MemRead8 error */
+ BytesRemaining = 0;
+ CFE_EVS_SendEvent(MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM8",
+ (unsigned int)PSP_Status,
+ (void *)DataPointer8,
+ (void *)&ioBuffer8[i]);
+ /* Stop load i/o buffer loop */
+ break;
+ }
+ }
- /* Check for error loading i/o buffer */
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* Write i/o buffer contents to file */
- if ((OS_Status = OS_write(FileHandle, ioBuffer8, SegmentSize)) ==
- SegmentSize) {
- /* Update process counters */
- BytesRemaining -= SegmentSize;
- BytesProcessed += SegmentSize;
+ /* Check for error loading i/o buffer */
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* Write i/o buffer contents to file */
+ if ((OS_Status = OS_write(FileHandle, ioBuffer8, SegmentSize)) == SegmentSize)
+ {
+ /* Update process counters */
+ BytesRemaining -= SegmentSize;
+ BytesProcessed += SegmentSize;
- /* Prevent CPU hogging between dump segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
+ /* Prevent CPU hogging between dump segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
+ }
+ else
+ {
+ /* OS_write error */
+ BytesRemaining = 0;
+ PSP_Status = CFE_PSP_ERROR;
+ CFE_EVS_SendEvent(MM_OS_WRITE_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_write error received: RC = 0x%08X Expected = %u File = '%s'",
+ (unsigned int)OS_Status,
+ (unsigned int)SegmentSize,
+ FileName);
+ }
}
- } else {
- /* OS_write error */
- BytesRemaining = 0;
- PSP_Status = CFE_PSP_ERROR;
- CFE_EVS_SendEvent(
- MM_OS_WRITE_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_write error received: RC = 0x%08X Expected = %u File = '%s'",
- (unsigned int)OS_Status, (unsigned int)SegmentSize, FileName);
- }
}
- }
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* Update last action statistics */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_DUMP_TO_FILE;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM8;
- MM_AppData.HkTlm.Payload.Address = FileHeader->SymAddress.Offset;
- strncpy(MM_AppData.HkTlm.Payload.FileName, FileName,
- CFE_MISSION_MAX_PATH_LEN);
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- }
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* Update last action statistics */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_DUMP_TO_FILE;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM8;
+ MM_AppData.HkTlm.Payload.Address = FileHeader->SymAddress.Offset;
+ strncpy(MM_AppData.HkTlm.Payload.FileName, FileName, CFE_MISSION_MAX_PATH_LEN);
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ }
- return PSP_Status;
+ return PSP_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -203,62 +232,75 @@ int32 MM_DumpMem8ToFile(osal_id_t FileHandle, const char *FileName,
/* 8 bit wide writes */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_FillMem8(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
- uint32 i;
- CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
- size_t BytesProcessed = 0;
- uint32 BytesRemaining = CmdPtr->Payload.NumOfBytes;
- uint8 FillPattern8 = (uint8)CmdPtr->Payload.FillPattern;
- uint8 *DataPointer8 = (uint8 *)DestAddress;
- size_t SegmentSize = MM_INTERNAL_MAX_FILL_DATA_SEG;
+int32 MM_FillMem8(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr)
+{
+ uint32 i;
+ CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
+ size_t BytesProcessed = 0;
+ uint32 BytesRemaining = CmdPtr->Payload.NumOfBytes;
+ uint8 FillPattern8 = (uint8)CmdPtr->Payload.FillPattern;
+ uint8 *DataPointer8 = (uint8 *)DestAddress;
+ size_t SegmentSize = MM_INTERNAL_MAX_FILL_DATA_SEG;
- while (BytesRemaining != 0) {
- /* Set size of next segment */
- if (BytesRemaining < MM_INTERNAL_MAX_FILL_DATA_SEG) {
- SegmentSize = BytesRemaining;
- }
+ while (BytesRemaining != 0)
+ {
+ /* Set size of next segment */
+ if (BytesRemaining < MM_INTERNAL_MAX_FILL_DATA_SEG)
+ {
+ SegmentSize = BytesRemaining;
+ }
- /* Fill next segment */
- for (i = 0; i < SegmentSize; i++) {
- PSP_Status = CFE_PSP_MemWrite8((cpuaddr)DataPointer8, FillPattern8);
- if (PSP_Status == CFE_PSP_SUCCESS) {
- DataPointer8++;
- } else {
- /* CFE_PSP_MemWrite8 error */
- BytesRemaining = 0;
- CFE_EVS_SendEvent(
- MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM8",
- (unsigned int)PSP_Status, (void *)DataPointer8);
- /* Stop fill segment loop */
- break;
- }
- }
+ /* Fill next segment */
+ for (i = 0; i < SegmentSize; i++)
+ {
+ PSP_Status = CFE_PSP_MemWrite8((cpuaddr)DataPointer8, FillPattern8);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ DataPointer8++;
+ }
+ else
+ {
+ /* CFE_PSP_MemWrite8 error */
+ BytesRemaining = 0;
+ CFE_EVS_SendEvent(MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM8",
+ (unsigned int)PSP_Status,
+ (void *)DataPointer8);
+ /* Stop fill segment loop */
+ break;
+ }
+ }
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* Update process counters */
- BytesRemaining -= SegmentSize;
- BytesProcessed += SegmentSize;
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* Update process counters */
+ BytesRemaining -= SegmentSize;
+ BytesProcessed += SegmentSize;
- /* Prevent CPU hogging between fill segments */
- if (BytesRemaining != 0) {
- MM_SegmentBreak();
- }
+ /* Prevent CPU hogging between fill segments */
+ if (BytesRemaining != 0)
+ {
+ MM_SegmentBreak();
+ }
+ }
}
- }
- /* Update last action statistics */
- if (BytesProcessed == CmdPtr->Payload.NumOfBytes) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM8;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
- MM_AppData.HkTlm.Payload.DataValue = (uint32)FillPattern8;
- MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
- } else {
- PSP_Status = CFE_PSP_ERROR;
- }
+ /* Update last action statistics */
+ if (BytesProcessed == CmdPtr->Payload.NumOfBytes)
+ {
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_MEM8;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(DestAddress);
+ MM_AppData.HkTlm.Payload.DataValue = (uint32)FillPattern8;
+ MM_AppData.HkTlm.Payload.BytesProcessed = BytesProcessed;
+ }
+ else
+ {
+ PSP_Status = CFE_PSP_ERROR;
+ }
- return PSP_Status;
+ return PSP_Status;
}
#endif /* MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE */
diff --git a/fsw/src/mm_mem8.h b/fsw/src/mm_mem8.h
index 4114aea..ebba76e 100644
--- a/fsw/src/mm_mem8.h
+++ b/fsw/src/mm_mem8.h
@@ -56,9 +56,10 @@
*
* \return Execution status
*/
-int32 MM_LoadMem8FromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMem8FromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress);
+ cpuaddr DestAddress);
/**
* \brief Memory8 dump to file
@@ -79,8 +80,7 @@ int32 MM_LoadMem8FromFile(osal_id_t FileHandle, const char *FileName,
*
* \return Execution status
*/
-int32 MM_DumpMem8ToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader);
+int32 MM_DumpMem8ToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader);
/**
* \brief Fill memory8
diff --git a/fsw/src/mm_utils.c b/fsw/src/mm_utils.c
index 612dad8..f8e61c5 100644
--- a/fsw/src/mm_utils.c
+++ b/fsw/src/mm_utils.c
@@ -37,8 +37,7 @@
** Macro Definitions
*************************************************************************/
-#define FILE_CRC_BUFFER_SIZE \
- 200 /**< \brief Number of bytes per read when computing file CRC */
+#define FILE_CRC_BUFFER_SIZE 200 /**< \brief Number of bytes per read when computing file CRC */
/*************************************************************************
** External Data
@@ -50,13 +49,14 @@ extern MM_AppData_t MM_AppData;
/* Reset the local housekeeping variables to default parameters */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-void MM_ResetHk(void) {
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_NOACTION;
- MM_AppData.HkTlm.Payload.MemType = MM_MemType_NOMEMTYPE;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(MM_INTERNAL_CLEAR_ADDR);
- MM_AppData.HkTlm.Payload.DataValue = MM_INTERNAL_CLEAR_PATTERN;
- MM_AppData.HkTlm.Payload.BytesProcessed = 0;
- MM_AppData.HkTlm.Payload.FileName[0] = MM_INTERNAL_CLEAR_FNAME;
+void MM_ResetHk(void)
+{
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_NOACTION;
+ MM_AppData.HkTlm.Payload.MemType = MM_MemType_NOMEMTYPE;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(MM_INTERNAL_CLEAR_ADDR);
+ MM_AppData.HkTlm.Payload.DataValue = MM_INTERNAL_CLEAR_PATTERN;
+ MM_AppData.HkTlm.Payload.BytesProcessed = 0;
+ MM_AppData.HkTlm.Payload.FileName[0] = MM_INTERNAL_CLEAR_FNAME;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -64,21 +64,22 @@ void MM_ResetHk(void) {
/* Process a load, dump, or fill segment break */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-void MM_SegmentBreak(void) {
- /*
- ** Performance Log entry stamp
- */
- CFE_ES_PerfLogEntry(MM_SEGBREAK_PERF_ID);
-
- /*
- ** Give something else the chance to run
- */
- OS_TaskDelay(MM_INTERNAL_PROCESSOR_CYCLE);
-
- /*
- ** Performance Log exit stamp
- */
- CFE_ES_PerfLogExit(MM_SEGBREAK_PERF_ID);
+void MM_SegmentBreak(void)
+{
+ /*
+ ** Performance Log entry stamp
+ */
+ CFE_ES_PerfLogEntry(MM_SEGBREAK_PERF_ID);
+
+ /*
+ ** Give something else the chance to run
+ */
+ OS_TaskDelay(MM_INTERNAL_PROCESSOR_CYCLE);
+
+ /*
+ ** Performance Log exit stamp
+ */
+ CFE_ES_PerfLogExit(MM_SEGBREAK_PERF_ID);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -86,160 +87,186 @@ void MM_SegmentBreak(void) {
/* Verify peek and poke command parameters */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_VerifyPeekPokeParams(cpuaddr Address, MM_MemType_Enum_t MemType,
- size_t SizeInBits) {
- size_t SizeInBytes;
- int32 OS_Status = OS_SUCCESS;
-
- switch (SizeInBits) {
- case MM_INTERNAL_BYTE_BIT_WIDTH:
- SizeInBytes = 1;
- break;
-
- case MM_INTERNAL_WORD_BIT_WIDTH:
- SizeInBytes = 2;
- if (MM_Verify16Aligned(Address, SizeInBytes) != true) {
- OS_Status = OS_ERROR_ADDRESS_MISALIGNED;
- CFE_EVS_SendEvent(
- MM_ALIGN16_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 16 bit aligned: Addr = %p Size = %u",
- (void *)Address, (unsigned int)SizeInBytes);
- }
- break;
-
- case MM_INTERNAL_DWORD_BIT_WIDTH:
- SizeInBytes = 4;
- if (MM_Verify32Aligned(Address, SizeInBytes) != true) {
- OS_Status = OS_ERROR_ADDRESS_MISALIGNED;
- CFE_EVS_SendEvent(
- MM_ALIGN32_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 32 bit aligned: Addr = %p Size = %u",
- (void *)Address, (unsigned int)SizeInBytes);
+int32 MM_VerifyPeekPokeParams(cpuaddr Address, MM_MemType_Enum_t MemType, size_t SizeInBits)
+{
+ size_t SizeInBytes;
+ int32 OS_Status = OS_SUCCESS;
+
+ switch (SizeInBits)
+ {
+ case MM_INTERNAL_BYTE_BIT_WIDTH:
+ SizeInBytes = 1;
+ break;
+
+ case MM_INTERNAL_WORD_BIT_WIDTH:
+ SizeInBytes = 2;
+ if (MM_Verify16Aligned(Address, SizeInBytes) != true)
+ {
+ OS_Status = OS_ERROR_ADDRESS_MISALIGNED;
+ CFE_EVS_SendEvent(MM_ALIGN16_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 16 bit aligned: Addr = %p Size = %u",
+ (void *)Address,
+ (unsigned int)SizeInBytes);
+ }
+ break;
+
+ case MM_INTERNAL_DWORD_BIT_WIDTH:
+ SizeInBytes = 4;
+ if (MM_Verify32Aligned(Address, SizeInBytes) != true)
+ {
+ OS_Status = OS_ERROR_ADDRESS_MISALIGNED;
+ CFE_EVS_SendEvent(MM_ALIGN32_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 32 bit aligned: Addr = %p Size = %u",
+ (void *)Address,
+ (unsigned int)SizeInBytes);
+ }
+ break;
+
+ default:
+ OS_Status = OS_ERR_INVALID_SIZE;
+ CFE_EVS_SendEvent(MM_DATA_SIZE_BITS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bits invalid: Data Size = %u",
+ (unsigned int)SizeInBits);
+ break;
}
- break;
-
- default:
- OS_Status = OS_ERR_INVALID_SIZE;
- CFE_EVS_SendEvent(MM_DATA_SIZE_BITS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bits invalid: Data Size = %u",
- (unsigned int)SizeInBits);
- break;
- }
-
- /* Do other checks if this one passed */
- if (OS_Status == OS_SUCCESS) {
- switch (MemType) {
- case MM_MemType_RAM:
- OS_Status =
- CFE_PSP_MemValidateRange(Address, SizeInBytes, CFE_PSP_MEM_RAM);
-
- if (OS_Status != CFE_PSP_SUCCESS) {
- CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = "
- "0x%08X Addr = %p Size = %u "
- "MemType = MEM_RAM",
- (unsigned int)OS_Status, (void *)Address,
- (unsigned int)SizeInBytes);
- }
- break;
-
- case MM_MemType_EEPROM:
- OS_Status =
- CFE_PSP_MemValidateRange(Address, SizeInBytes, CFE_PSP_MEM_EEPROM);
-
- if (OS_Status != CFE_PSP_SUCCESS) {
- CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = "
- "0x%08X Addr = %p Size = %u "
- "MemType = MEM_EEPROM",
- (unsigned int)OS_Status, (void *)Address,
- (unsigned int)SizeInBytes);
- }
- break;
+
+ /* Do other checks if this one passed */
+ if (OS_Status == OS_SUCCESS)
+ {
+ switch (MemType)
+ {
+ case MM_MemType_RAM:
+ OS_Status = CFE_PSP_MemValidateRange(Address, SizeInBytes, CFE_PSP_MEM_RAM);
+
+ if (OS_Status != CFE_PSP_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = "
+ "0x%08X Addr = %p Size = %u "
+ "MemType = MEM_RAM",
+ (unsigned int)OS_Status,
+ (void *)Address,
+ (unsigned int)SizeInBytes);
+ }
+ break;
+
+ case MM_MemType_EEPROM:
+ OS_Status = CFE_PSP_MemValidateRange(Address, SizeInBytes, CFE_PSP_MEM_EEPROM);
+
+ if (OS_Status != CFE_PSP_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = "
+ "0x%08X Addr = %p Size = %u "
+ "MemType = MEM_EEPROM",
+ (unsigned int)OS_Status,
+ (void *)Address,
+ (unsigned int)SizeInBytes);
+ }
+ break;
#ifdef MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE
- case MM_MemType_MEM32:
- OS_Status =
- CFE_PSP_MemValidateRange(Address, SizeInBytes, CFE_PSP_MEM_RAM);
-
- if (OS_Status != CFE_PSP_SUCCESS) {
- CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = "
- "0x%08X Addr = %p Size = %u MemType = MEM32",
- (unsigned int)OS_Status, (void *)Address,
- (unsigned int)SizeInBytes);
- }
- /*
- ** Peeks and Pokes must be 32 bits wide for this memory type
- */
- else if (SizeInBytes != 4) {
- OS_Status = OS_ERR_INVALID_SIZE;
- CFE_EVS_SendEvent(MM_DATA_SIZE_BITS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bits invalid: Data Size = %u",
- (unsigned int)SizeInBits);
- }
- break;
+ case MM_MemType_MEM32:
+ OS_Status = CFE_PSP_MemValidateRange(Address, SizeInBytes, CFE_PSP_MEM_RAM);
+
+ if (OS_Status != CFE_PSP_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = "
+ "0x%08X Addr = %p Size = %u MemType = MEM32",
+ (unsigned int)OS_Status,
+ (void *)Address,
+ (unsigned int)SizeInBytes);
+ }
+ /*
+ ** Peeks and Pokes must be 32 bits wide for this memory type
+ */
+ else if (SizeInBytes != 4)
+ {
+ OS_Status = OS_ERR_INVALID_SIZE;
+ CFE_EVS_SendEvent(MM_DATA_SIZE_BITS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bits invalid: Data Size = %u",
+ (unsigned int)SizeInBits);
+ }
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE */
#ifdef MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE
- case MM_MemType_MEM16:
- OS_Status =
- CFE_PSP_MemValidateRange(Address, SizeInBytes, CFE_PSP_MEM_RAM);
-
- if (OS_Status != CFE_PSP_SUCCESS) {
- CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = "
- "0x%08X Addr = %p Size = %u MemType = MEM16",
- (unsigned int)OS_Status, (void *)Address,
- (unsigned int)SizeInBytes);
- }
- /*
- ** Peeks and Pokes must be 16 bits wide for this memory type
- */
- else if (SizeInBytes != 2) {
- OS_Status = OS_ERR_INVALID_SIZE;
- CFE_EVS_SendEvent(MM_DATA_SIZE_BITS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bits invalid: Data Size = %u",
- (unsigned int)SizeInBits);
- }
- break;
+ case MM_MemType_MEM16:
+ OS_Status = CFE_PSP_MemValidateRange(Address, SizeInBytes, CFE_PSP_MEM_RAM);
+
+ if (OS_Status != CFE_PSP_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = "
+ "0x%08X Addr = %p Size = %u MemType = MEM16",
+ (unsigned int)OS_Status,
+ (void *)Address,
+ (unsigned int)SizeInBytes);
+ }
+ /*
+ ** Peeks and Pokes must be 16 bits wide for this memory type
+ */
+ else if (SizeInBytes != 2)
+ {
+ OS_Status = OS_ERR_INVALID_SIZE;
+ CFE_EVS_SendEvent(MM_DATA_SIZE_BITS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bits invalid: Data Size = %u",
+ (unsigned int)SizeInBits);
+ }
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE */
#ifdef MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE
- case MM_MemType_MEM8:
- OS_Status =
- CFE_PSP_MemValidateRange(Address, SizeInBytes, CFE_PSP_MEM_RAM);
-
- if (OS_Status != CFE_PSP_SUCCESS) {
- CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = "
- "0x%08X Addr = %p Size = %u MemType = MEM8",
- (unsigned int)OS_Status, (void *)Address,
- (unsigned int)SizeInBytes);
- }
- /*
- ** Peeks and Pokes must be 8 bits wide for this memory type
- */
- else if (SizeInBytes != 1) {
- OS_Status = OS_ERR_INVALID_SIZE;
- CFE_EVS_SendEvent(MM_DATA_SIZE_BITS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bits invalid: Data Size = %u",
- (unsigned int)SizeInBits);
- }
- break;
+ case MM_MemType_MEM8:
+ OS_Status = CFE_PSP_MemValidateRange(Address, SizeInBytes, CFE_PSP_MEM_RAM);
+
+ if (OS_Status != CFE_PSP_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = "
+ "0x%08X Addr = %p Size = %u MemType = MEM8",
+ (unsigned int)OS_Status,
+ (void *)Address,
+ (unsigned int)SizeInBytes);
+ }
+ /*
+ ** Peeks and Pokes must be 8 bits wide for this memory type
+ */
+ else if (SizeInBytes != 1)
+ {
+ OS_Status = OS_ERR_INVALID_SIZE;
+ CFE_EVS_SendEvent(MM_DATA_SIZE_BITS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bits invalid: Data Size = %u",
+ (unsigned int)SizeInBits);
+ }
+ break;
#endif /* MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE */
- default:
- OS_Status = OS_ERR_INVALID_ARGUMENT;
- CFE_EVS_SendEvent(MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid memory type specified: MemType = %d", MemType);
- break;
+ default:
+ OS_Status = OS_ERR_INVALID_ARGUMENT;
+ CFE_EVS_SendEvent(MM_MEMTYPE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Invalid memory type specified: MemType = %d",
+ MemType);
+ break;
- } /* end switch */
+ } /* end switch */
- } /* end OS_Status == OS_SUCCESS if */
+ } /* end OS_Status == OS_SUCCESS if */
- return OS_Status;
+ return OS_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -247,211 +274,262 @@ int32 MM_VerifyPeekPokeParams(cpuaddr Address, MM_MemType_Enum_t MemType,
/* Verify load/dump memory parameters */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_VerifyLoadDumpParams(cpuaddr Address, MM_MemType_Enum_t MemType,
- size_t SizeInBytes, uint8 VerifyType) {
- CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
- size_t MaxSize = 0;
- uint32 PSP_MemType = 0;
- char MemTypeStr[MM_MAX_MEM_TYPE_STR_LEN];
-
- if ((VerifyType != MM_VERIFY_LOAD) && (VerifyType != MM_VERIFY_DUMP) &&
- (VerifyType != MM_VERIFY_EVENT) && (VerifyType != MM_VERIFY_FILL) &&
- (VerifyType != MM_VERIFY_WID)) {
- PSP_Status = CFE_PSP_ERROR;
- }
-
- /* The DumpInEvent and LoadMemWID commands use the same max size for all
- * memory types. Therefore if one of these is the command being verified,
- * the max size can be set here rather than in the switch statement */
- if (VerifyType == MM_VERIFY_EVENT) {
- MaxSize = MM_INTERNAL_MAX_DUMP_INEVENT_BYTES;
- } else if (VerifyType == MM_VERIFY_WID) {
- MaxSize = MM_INTERFACE_MAX_UNINTERRUPTIBLE_DATA;
- }
-
- if (PSP_Status == CFE_PSP_SUCCESS) {
- /* All memory types and verification types do fundamentally the same set
- of checks. This switch-case statement sets up the values used to
- perform the checks at the end of the function. Two memory types
- also require special handling which is performed in the appropriate
- case. */
- switch (MemType) {
- /* else clauses are not needed in the VerifyType checks because the
- VerifyType is checked above and if the MaxSize is left unchanged,
- it will force an error when the size is checked as it should */
- case MM_MemType_RAM:
- if (VerifyType == MM_VERIFY_LOAD) {
- MaxSize = MM_INTERNAL_MAX_LOAD_FILE_DATA_RAM;
- } else if (VerifyType == MM_VERIFY_DUMP) {
- MaxSize = MM_INTERNAL_MAX_DUMP_FILE_DATA_RAM;
- } else if (VerifyType == MM_VERIFY_FILL) {
- MaxSize = MM_INTERNAL_MAX_FILL_DATA_RAM;
- }
- PSP_MemType = CFE_PSP_MEM_RAM;
- /* SAD: No need to check snprintf return value; buffer size can store
- * "MEM_RAM" without overflow */
- snprintf(MemTypeStr, MM_MAX_MEM_TYPE_STR_LEN, "%s", "MEM_RAM");
- break;
- case MM_MemType_EEPROM:
- if (VerifyType == MM_VERIFY_LOAD) {
- MaxSize = MM_INTERNAL_MAX_LOAD_FILE_DATA_EEPROM;
- } else if (VerifyType == MM_VERIFY_DUMP) {
- MaxSize = MM_INTERNAL_MAX_DUMP_FILE_DATA_EEPROM;
- } else if (VerifyType == MM_VERIFY_FILL) {
- MaxSize = MM_INTERNAL_MAX_FILL_DATA_EEPROM;
- }
- PSP_MemType = CFE_PSP_MEM_EEPROM;
- /* SAD: No need to check snprintf return value; buffer size can store
- * "MEM_EEPROM" without overflow */
- snprintf(MemTypeStr, MM_MAX_MEM_TYPE_STR_LEN, "%s", "MEM_EEPROM");
- break;
+int32 MM_VerifyLoadDumpParams(cpuaddr Address, MM_MemType_Enum_t MemType, size_t SizeInBytes, uint8 VerifyType)
+{
+ CFE_Status_t PSP_Status = CFE_PSP_SUCCESS;
+ size_t MaxSize = 0;
+ uint32 PSP_MemType = 0;
+ char MemTypeStr[MM_MAX_MEM_TYPE_STR_LEN];
+
+ if ((VerifyType != MM_VERIFY_LOAD) && (VerifyType != MM_VERIFY_DUMP) && (VerifyType != MM_VERIFY_EVENT)
+ && (VerifyType != MM_VERIFY_FILL) && (VerifyType != MM_VERIFY_WID))
+ {
+ PSP_Status = CFE_PSP_ERROR;
+ }
+
+ /* The DumpInEvent and LoadMemWID commands use the same max size for all
+ * memory types. Therefore if one of these is the command being verified,
+ * the max size can be set here rather than in the switch statement */
+ if (VerifyType == MM_VERIFY_EVENT)
+ {
+ MaxSize = MM_INTERNAL_MAX_DUMP_INEVENT_BYTES;
+ }
+ else if (VerifyType == MM_VERIFY_WID)
+ {
+ MaxSize = MM_INTERFACE_MAX_UNINTERRUPTIBLE_DATA;
+ }
+
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ /* All memory types and verification types do fundamentally the same set
+ of checks. This switch-case statement sets up the values used to
+ perform the checks at the end of the function. Two memory types
+ also require special handling which is performed in the appropriate
+ case. */
+ switch (MemType)
+ {
+ /* else clauses are not needed in the VerifyType checks because the
+ VerifyType is checked above and if the MaxSize is left unchanged,
+ it will force an error when the size is checked as it should */
+ case MM_MemType_RAM:
+ if (VerifyType == MM_VERIFY_LOAD)
+ {
+ MaxSize = MM_INTERNAL_MAX_LOAD_FILE_DATA_RAM;
+ }
+ else if (VerifyType == MM_VERIFY_DUMP)
+ {
+ MaxSize = MM_INTERNAL_MAX_DUMP_FILE_DATA_RAM;
+ }
+ else if (VerifyType == MM_VERIFY_FILL)
+ {
+ MaxSize = MM_INTERNAL_MAX_FILL_DATA_RAM;
+ }
+ PSP_MemType = CFE_PSP_MEM_RAM;
+ /* SAD: No need to check snprintf return value; buffer size can store
+ * "MEM_RAM" without overflow */
+ snprintf(MemTypeStr, MM_MAX_MEM_TYPE_STR_LEN, "%s", "MEM_RAM");
+ break;
+ case MM_MemType_EEPROM:
+ if (VerifyType == MM_VERIFY_LOAD)
+ {
+ MaxSize = MM_INTERNAL_MAX_LOAD_FILE_DATA_EEPROM;
+ }
+ else if (VerifyType == MM_VERIFY_DUMP)
+ {
+ MaxSize = MM_INTERNAL_MAX_DUMP_FILE_DATA_EEPROM;
+ }
+ else if (VerifyType == MM_VERIFY_FILL)
+ {
+ MaxSize = MM_INTERNAL_MAX_FILL_DATA_EEPROM;
+ }
+ PSP_MemType = CFE_PSP_MEM_EEPROM;
+ /* SAD: No need to check snprintf return value; buffer size can store
+ * "MEM_EEPROM" without overflow */
+ snprintf(MemTypeStr, MM_MAX_MEM_TYPE_STR_LEN, "%s", "MEM_EEPROM");
+ break;
#ifdef MM_INTERNAL_OPT_CODE_MEM32_MEMTYPE
- case MM_MemType_MEM32:
- if (VerifyType == MM_VERIFY_LOAD) {
- MaxSize = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM32;
- } else if (VerifyType == MM_VERIFY_DUMP) {
- MaxSize = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM32;
- } else if (VerifyType == MM_VERIFY_FILL) {
- MaxSize = MM_INTERNAL_MAX_FILL_DATA_MEM32;
- }
- PSP_MemType = CFE_PSP_MEM_RAM;
- /* SAD: No need to check snprintf return value; buffer size can store
- * "MEM32" without overflow */
- snprintf(MemTypeStr, MM_MAX_MEM_TYPE_STR_LEN, "%s", "MEM32");
- if (MM_Verify32Aligned(Address, SizeInBytes) != true) {
- PSP_Status = CFE_PSP_ERROR_ADDRESS_MISALIGNED;
- CFE_EVS_SendEvent(
- MM_ALIGN32_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 32 bit aligned: Addr = %p Size = %u",
- (void *)Address, (unsigned int)SizeInBytes);
- }
- break;
+ case MM_MemType_MEM32:
+ if (VerifyType == MM_VERIFY_LOAD)
+ {
+ MaxSize = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM32;
+ }
+ else if (VerifyType == MM_VERIFY_DUMP)
+ {
+ MaxSize = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM32;
+ }
+ else if (VerifyType == MM_VERIFY_FILL)
+ {
+ MaxSize = MM_INTERNAL_MAX_FILL_DATA_MEM32;
+ }
+ PSP_MemType = CFE_PSP_MEM_RAM;
+ /* SAD: No need to check snprintf return value; buffer size can store
+ * "MEM32" without overflow */
+ snprintf(MemTypeStr, MM_MAX_MEM_TYPE_STR_LEN, "%s", "MEM32");
+ if (MM_Verify32Aligned(Address, SizeInBytes) != true)
+ {
+ PSP_Status = CFE_PSP_ERROR_ADDRESS_MISALIGNED;
+ CFE_EVS_SendEvent(MM_ALIGN32_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 32 bit aligned: Addr = %p Size = %u",
+ (void *)Address,
+ (unsigned int)SizeInBytes);
+ }
+ break;
#endif
#ifdef MM_INTERNAL_OPT_CODE_MEM16_MEMTYPE
- case MM_MemType_MEM16:
- if (VerifyType == MM_VERIFY_LOAD) {
- MaxSize = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM16;
- } else if (VerifyType == MM_VERIFY_DUMP) {
- MaxSize = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM16;
- } else if (VerifyType == MM_VERIFY_FILL) {
- MaxSize = MM_INTERNAL_MAX_FILL_DATA_MEM16;
- }
- PSP_MemType = CFE_PSP_MEM_RAM;
- /* SAD: No need to check snprintf return value; buffer size can store
- * "MEM16" without overflow */
- snprintf(MemTypeStr, MM_MAX_MEM_TYPE_STR_LEN, "%s", "MEM16");
- if (MM_Verify16Aligned(Address, SizeInBytes) != true) {
- PSP_Status = CFE_PSP_ERROR_ADDRESS_MISALIGNED;
- CFE_EVS_SendEvent(
- MM_ALIGN16_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 16 bit aligned: Addr = %p Size = %u",
- (void *)Address, (unsigned int)SizeInBytes);
- }
- break;
+ case MM_MemType_MEM16:
+ if (VerifyType == MM_VERIFY_LOAD)
+ {
+ MaxSize = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM16;
+ }
+ else if (VerifyType == MM_VERIFY_DUMP)
+ {
+ MaxSize = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM16;
+ }
+ else if (VerifyType == MM_VERIFY_FILL)
+ {
+ MaxSize = MM_INTERNAL_MAX_FILL_DATA_MEM16;
+ }
+ PSP_MemType = CFE_PSP_MEM_RAM;
+ /* SAD: No need to check snprintf return value; buffer size can store
+ * "MEM16" without overflow */
+ snprintf(MemTypeStr, MM_MAX_MEM_TYPE_STR_LEN, "%s", "MEM16");
+ if (MM_Verify16Aligned(Address, SizeInBytes) != true)
+ {
+ PSP_Status = CFE_PSP_ERROR_ADDRESS_MISALIGNED;
+ CFE_EVS_SendEvent(MM_ALIGN16_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 16 bit aligned: Addr = %p Size = %u",
+ (void *)Address,
+ (unsigned int)SizeInBytes);
+ }
+ break;
#endif
#ifdef MM_INTERNAL_OPT_CODE_MEM8_MEMTYPE
- case MM_MemType_MEM8:
- if (VerifyType == MM_VERIFY_LOAD) {
- MaxSize = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM8;
- } else if (VerifyType == MM_VERIFY_DUMP) {
- MaxSize = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM8;
- } else if (VerifyType == MM_VERIFY_FILL) {
- MaxSize = MM_INTERNAL_MAX_FILL_DATA_MEM8;
- }
- PSP_MemType = CFE_PSP_MEM_RAM;
- /* SAD: No need to check snprintf return value; buffer size can store
- * "MEM8" without overflow */
- snprintf(MemTypeStr, MM_MAX_MEM_TYPE_STR_LEN, "%s", "MEM8");
- break;
+ case MM_MemType_MEM8:
+ if (VerifyType == MM_VERIFY_LOAD)
+ {
+ MaxSize = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM8;
+ }
+ else if (VerifyType == MM_VERIFY_DUMP)
+ {
+ MaxSize = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM8;
+ }
+ else if (VerifyType == MM_VERIFY_FILL)
+ {
+ MaxSize = MM_INTERNAL_MAX_FILL_DATA_MEM8;
+ }
+ PSP_MemType = CFE_PSP_MEM_RAM;
+ /* SAD: No need to check snprintf return value; buffer size can store
+ * "MEM8" without overflow */
+ snprintf(MemTypeStr, MM_MAX_MEM_TYPE_STR_LEN, "%s", "MEM8");
+ break;
#endif
- default:
- PSP_Status = CFE_PSP_ERROR;
- CFE_EVS_SendEvent(MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid memory type specified: MemType = %d", MemType);
-
- break;
- } /* end MemType switch */
- }
-
- if (PSP_Status == CFE_PSP_SUCCESS) {
- if ((SizeInBytes == 0) || (SizeInBytes > MaxSize)) {
- PSP_Status = CFE_PSP_ERROR;
- CFE_EVS_SendEvent(
- MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u",
- (unsigned int)SizeInBytes);
+ default:
+ PSP_Status = CFE_PSP_ERROR;
+ CFE_EVS_SendEvent(MM_MEMTYPE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Invalid memory type specified: MemType = %d",
+ MemType);
+
+ break;
+ } /* end MemType switch */
}
- }
- if (PSP_Status == CFE_PSP_SUCCESS) {
- PSP_Status = CFE_PSP_MemValidateRange(Address, SizeInBytes, PSP_MemType);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ if ((SizeInBytes == 0) || (SizeInBytes > MaxSize))
+ {
+ PSP_Status = CFE_PSP_ERROR;
+ CFE_EVS_SendEvent(MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u",
+ (unsigned int)SizeInBytes);
+ }
+ }
- if (PSP_Status != CFE_PSP_SUCCESS) {
- CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s",
- (unsigned int)PSP_Status, (void *)Address,
- (unsigned int)SizeInBytes, MemTypeStr);
+ if (PSP_Status == CFE_PSP_SUCCESS)
+ {
+ PSP_Status = CFE_PSP_MemValidateRange(Address, SizeInBytes, PSP_MemType);
+
+ if (PSP_Status != CFE_PSP_SUCCESS)
+ {
+ CFE_EVS_SendEvent(MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s",
+ (unsigned int)PSP_Status,
+ (void *)Address,
+ (unsigned int)SizeInBytes,
+ MemTypeStr);
+ }
}
- }
- return PSP_Status;
+ return PSP_Status;
}
/******************************************************************************/
-bool MM_Verify32Aligned(cpuaddr Address, size_t Size) {
- bool IsAligned = false;
+bool MM_Verify32Aligned(cpuaddr Address, size_t Size)
+{
+ bool IsAligned = false;
- if (Address % sizeof(uint32) == 0 && Size % sizeof(uint32) == 0) {
- IsAligned = true;
- }
+ if (Address % sizeof(uint32) == 0 && Size % sizeof(uint32) == 0)
+ {
+ IsAligned = true;
+ }
- return IsAligned;
+ return IsAligned;
}
/******************************************************************************/
-bool MM_Verify16Aligned(cpuaddr Address, size_t Size) {
- bool IsAligned = false;
+bool MM_Verify16Aligned(cpuaddr Address, size_t Size)
+{
+ bool IsAligned = false;
- if (Address % sizeof(uint16) == 0 && Size % sizeof(uint16) == 0) {
- IsAligned = true;
- }
+ if (Address % sizeof(uint16) == 0 && Size % sizeof(uint16) == 0)
+ {
+ IsAligned = true;
+ }
- return IsAligned;
+ return IsAligned;
}
/******************************************************************************/
-int32 MM_ResolveSymAddr(MM_SymAddr_t *SymAddr, cpuaddr *ResolvedAddr) {
- int32 OS_Status = OS_SUCCESS;
-
- /*
- ** NUL terminate the very end of the symbol name string array as a
- ** safety measure
- */
- SymAddr->SymName[CFE_MISSION_MAX_PATH_LEN - 1] = '\0';
-
- /*
- ** If the symbol name string is a nul string
- ** we use the offset as the absolute address
- */
- if (OS_strnlen(SymAddr->SymName, CFE_MISSION_MAX_PATH_LEN) == 0) {
- *ResolvedAddr = (cpuaddr)CFE_ES_MEMADDRESS_TO_PTR(SymAddr->Offset);
- OS_Status = OS_ERROR_NAME_LENGTH;
- } else {
+int32 MM_ResolveSymAddr(MM_SymAddr_t *SymAddr, cpuaddr *ResolvedAddr)
+{
+ int32 OS_Status = OS_SUCCESS;
+
+ /*
+ ** NUL terminate the very end of the symbol name string array as a
+ ** safety measure
+ */
+ SymAddr->SymName[CFE_MISSION_MAX_PATH_LEN - 1] = '\0';
+
/*
- ** If symbol name is not an empty string look it up
- ** using the OSAL API and add the offset if it succeeds
+ ** If the symbol name string is a nul string
+ ** we use the offset as the absolute address
*/
- OS_Status = OS_SymbolLookup(ResolvedAddr, SymAddr->SymName);
- if (OS_Status == OS_SUCCESS) {
- *ResolvedAddr += (cpuaddr)CFE_ES_MEMADDRESS_TO_PTR(SymAddr->Offset);
+ if (OS_strnlen(SymAddr->SymName, CFE_MISSION_MAX_PATH_LEN) == 0)
+ {
+ *ResolvedAddr = (cpuaddr)CFE_ES_MEMADDRESS_TO_PTR(SymAddr->Offset);
+ }
+ else
+ {
+ /*
+ ** If symbol name is not an empty string look it up
+ ** using the OSAL API and add the offset if it succeeds
+ */
+ OS_Status = OS_SymbolLookup(ResolvedAddr, SymAddr->SymName);
+ if (OS_Status == OS_SUCCESS)
+ {
+ *ResolvedAddr += (cpuaddr)CFE_ES_MEMADDRESS_TO_PTR(SymAddr->Offset);
+ }
}
- }
- return OS_Status;
+ return OS_Status;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -460,40 +538,45 @@ int32 MM_ResolveSymAddr(MM_SymAddr_t *SymAddr, cpuaddr *ResolvedAddr) {
/* Operates from the current location of the file poiner to EOF */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-int32 MM_ComputeCRCFromFile(osal_id_t FileHandle, uint32 *CrcPtr,
- uint32 TypeCRC) {
- int32 ByteCntr;
- int32 OS_Status = OS_SUCCESS;
- uint32 TempCrc = 0;
- static uint8 DataArray[FILE_CRC_BUFFER_SIZE];
-
- do {
- /*
- ** Read in some data
- */
- ByteCntr = OS_read(FileHandle, DataArray, sizeof(DataArray));
+int32 MM_ComputeCRCFromFile(osal_id_t FileHandle, uint32 *CrcPtr, uint32 TypeCRC)
+{
+ int32 ByteCntr;
+ int32 OS_Status = OS_SUCCESS;
+ uint32 TempCrc = 0;
+ static uint8 DataArray[FILE_CRC_BUFFER_SIZE];
+
+ do
+ {
+ /*
+ ** Read in some data
+ */
+ ByteCntr = OS_read(FileHandle, DataArray, sizeof(DataArray));
+
+ /*
+ ** If we didn't hit end of file on the last read...
+ */
+ if (ByteCntr > 0)
+ {
+ /*
+ ** Calculate the CRC based upon the previous CRC calculation
+ */
+ TempCrc = CFE_ES_CalculateCRC(DataArray, ByteCntr, TempCrc, TypeCRC);
+ }
+
+ } while (ByteCntr > 0);
/*
- ** If we didn't hit end of file on the last read...
+ ** Check if we broke out of the loop because of an error return
+ ** from the OS_read call
*/
- if (ByteCntr > 0) {
- /*
- ** Calculate the CRC based upon the previous CRC calculation
- */
- TempCrc = CFE_ES_CalculateCRC(DataArray, ByteCntr, TempCrc, TypeCRC);
+ if (ByteCntr < 0)
+ {
+ OS_Status = ByteCntr;
+ }
+ else
+ {
+ *CrcPtr = TempCrc;
}
- } while (ByteCntr > 0);
-
- /*
- ** Check if we broke out of the loop because of an error return
- ** from the OS_read call
- */
- if (ByteCntr < 0) {
- OS_Status = ByteCntr;
- } else {
- *CrcPtr = TempCrc;
- }
-
- return OS_Status;
+ return OS_Status;
}
diff --git a/fsw/src/mm_utils.h b/fsw/src/mm_utils.h
index d92cc9e..431755b 100644
--- a/fsw/src/mm_utils.h
+++ b/fsw/src/mm_utils.h
@@ -82,8 +82,7 @@ void MM_SegmentBreak(void);
*
* \return Execution status
*/
-int32 MM_VerifyPeekPokeParams(cpuaddr Address, MM_MemType_Enum_t MemType,
- size_t SizeInBits);
+int32 MM_VerifyPeekPokeParams(cpuaddr Address, MM_MemType_Enum_t MemType, size_t SizeInBits);
/**
* \brief Verify memory load and dump parameters
@@ -106,8 +105,7 @@ int32 MM_VerifyPeekPokeParams(cpuaddr Address, MM_MemType_Enum_t MemType,
*
* \return Execution status
*/
-int32 MM_VerifyLoadDumpParams(cpuaddr Address, MM_MemType_Enum_t MemType,
- size_t SizeInBytes, uint8 VerifyType);
+int32 MM_VerifyLoadDumpParams(cpuaddr Address, MM_MemType_Enum_t MemType, size_t SizeInBytes, uint8 VerifyType);
/**
* \brief Verify 32 bit alignment
@@ -197,7 +195,6 @@ int32 MM_ResolveSymAddr(MM_SymAddr_t *SymAddr, cpuaddr *ResolvedAddr);
*
* \sa #CFE_ES_CalculateCRC, #OS_read
*/
-int32 MM_ComputeCRCFromFile(osal_id_t FileHandle, uint32 *CrcPtr,
- uint32 TypeCRC);
+int32 MM_ComputeCRCFromFile(osal_id_t FileHandle, uint32 *CrcPtr, uint32 TypeCRC);
#endif
diff --git a/fsw/src/mm_version.h b/fsw/src/mm_version.h
index 6e3e5a5..d45f939 100644
--- a/fsw/src/mm_version.h
+++ b/fsw/src/mm_version.h
@@ -32,7 +32,7 @@
#define MM_MAJOR_VERSION 7 /**< \brief Major version number */
#define MM_MINOR_VERSION 0 /**< \brief Minor version number */
-#define MM_REVISION 0 /**< \brief Revision number */
+#define MM_REVISION 0 /**< \brief Revision number */
#endif
diff --git a/unit-test/mm_app_tests.c b/unit-test/mm_app_tests.c
index 1f28abe..5de71a9 100644
--- a/unit-test/mm_app_tests.c
+++ b/unit-test/mm_app_tests.c
@@ -47,233 +47,240 @@
/* Function Definitions */
/* ==================== */
-void MM_AppMain_Test_Nominal(void) {
- CFE_SB_Buffer_t Buf;
- CFE_SB_Buffer_t *BufPtr = &Buf;
+void MM_AppMain_Test_Nominal(void)
+{
+ CFE_SB_Buffer_t Buf;
+ CFE_SB_Buffer_t *BufPtr = &Buf;
- /* Set to exit loop after first run */
- UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true);
+ /* Set to exit loop after first run */
+ UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true);
- /* Causes check for non-null buffer pointer to succeed */
- UT_SetDataBuffer(UT_KEY(CFE_SB_ReceiveBuffer), &BufPtr, sizeof(BufPtr),
- false);
+ /* Causes check for non-null buffer pointer to succeed */
+ UT_SetDataBuffer(UT_KEY(CFE_SB_ReceiveBuffer), &BufPtr, sizeof(BufPtr), false);
- /* Execute the function being tested */
- MM_AppMain();
+ /* Execute the function being tested */
+ MM_AppMain();
- /* Verify results */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- UtAssert_STUB_COUNT(CFE_ES_ExitApp, 1);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ UtAssert_STUB_COUNT(CFE_ES_ExitApp, 1);
}
-void MM_AppMain_Test_AppInitError(void) {
- /* Set to exit loop after first run */
- UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true);
+void MM_AppMain_Test_AppInitError(void)
+{
+ /* Set to exit loop after first run */
+ UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true);
- /* Set to prevent call to CFE_SB_RcvMsg from returning an error */
- UT_SetDeferredRetcode(UT_KEY(CFE_SB_ReceiveBuffer), 1, CFE_SUCCESS);
+ /* Set to prevent call to CFE_SB_RcvMsg from returning an error */
+ UT_SetDeferredRetcode(UT_KEY(CFE_SB_ReceiveBuffer), 1, CFE_SUCCESS);
- /* Set to satisfy condition "Status != CFE_SUCCESS" */
- UT_SetDeferredRetcode(UT_KEY(CFE_EVS_Register), 1, CFE_ES_BAD_ARGUMENT);
+ /* Set to satisfy condition "Status != CFE_SUCCESS" */
+ UT_SetDeferredRetcode(UT_KEY(CFE_EVS_Register), 1, CFE_ES_BAD_ARGUMENT);
- /* Execute the function being tested */
- MM_AppMain();
+ /* Execute the function being tested */
+ MM_AppMain();
- /* Verify results */
- UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_ERROR);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ /* Verify results */
+ UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_ERROR);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
}
-void MM_AppMain_Test_SBError(void) {
- /* Set to exit loop after first run */
- UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true);
+void MM_AppMain_Test_SBError(void)
+{
+ /* Set to exit loop after first run */
+ UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true);
- /* Set to generate error message MM_PIPE_ERR_EID */
- UT_SetDefaultReturnValue(UT_KEY(CFE_SB_ReceiveBuffer), CFE_SB_BAD_ARGUMENT);
+ /* Set to generate error message MM_PIPE_ERR_EID */
+ UT_SetDefaultReturnValue(UT_KEY(CFE_SB_ReceiveBuffer), CFE_SB_BAD_ARGUMENT);
- /* Execute the function being tested */
- MM_AppMain();
+ /* Execute the function being tested */
+ MM_AppMain();
- /* Verify results */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2);
- MM_Test_Verify_Event(1, MM_PIPE_ERR_EID, CFE_EVS_EventType_ERROR,
- "SB Pipe Read Error, App will exit. RC = 0x%08X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2);
+ MM_Test_Verify_Event(1, MM_PIPE_ERR_EID, CFE_EVS_EventType_ERROR, "SB Pipe Read Error, App will exit. RC = 0x%08X");
}
-void MM_AppMain_Test_SBTimeout(void) {
- /* Set to exit loop after first run */
- UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true);
+void MM_AppMain_Test_SBTimeout(void)
+{
+ /* Set to exit loop after first run */
+ UT_SetDeferredRetcode(UT_KEY(CFE_ES_RunLoop), 1, true);
- /* Set to generate error message MM_PIPE_ERR_EID */
- UT_SetDefaultReturnValue(UT_KEY(CFE_SB_ReceiveBuffer), CFE_SB_TIME_OUT);
+ /* Set to generate error message MM_PIPE_ERR_EID */
+ UT_SetDefaultReturnValue(UT_KEY(CFE_SB_ReceiveBuffer), CFE_SB_TIME_OUT);
- /* Execute the function being tested */
- MM_AppMain();
+ /* Execute the function being tested */
+ MM_AppMain();
- /* Verify results */
- /* Generates 1 event message we don't care about in this test */
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ /* Verify results */
+ /* Generates 1 event message we don't care about in this test */
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
}
-void MM_AppInit_Test_Nominal(void) {
- CFE_Status_t Result;
+void MM_AppInit_Test_Nominal(void)
+{
+ CFE_Status_t Result;
- /* Initialize command counters to 1, in order verify that MM_AppInit actually
- * initializes them */
- MM_AppData.HkTlm.Payload.CmdCounter = 1;
- MM_AppData.HkTlm.Payload.ErrCounter = 1;
+ /* Initialize command counters to 1, in order verify that MM_AppInit actually
+ * initializes them */
+ MM_AppData.HkTlm.Payload.CommandCounter = 1;
+ MM_AppData.HkTlm.Payload.CommandErrorCounter = 1;
- /* Execute the function being tested */
- Result = MM_AppInit();
+ /* Execute the function being tested */
+ Result = MM_AppInit();
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_RUN);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_RUN);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_INIT_INF_EID, CFE_EVS_EventType_INFORMATION,
- "MM Initialized. Version %d.%d.%d.%d");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0, MM_INIT_INF_EID, CFE_EVS_EventType_INFORMATION, "MM Initialized. Version %d.%d.%d.%d");
}
-void MM_AppInit_Test_EVSRegisterError(void) {
- CFE_Status_t Result;
+void MM_AppInit_Test_EVSRegisterError(void)
+{
+ CFE_Status_t Result;
- /* Initialize command counters to 1, in order verify that MM_AppInit actually
- * initializes them */
- MM_AppData.HkTlm.Payload.CmdCounter = 1;
- MM_AppData.HkTlm.Payload.ErrCounter = 1;
+ /* Initialize command counters to 1, in order verify that MM_AppInit actually
+ * initializes them */
+ MM_AppData.HkTlm.Payload.CommandCounter = 1;
+ MM_AppData.HkTlm.Payload.CommandErrorCounter = 1;
- /* Set to generate system log message "MM App: Error Registering For Event
- * Services " */
- UT_SetDeferredRetcode(UT_KEY(CFE_EVS_Register), 1, CFE_ES_BAD_ARGUMENT);
+ /* Set to generate system log message "MM App: Error Registering For Event
+ * Services " */
+ UT_SetDeferredRetcode(UT_KEY(CFE_EVS_Register), 1, CFE_ES_BAD_ARGUMENT);
- /* Execute the function being tested */
- Result = MM_AppInit();
+ /* Execute the function being tested */
+ Result = MM_AppInit();
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_ES_BAD_ARGUMENT);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_ES_BAD_ARGUMENT);
- UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_RUN);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_RUN);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
- UtAssert_StrnCmp(
- "MM App: Error Registering For Event Services, RC = 0x%08X\n",
- context_CFE_ES_WriteToSysLog.Spec, CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
- "Sys Log string matched expected result, '%s'",
- context_CFE_ES_WriteToSysLog.Spec);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_StrnCmp("MM App: Error Registering For Event Services, RC = 0x%08X\n",
+ context_CFE_ES_WriteToSysLog.Spec,
+ CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
+ "Sys Log string matched expected result, '%s'",
+ context_CFE_ES_WriteToSysLog.Spec);
}
-void MM_AppInit_Test_SBCreatePipeError(void) {
- CFE_Status_t Result;
+void MM_AppInit_Test_SBCreatePipeError(void)
+{
+ CFE_Status_t Result;
- /* Initialize command counters to 1, in order verify that MM_AppInit actually
- * initializes them */
- MM_AppData.HkTlm.Payload.CmdCounter = 1;
- MM_AppData.HkTlm.Payload.ErrCounter = 1;
+ /* Initialize command counters to 1, in order verify that MM_AppInit actually
+ * initializes them */
+ MM_AppData.HkTlm.Payload.CommandCounter = 1;
+ MM_AppData.HkTlm.Payload.CommandErrorCounter = 1;
- /* Set to generate system log message "MM App: Error Creating SB Pipe" */
- UT_SetDefaultReturnValue(UT_KEY(CFE_SB_CreatePipe), CFE_SB_PIPE_CR_ERR);
+ /* Set to generate system log message "MM App: Error Creating SB Pipe" */
+ UT_SetDefaultReturnValue(UT_KEY(CFE_SB_CreatePipe), CFE_SB_PIPE_CR_ERR);
- /* Execute the function being tested */
- Result = MM_AppInit();
+ /* Execute the function being tested */
+ Result = MM_AppInit();
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SB_PIPE_CR_ERR);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SB_PIPE_CR_ERR);
- UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_RUN);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_RUN);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- UtAssert_StrnCmp("Error Creating SB Pipe, RC = 0x%08X",
- context_CFE_EVS_SendEvent[0].Spec,
- CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
- "Sys Log string matched expected result, '%s'",
- context_CFE_EVS_SendEvent[0].Spec);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ UtAssert_StrnCmp("Error Creating SB Pipe, RC = 0x%08X",
+ context_CFE_EVS_SendEvent[0].Spec,
+ CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
+ "Sys Log string matched expected result, '%s'",
+ context_CFE_EVS_SendEvent[0].Spec);
}
-void MM_AppInit_Test_SBSubscribeHKError(void) {
- CFE_Status_t Result;
+void MM_AppInit_Test_SBSubscribeHKError(void)
+{
+ CFE_Status_t Result;
- /* Initialize command counters to 1, in order verify that MM_AppInit actually
- * initializes them */
- MM_AppData.HkTlm.Payload.CmdCounter = 1;
- MM_AppData.HkTlm.Payload.ErrCounter = 1;
+ /* Initialize command counters to 1, in order verify that MM_AppInit actually
+ * initializes them */
+ MM_AppData.HkTlm.Payload.CommandCounter = 1;
+ MM_AppData.HkTlm.Payload.CommandErrorCounter = 1;
- /* Set to generate system log message "MM App: Error Subscribing to HK
- * Request" */
- UT_SetDeferredRetcode(UT_KEY(CFE_SB_Subscribe), 1, CFE_SB_BAD_ARGUMENT);
+ /* Set to generate system log message "MM App: Error Subscribing to HK
+ * Request" */
+ UT_SetDeferredRetcode(UT_KEY(CFE_SB_Subscribe), 1, CFE_SB_BAD_ARGUMENT);
- /* Execute the function being tested */
- Result = MM_AppInit();
+ /* Execute the function being tested */
+ Result = MM_AppInit();
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SB_BAD_ARGUMENT);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SB_BAD_ARGUMENT);
- UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_RUN);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_RUN);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- UtAssert_StrnCmp("Error Subscribing to HK Request, RC = 0x%08X",
- context_CFE_EVS_SendEvent[0].Spec,
- CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
- "Sys Log string matched expected result, '%s'",
- context_CFE_EVS_SendEvent[0].Spec);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ UtAssert_StrnCmp("Error Subscribing to HK Request, RC = 0x%08X",
+ context_CFE_EVS_SendEvent[0].Spec,
+ CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
+ "Sys Log string matched expected result, '%s'",
+ context_CFE_EVS_SendEvent[0].Spec);
}
-void MM_AppInit_Test_SBSubscribeMMError(void) {
- CFE_Status_t Result;
+void MM_AppInit_Test_SBSubscribeMMError(void)
+{
+ CFE_Status_t Result;
- /* Initialize command counters to 1, in order verify that MM_AppInit actually
- * initializes them */
- MM_AppData.HkTlm.Payload.CmdCounter = 1;
- MM_AppData.HkTlm.Payload.ErrCounter = 1;
+ /* Initialize command counters to 1, in order verify that MM_AppInit actually
+ * initializes them */
+ MM_AppData.HkTlm.Payload.CommandCounter = 1;
+ MM_AppData.HkTlm.Payload.CommandErrorCounter = 1;
- /* Set to generate system log message "MM App: Error Subscribing to MM
- * Command" */
- UT_SetDeferredRetcode(UT_KEY(CFE_SB_Subscribe), 2, CFE_SB_BAD_ARGUMENT);
+ /* Set to generate system log message "MM App: Error Subscribing to MM
+ * Command" */
+ UT_SetDeferredRetcode(UT_KEY(CFE_SB_Subscribe), 2, CFE_SB_BAD_ARGUMENT);
- /* Execute the function being tested */
- Result = MM_AppInit();
+ /* Execute the function being tested */
+ Result = MM_AppInit();
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SB_BAD_ARGUMENT);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SB_BAD_ARGUMENT);
- UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_RUN);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.RunStatus, CFE_ES_RunStatus_APP_RUN);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- UtAssert_StrnCmp("Error Subscribing to MM Command, RC = 0x%08X",
- context_CFE_EVS_SendEvent[0].Spec,
- CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
- "Sys Log string matched expected result, '%s'",
- context_CFE_EVS_SendEvent[0].Spec);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ UtAssert_StrnCmp("Error Subscribing to MM Command, RC = 0x%08X",
+ context_CFE_EVS_SendEvent[0].Spec,
+ CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
+ "Sys Log string matched expected result, '%s'",
+ context_CFE_EVS_SendEvent[0].Spec);
}
/*
* Register the test cases to execute with the unit test tool
*/
-void UtTest_Setup(void) {
- ADD_TEST(MM_AppMain_Test_Nominal);
- ADD_TEST(MM_AppMain_Test_AppInitError);
- ADD_TEST(MM_AppMain_Test_SBError);
- ADD_TEST(MM_AppMain_Test_SBTimeout);
- ADD_TEST(MM_AppInit_Test_Nominal);
- ADD_TEST(MM_AppInit_Test_EVSRegisterError);
- ADD_TEST(MM_AppInit_Test_SBCreatePipeError);
- ADD_TEST(MM_AppInit_Test_SBSubscribeHKError);
- ADD_TEST(MM_AppInit_Test_SBSubscribeMMError);
+void UtTest_Setup(void)
+{
+ ADD_TEST(MM_AppMain_Test_Nominal);
+ ADD_TEST(MM_AppMain_Test_AppInitError);
+ ADD_TEST(MM_AppMain_Test_SBError);
+ ADD_TEST(MM_AppMain_Test_SBTimeout);
+ ADD_TEST(MM_AppInit_Test_Nominal);
+ ADD_TEST(MM_AppInit_Test_EVSRegisterError);
+ ADD_TEST(MM_AppInit_Test_SBCreatePipeError);
+ ADD_TEST(MM_AppInit_Test_SBSubscribeHKError);
+ ADD_TEST(MM_AppInit_Test_SBSubscribeMMError);
}
diff --git a/unit-test/mm_cmds_tests.c b/unit-test/mm_cmds_tests.c
index 224cfa7..983221c 100644
--- a/unit-test/mm_cmds_tests.c
+++ b/unit-test/mm_cmds_tests.c
@@ -51,2121 +51,2153 @@
#include
#include
-void Test_MM_SendHkCmd_Nominal(void) {
- MM_SendHkCmd_t SendHkCmd;
- CFE_Status_t Result;
+void Test_MM_SendHkCmd_Nominal(void)
+{
+ MM_SendHkCmd_t SendHkCmd;
+ CFE_Status_t Result;
- memset((void *)&SendHkCmd, 0, sizeof(MM_SendHkCmd_t));
+ memset((void *)&SendHkCmd, 0, sizeof(MM_SendHkCmd_t));
- /* Execute the function being tested */
- Result = MM_SendHkCmd(&SendHkCmd);
+ /* Execute the function being tested */
+ Result = MM_SendHkCmd(&SendHkCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
- UtAssert_STUB_COUNT(CFE_SB_TimeStampMsg, 1);
- UtAssert_STUB_COUNT(CFE_SB_TransmitMsg, 1);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_SB_TimeStampMsg, 1);
+ UtAssert_STUB_COUNT(CFE_SB_TransmitMsg, 1);
}
-void Test_MM_NoopCmd_Nominal(void) {
- MM_NoopCmd_t NoopCmd;
- CFE_Status_t Status;
+void Test_MM_NoopCmd_Nominal(void)
+{
+ MM_NoopCmd_t NoopCmd;
+ CFE_Status_t Status;
- memset((void *)&NoopCmd, 0, sizeof(MM_NoopCmd_t));
+ memset((void *)&NoopCmd, 0, sizeof(MM_NoopCmd_t));
- /* Set up values to evaluate against */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_NOACTION;
+ /* Set up values to evaluate against */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_NOACTION;
- /* Run function under test */
- Status = MM_NoopCmd(&NoopCmd);
+ /* Run function under test */
+ Status = MM_NoopCmd(&NoopCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Status, CFE_SUCCESS);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Status, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_NOOP);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_NOOP);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION,
- "No-op command. Version %d.%d.%d.%d");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0, MM_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "No-op command. Version %d.%d.%d.%d");
}
-void Test_MM_ResetCountersCmd_Nominal(void) {
- MM_ResetCountersCmd_t ResetCountersCmd;
- CFE_Status_t Status;
+void Test_MM_ResetCountersCmd_Nominal(void)
+{
+ MM_ResetCountersCmd_t ResetCountersCmd;
+ CFE_Status_t Status;
- memset((void *)&ResetCountersCmd, 0, sizeof(MM_ResetCountersCmd_t));
+ memset((void *)&ResetCountersCmd, 0, sizeof(MM_ResetCountersCmd_t));
- /* Set up values to evaluate against */
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_NOACTION;
- MM_AppData.HkTlm.Payload.CmdCounter = 1;
- MM_AppData.HkTlm.Payload.ErrCounter = 1;
+ /* Set up values to evaluate against */
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_NOACTION;
+ MM_AppData.HkTlm.Payload.CommandCounter = 1;
+ MM_AppData.HkTlm.Payload.CommandErrorCounter = 1;
- /* Run function under test */
- Status = MM_ResetCountersCmd(&ResetCountersCmd);
+ /* Run function under test */
+ Status = MM_ResetCountersCmd(&ResetCountersCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Status, CFE_SUCCESS);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Status, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_RESET);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_RESET);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_RESET_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Reset counters command received");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0, MM_RESET_INF_EID, CFE_EVS_EventType_INFORMATION, "Reset counters command received");
}
-void Test_MM_LookupSymCmd_Nominal(void) {
- MM_LookupSymCmd_t LookupSymCmd;
- uint32 Addr;
- cpuaddr ResolvedAddr;
- CFE_Status_t Result;
+void Test_MM_LookupSymCmd_Nominal(void)
+{
+ MM_LookupSymCmd_t LookupSymCmd;
+ uint32 Addr;
+ cpuaddr ResolvedAddr;
+ CFE_Status_t Result;
- /* Set up value to evaluate against */
- Addr = 0x42;
- ResolvedAddr = (cpuaddr)&Addr;
+ /* Set up value to evaluate against */
+ Addr = 0x42;
+ ResolvedAddr = (cpuaddr)&Addr;
- /* Force functions to act as expected */
- UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 1);
- UT_SetDefaultReturnValue(UT_KEY(OS_SymbolLookup), OS_SUCCESS);
+ /* Force functions to act as expected */
+ UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 1);
+ UT_SetDefaultReturnValue(UT_KEY(OS_SymbolLookup), OS_SUCCESS);
- UT_SetDataBuffer(UT_KEY(OS_SymbolLookup), &ResolvedAddr, sizeof(cpuaddr),
- false);
+ UT_SetDataBuffer(UT_KEY(OS_SymbolLookup), &ResolvedAddr, sizeof(cpuaddr), false);
- /* Execute the function being tested */
- Result = MM_LookupSymCmd(&LookupSymCmd);
+ /* Execute the function being tested */
+ Result = MM_LookupSymCmd(&LookupSymCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction,
- MM_LastAction_SYM_LOOKUP);
- UtAssert_ADDRESS_EQ(
- CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), ResolvedAddr);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_SYM_LOOKUP);
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), ResolvedAddr);
- MM_Test_Verify_Event(0, MM_SYM_LOOKUP_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Symbol Lookup Command: Name = '%s' Addr = %p");
+ MM_Test_Verify_Event(0,
+ MM_SYM_LOOKUP_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Symbol Lookup Command: Name = '%s' Addr = %p");
}
-void Test_MM_LookupSymCmd_SymbolNameNull(void) {
- MM_LookupSymCmd_t LookupSymCmd;
- CFE_Status_t Result;
+void Test_MM_LookupSymCmd_SymbolNameNull(void)
+{
+ MM_LookupSymCmd_t LookupSymCmd;
+ CFE_Status_t Result;
- UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 0);
+ UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 0);
- /* Execute the function being tested */
- Result = MM_LookupSymCmd(&LookupSymCmd);
+ /* Execute the function being tested */
+ Result = MM_LookupSymCmd(&LookupSymCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_SYMNAME_NUL_ERR_EID, CFE_EVS_EventType_ERROR,
- "NUL (empty) string specified as symbol name");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMNAME_NUL_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "NUL (empty) string specified as symbol name");
}
-void Test_MM_LookupSymCmd_SymbolLookupError(void) {
- MM_LookupSymCmd_t LookupSymCmd;
- CFE_Status_t Result;
+void Test_MM_LookupSymCmd_SymbolLookupError(void)
+{
+ MM_LookupSymCmd_t LookupSymCmd;
+ CFE_Status_t Result;
- UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 1);
- UT_SetDefaultReturnValue(UT_KEY(OS_SymbolLookup), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 1);
+ UT_SetDefaultReturnValue(UT_KEY(OS_SymbolLookup), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_LookupSymCmd(&LookupSymCmd);
+ /* Execute the function being tested */
+ Result = MM_LookupSymCmd(&LookupSymCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'");
}
-void Test_MM_SymTblToFileCmd_Nominal(void) {
- MM_SymTblToFileCmd_t SymTblToFileCmd;
- CFE_Status_t Result;
- char FileName[9] = {"filename"};
+void Test_MM_SymTblToFileCmd_Nominal(void)
+{
+ MM_SymTblToFileCmd_t SymTblToFileCmd;
+ CFE_Status_t Result;
+ char FileName[9] = { "filename" };
- UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 1);
- UT_SetDefaultReturnValue(UT_KEY(OS_SymbolTableDump), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 1);
+ UT_SetDefaultReturnValue(UT_KEY(OS_SymbolTableDump), OS_SUCCESS);
- UT_SetHandlerFunction(UT_KEY(CFE_SB_MessageStringGet),
- UT_Handler_CFE_SB_MessageStringGet, FileName);
+ UT_SetHandlerFunction(UT_KEY(CFE_SB_MessageStringGet), UT_Handler_CFE_SB_MessageStringGet, FileName);
- /* Execute the function being tested */
- Result = MM_SymTblToFileCmd(&SymTblToFileCmd);
+ /* Execute the function being tested */
+ Result = MM_SymTblToFileCmd(&SymTblToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction,
- MM_LastAction_SYMTBL_SAVE);
- UtAssert_StrnCmp(MM_AppData.HkTlm.Payload.FileName, FileName,
- sizeof(FileName), "Expected '%s' == '%s",
- MM_AppData.HkTlm.Payload.FileName, FileName);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_SYMTBL_SAVE);
+ UtAssert_StrnCmp(MM_AppData.HkTlm.Payload.FileName,
+ FileName,
+ sizeof(FileName),
+ "Expected '%s' == '%s",
+ MM_AppData.HkTlm.Payload.FileName,
+ FileName);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_SYMTBL_TO_FILE_INF_EID,
- CFE_EVS_EventType_INFORMATION,
- "Symbol Table Dump to File Started: Name = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMTBL_TO_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Symbol Table Dump to File Started: Name = '%s'");
}
-void Test_MM_SymTblToFileCmd_SymbolFilenameNull(void) {
- MM_SymTblToFileCmd_t SymTblToFileCmd;
- CFE_Status_t Result;
+void Test_MM_SymTblToFileCmd_SymbolFilenameNull(void)
+{
+ MM_SymTblToFileCmd_t SymTblToFileCmd;
+ CFE_Status_t Result;
- UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 0);
+ UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 0);
- /* Execute the function being tested */
- Result = MM_SymTblToFileCmd(&SymTblToFileCmd);
+ /* Execute the function being tested */
+ Result = MM_SymTblToFileCmd(&SymTblToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_SYMFILENAME_NUL_ERR_EID, CFE_EVS_EventType_ERROR,
- "NUL (empty) string specified as symbol dump file name");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMFILENAME_NUL_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "NUL (empty) string specified as symbol dump file name");
}
-void Test_MM_SymTblToFileCmd_SymbolTableDumpError(void) {
- MM_SymTblToFileCmd_t SymTblToFileCmd;
- CFE_Status_t Result;
+void Test_MM_SymTblToFileCmd_SymbolTableDumpError(void)
+{
+ MM_SymTblToFileCmd_t SymTblToFileCmd;
+ CFE_Status_t Result;
- UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 1);
- UT_SetDefaultReturnValue(UT_KEY(OS_SymbolTableDump), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(OS_strnlen), 1);
+ UT_SetDefaultReturnValue(UT_KEY(OS_SymbolTableDump), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_SymTblToFileCmd(&SymTblToFileCmd);
+ /* Execute the function being tested */
+ Result = MM_SymTblToFileCmd(&SymTblToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_SYMTBL_TO_FILE_FAIL_ERR_EID, CFE_EVS_EventType_ERROR,
- "Error dumping symbol table, OS_Status= 0x%X, File='%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMTBL_TO_FILE_FAIL_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Error dumping symbol table, OS_Status= 0x%X, File='%s'");
}
-void Test_MM_EepromWriteEnaCmd_Nominal(void) {
- MM_EepromWriteEnaCmd_t EepromWriteEnaCmd;
- CFE_Status_t Result;
+void Test_MM_EepromWriteEnaCmd_Nominal(void)
+{
+ MM_EepromWriteEnaCmd_t EepromWriteEnaCmd;
+ CFE_Status_t Result;
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_EepromWriteEnable), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_EepromWriteEnable), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_EepromWriteEnaCmd(&EepromWriteEnaCmd);
+ /* Execute the function being tested */
+ Result = MM_EepromWriteEnaCmd(&EepromWriteEnaCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction,
- MM_LastAction_EEPROMWRITE_ENA);
- UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType,
- MM_MemType_EEPROM);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_EEPROMWRITE_ENA);
+ UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType, MM_MemType_EEPROM);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_EEPROM_WRITE_ENA_INF_EID,
- CFE_EVS_EventType_INFORMATION,
- "EEPROM bank %d write enabled, cFE_Status= 0x%X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_EEPROM_WRITE_ENA_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "EEPROM bank %d write enabled, cFE_Status= 0x%X");
}
-void Test_MM_EepromWriteEnaCmd_Error(void) {
- MM_EepromWriteEnaCmd_t EepromWriteEnaCmd;
- CFE_Status_t Result;
+void Test_MM_EepromWriteEnaCmd_Error(void)
+{
+ MM_EepromWriteEnaCmd_t EepromWriteEnaCmd;
+ CFE_Status_t Result;
- /* Set to generate error message MM_EEPROM_WRITE_ENA_ERR_EID */
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_EepromWriteEnable),
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_EEPROM_WRITE_ENA_ERR_EID */
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_EepromWriteEnable), CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_EepromWriteEnaCmd(&EepromWriteEnaCmd);
+ /* Execute the function being tested */
+ Result = MM_EepromWriteEnaCmd(&EepromWriteEnaCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_EEPROM_WRITE_ENA_ERR_EID, CFE_EVS_EventType_ERROR,
- "Error requesting EEPROM bank %d write enable, cFE_Status= 0x%X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_EEPROM_WRITE_ENA_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Error requesting EEPROM bank %d write enable, cFE_Status= 0x%X");
}
-void Test_MM_EepromWriteDisCmd_Nominal(void) {
- MM_EepromWriteDisCmd_t EepromWriteDisCmd;
- CFE_Status_t Result;
+void Test_MM_EepromWriteDisCmd_Nominal(void)
+{
+ MM_EepromWriteDisCmd_t EepromWriteDisCmd;
+ CFE_Status_t Result;
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_EepromWriteDisable), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_EepromWriteDisable), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_EepromWriteDisCmd(&EepromWriteDisCmd);
+ /* Execute the function being tested */
+ Result = MM_EepromWriteDisCmd(&EepromWriteDisCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction,
- MM_LastAction_EEPROMWRITE_DIS);
- UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType,
- MM_MemType_EEPROM);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_EEPROMWRITE_DIS);
+ UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType, MM_MemType_EEPROM);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_EEPROM_WRITE_DIS_INF_EID,
- CFE_EVS_EventType_INFORMATION,
- "EEPROM bank %d write disabled, cFE_Status= 0x%X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_EEPROM_WRITE_DIS_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "EEPROM bank %d write disabled, cFE_Status= 0x%X");
}
-void Test_MM_EepromWriteDisCmd_Error(void) {
- MM_EepromWriteDisCmd_t EepromWriteDisCmd;
- CFE_Status_t Result;
+void Test_MM_EepromWriteDisCmd_Error(void)
+{
+ MM_EepromWriteDisCmd_t EepromWriteDisCmd;
+ CFE_Status_t Result;
- /* Set to generate error message MM_EEPROM_WRITE_DISA_ERR_EID */
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_EepromWriteDisable),
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_EEPROM_WRITE_DISA_ERR_EID */
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_EepromWriteDisable), CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_EepromWriteDisCmd(&EepromWriteDisCmd);
+ /* Execute the function being tested */
+ Result = MM_EepromWriteDisCmd(&EepromWriteDisCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_EEPROM_WRITE_DIS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Error requesting EEPROM bank %d write disable, cFE_Status= 0x%X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_EEPROM_WRITE_DIS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Error requesting EEPROM bank %d write disable, cFE_Status= 0x%X");
}
-void Test_MM_PokeCmd_EEPROM(void) {
- CFE_Status_t Result;
- MM_PokeCmd_t PokeCmd;
+void Test_MM_PokeCmd_EEPROM(void)
+{
+ CFE_Status_t Result;
+ MM_PokeCmd_t PokeCmd;
- memset(&(PokeCmd.Payload), 0, sizeof(MM_PokeCmd_Payload_t));
+ memset(&(PokeCmd.Payload), 0, sizeof(MM_PokeCmd_Payload_t));
- PokeCmd.Payload.MemType = MM_MemType_EEPROM;
+ PokeCmd.Payload.MemType = MM_MemType_EEPROM;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_PokeEeprom), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_PokeEeprom), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_PokeCmd(&PokeCmd);
+ /* Execute the function being tested */
+ Result = MM_PokeCmd(&PokeCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_PokeEeprom, 1);
+ UtAssert_STUB_COUNT(MM_PokeEeprom, 1);
- /* Event issued in MM_PokeMem but wouldn't show up here */
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ /* Event issued in MM_PokeMem but wouldn't show up here */
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_PokeCmd_NonEEPROM(void) {
- CFE_Status_t Result;
- MM_PokeCmd_t PokeCmd;
+void Test_MM_PokeCmd_NonEEPROM(void)
+{
+ CFE_Status_t Result;
+ MM_PokeCmd_t PokeCmd;
- memset(&(PokeCmd.Payload), 0, sizeof(MM_PokeCmd_Payload_t));
+ memset(&(PokeCmd.Payload), 0, sizeof(MM_PokeCmd_Payload_t));
- PokeCmd.Payload.MemType = MM_MemType_RAM;
+ PokeCmd.Payload.MemType = MM_MemType_RAM;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_PokeMem), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_PokeMem), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_PokeCmd(&PokeCmd);
+ /* Execute the function being tested */
+ Result = MM_PokeCmd(&PokeCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_PokeMem, 1);
+ UtAssert_STUB_COUNT(MM_PokeMem, 1);
- /* Event issued in MM_PokeMem but wouldn't show up here */
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ /* Event issued in MM_PokeMem but wouldn't show up here */
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_PokeCmd_SymNameError(void) {
- CFE_Status_t Result;
- MM_PokeCmd_t PokeCmd;
+void Test_MM_PokeCmd_SymNameError(void)
+{
+ CFE_Status_t Result;
+ MM_PokeCmd_t PokeCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_PokeCmd(&PokeCmd);
+ /* Execute the function being tested */
+ Result = MM_PokeCmd(&PokeCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'");
}
-void Test_MM_PokeCmd_NoVerifyPeekPokeParams(void) {
- CFE_Status_t Result;
- MM_PokeCmd_t PokeCmd;
+void Test_MM_PokeCmd_NoVerifyPeekPokeParams(void)
+{
+ CFE_Status_t Result;
+ MM_PokeCmd_t PokeCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_PokeCmd(&PokeCmd);
+ /* Execute the function being tested */
+ Result = MM_PokeCmd(&PokeCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_PokeCmd_PokeErr(void) {
- CFE_Status_t Status;
- MM_PokeCmd_t PokeCmd;
+void Test_MM_PokeCmd_PokeErr(void)
+{
+ CFE_Status_t Status;
+ MM_PokeCmd_t PokeCmd;
- memset(&(PokeCmd.Payload), 0, sizeof(MM_PokeCmd_Payload_t));
- PokeCmd.Payload.MemType = MM_MemType_EEPROM;
+ memset(&(PokeCmd.Payload), 0, sizeof(MM_PokeCmd_Payload_t));
+ PokeCmd.Payload.MemType = MM_MemType_EEPROM;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_PokeEeprom),
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_PokeEeprom), CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Status = MM_PokeCmd(&PokeCmd);
+ /* Execute the function being tested */
+ Status = MM_PokeCmd(&PokeCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Status, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Status, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_PokeEeprom, 1);
+ UtAssert_STUB_COUNT(MM_PokeEeprom, 1);
- /* Event issued in MM_PokeMem but wouldn't show up here */
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ /* Event issued in MM_PokeMem but wouldn't show up here */
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_LoadMemWIDCmd_Nominal(void) {
- CFE_Status_t Result;
- MM_LoadMemWIDCmd_t LoadMemWIDCmd;
- uint32 ComputedCRC;
- cpuaddr SymAddr;
+void Test_MM_LoadMemWIDCmd_Nominal(void)
+{
+ CFE_Status_t Result;
+ MM_LoadMemWIDCmd_t LoadMemWIDCmd;
+ uint32 ComputedCRC;
+ cpuaddr SymAddr;
- memset(&(LoadMemWIDCmd.Payload), 0, sizeof(MM_LoadMemWIDCmd_Payload_t));
- memset(LoadMemWIDCmd.Payload.DataArray, 1,
- sizeof(uint8) * MM_INTERFACE_MAX_UNINTERRUPTIBLE_DATA);
+ memset(&(LoadMemWIDCmd.Payload), 0, sizeof(MM_LoadMemWIDCmd_Payload_t));
+ memset(LoadMemWIDCmd.Payload.DataArray, 1, sizeof(uint8) * MM_INTERFACE_MAX_UNINTERRUPTIBLE_DATA);
- ComputedCRC = 0x42;
- SymAddr = (cpuaddr)&ComputedCRC;
- LoadMemWIDCmd.Payload.Crc = ComputedCRC;
- LoadMemWIDCmd.Payload.NumOfBytes = 1;
+ ComputedCRC = 0x42;
+ SymAddr = (cpuaddr)&ComputedCRC;
+ LoadMemWIDCmd.Payload.Crc = ComputedCRC;
+ LoadMemWIDCmd.Payload.NumOfBytes = 1;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(CFE_ES_CalculateCRC), ComputedCRC);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(CFE_ES_CalculateCRC), ComputedCRC);
- UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr,
- &SymAddr);
+ UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr, &SymAddr);
- /* Execute the function being tested */
- Result = MM_LoadMemWIDCmd(&LoadMemWIDCmd);
+ /* Execute the function being tested */
+ Result = MM_LoadMemWIDCmd(&LoadMemWIDCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction,
- MM_LastAction_LOAD_WID);
- UtAssert_ADDRESS_EQ(
- CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
- UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType,
- MM_MemType_RAM);
- UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed,
- LoadMemWIDCmd.Payload.NumOfBytes);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_LOAD_WID);
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
+ UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType, MM_MemType_RAM);
+ UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed, LoadMemWIDCmd.Payload.NumOfBytes);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_LOAD_WID_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Load Memory WID Command: Wrote %d bytes to address: %p");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_LOAD_WID_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Load Memory WID Command: Wrote %d bytes to address: %p");
}
-void Test_MM_LoadMemWIDCmd_CRCError(void) {
- CFE_Status_t Result;
- MM_LoadMemWIDCmd_t LoadMemWIDCmd;
- uint32 ComputedCRC;
+void Test_MM_LoadMemWIDCmd_CRCError(void)
+{
+ CFE_Status_t Result;
+ MM_LoadMemWIDCmd_t LoadMemWIDCmd;
+ uint32 ComputedCRC;
- memset(&(LoadMemWIDCmd.Payload), 0, sizeof(MM_LoadMemWIDCmd_Payload_t));
+ memset(&(LoadMemWIDCmd.Payload), 0, sizeof(MM_LoadMemWIDCmd_Payload_t));
- ComputedCRC = 0x42;
- LoadMemWIDCmd.Payload.Crc = ComputedCRC + 1;
+ ComputedCRC = 0x42;
+ LoadMemWIDCmd.Payload.Crc = ComputedCRC + 1;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(CFE_ES_CalculateCRC), ComputedCRC);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(CFE_ES_CalculateCRC), ComputedCRC);
- /* Execute the function being tested */
- Result = MM_LoadMemWIDCmd(&LoadMemWIDCmd);
+ /* Execute the function being tested */
+ Result = MM_LoadMemWIDCmd(&LoadMemWIDCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_LOAD_WID_CRC_ERR_EID, CFE_EVS_EventType_ERROR,
- "Interrupts Disabled Load CRC failure: Expected = 0x%X "
- "Calculated = 0x%X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_LOAD_WID_CRC_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Interrupts Disabled Load CRC failure: Expected = 0x%X "
+ "Calculated = 0x%X");
}
-void Test_MM_LoadMemWIDCmd_SymNameErr(void) {
- CFE_Status_t Result;
- MM_LoadMemWIDCmd_t LoadMemWIDCmd;
+void Test_MM_LoadMemWIDCmd_SymNameErr(void)
+{
+ CFE_Status_t Result;
+ MM_LoadMemWIDCmd_t LoadMemWIDCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_LoadMemWIDCmd(&LoadMemWIDCmd);
+ /* Execute the function being tested */
+ Result = MM_LoadMemWIDCmd(&LoadMemWIDCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'");
}
-void Test_MM_LoadMemWIDCmd_NoVerifyLoadWIDParams(void) {
- CFE_Status_t Result;
- MM_LoadMemWIDCmd_t LoadMemWIDCmd;
+void Test_MM_LoadMemWIDCmd_NoVerifyLoadWIDParams(void)
+{
+ CFE_Status_t Result;
+ MM_LoadMemWIDCmd_t LoadMemWIDCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_ERROR);
- /* Execute the function being tested */
- Result = MM_LoadMemWIDCmd(&LoadMemWIDCmd);
+ /* Execute the function being tested */
+ Result = MM_LoadMemWIDCmd(&LoadMemWIDCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
-}
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+}
+
+void Test_MM_LoadMemFromFileCmd_RAM(void)
+{
+ CFE_Status_t Result;
+ MM_LoadDumpFileHeader_t Hdr;
+ uint32 ComputedCrc;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-void Test_MM_LoadMemFromFileCmd_RAM(void) {
- CFE_Status_t Result;
- MM_LoadDumpFileHeader_t Hdr;
- uint32 ComputedCrc;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
-
- ComputedCrc = 99;
- Hdr.Crc = ComputedCrc;
- Hdr.MemType = MM_MemType_RAM;
-
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_LoadMemFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
-
- UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile),
- UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
- UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders),
- UT_Handler_MM_ReadFileHeaders, &Hdr);
+ memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
+
+ ComputedCrc = 99;
+ Hdr.Crc = ComputedCrc;
+ Hdr.MemType = MM_MemType_RAM;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_LoadMemFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+
+ UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile), UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
+ UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders), UT_Handler_MM_ReadFileHeaders, &Hdr);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_LD_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Load Memory From File Command: Loaded %d bytes to "
+ "address %p from file '%s'");
+}
+
+void Test_MM_LoadMemFromFileCmd_BadType(void)
+{
+ CFE_Status_t Result;
+ MM_LoadDumpFileHeader_t Hdr;
+ uint32 ComputedCrc;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
+
+ ComputedCrc = 99;
+ Hdr.Crc = ComputedCrc;
+ Hdr.MemType = 42;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+
+ UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile), UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
+ UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders), UT_Handler_MM_ReadFileHeaders, &Hdr);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+}
+
+void Test_MM_LoadMemFromFileCmd_EEPROM(void)
+{
+ CFE_Status_t Result;
+ MM_LoadDumpFileHeader_t Hdr;
+ uint32 ComputedCrc;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
+
+ ComputedCrc = 99;
+ Hdr.Crc = ComputedCrc;
+ Hdr.MemType = MM_MemType_EEPROM;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_LoadMemFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+
+ UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile), UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
+ UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders), UT_Handler_MM_ReadFileHeaders, &Hdr);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_LD_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Load Memory From File Command: Loaded %d bytes to "
+ "address %p from file '%s'");
+}
+
+void Test_MM_LoadMemFromFileCmd_MEM32(void)
+{
+ CFE_Status_t Result;
+ MM_LoadDumpFileHeader_t Hdr;
+ uint32 ComputedCrc;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
+
+ ComputedCrc = 99;
+ Hdr.Crc = ComputedCrc;
+ Hdr.MemType = MM_MemType_MEM32;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_LoadMem32FromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+
+ UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile), UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
+ UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders), UT_Handler_MM_ReadFileHeaders, &Hdr);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(MM_LoadMem32FromFile, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_LD_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Load Memory From File Command: Loaded %d bytes to "
+ "address %p from file '%s'");
+}
+
+void Test_MM_LoadMemFromFileCmd_MEM32Invalid(void)
+{
+ CFE_Status_t Result;
+ MM_LoadDumpFileHeader_t Hdr;
+ uint32 ComputedCrc;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
+
+ ComputedCrc = 99;
+ Hdr.Crc = ComputedCrc;
+ Hdr.MemType = MM_MemType_MEM32;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_LoadMem32FromFile), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+
+ UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile), UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
+ UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders), UT_Handler_MM_ReadFileHeaders, &Hdr);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
+
+ UtAssert_STUB_COUNT(MM_LoadMem32FromFile, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+}
+
+void Test_MM_LoadMemFromFileCmd_MEM16(void)
+{
+ CFE_Status_t Result;
+ MM_LoadDumpFileHeader_t Hdr;
+ uint32 ComputedCrc;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
+
+ ComputedCrc = 99;
+ Hdr.Crc = ComputedCrc;
+ Hdr.MemType = MM_MemType_MEM16;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_LoadMem16FromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+
+ UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile), UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
+ UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders), UT_Handler_MM_ReadFileHeaders, &Hdr);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_LD_MEM_FILE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Load Memory From File Command: Loaded %d bytes to "
- "address %p from file '%s'");
-}
-
-void Test_MM_LoadMemFromFileCmd_BadType(void) {
- CFE_Status_t Result;
- MM_LoadDumpFileHeader_t Hdr;
- uint32 ComputedCrc;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
-
- ComputedCrc = 99;
- Hdr.Crc = ComputedCrc;
- Hdr.MemType = 42;
-
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
-
- UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile),
- UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
- UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders),
- UT_Handler_MM_ReadFileHeaders, &Hdr);
-
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
-}
-
-void Test_MM_LoadMemFromFileCmd_EEPROM(void) {
- CFE_Status_t Result;
- MM_LoadDumpFileHeader_t Hdr;
- uint32 ComputedCrc;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
-
- ComputedCrc = 99;
- Hdr.Crc = ComputedCrc;
- Hdr.MemType = MM_MemType_EEPROM;
-
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_LoadMemFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
-
- UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile),
- UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
- UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders),
- UT_Handler_MM_ReadFileHeaders, &Hdr);
-
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_LD_MEM_FILE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Load Memory From File Command: Loaded %d bytes to "
- "address %p from file '%s'");
-}
-
-void Test_MM_LoadMemFromFileCmd_MEM32(void) {
- CFE_Status_t Result;
- MM_LoadDumpFileHeader_t Hdr;
- uint32 ComputedCrc;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
-
- ComputedCrc = 99;
- Hdr.Crc = ComputedCrc;
- Hdr.MemType = MM_MemType_MEM32;
-
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_LoadMem32FromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
-
- UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile),
- UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
- UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders),
- UT_Handler_MM_ReadFileHeaders, &Hdr);
-
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(MM_LoadMem32FromFile, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_LD_MEM_FILE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Load Memory From File Command: Loaded %d bytes to "
- "address %p from file '%s'");
-}
-
-void Test_MM_LoadMemFromFileCmd_MEM32Invalid(void) {
- CFE_Status_t Result;
- MM_LoadDumpFileHeader_t Hdr;
- uint32 ComputedCrc;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
-
- ComputedCrc = 99;
- Hdr.Crc = ComputedCrc;
- Hdr.MemType = MM_MemType_MEM32;
-
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_LoadMem32FromFile), OS_ERROR);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
-
- UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile),
- UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
- UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders),
- UT_Handler_MM_ReadFileHeaders, &Hdr);
-
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
-
- UtAssert_STUB_COUNT(MM_LoadMem32FromFile, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
-}
-
-void Test_MM_LoadMemFromFileCmd_MEM16(void) {
- CFE_Status_t Result;
- MM_LoadDumpFileHeader_t Hdr;
- uint32 ComputedCrc;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
-
- ComputedCrc = 99;
- Hdr.Crc = ComputedCrc;
- Hdr.MemType = MM_MemType_MEM16;
-
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_LoadMem16FromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
-
- UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile),
- UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
- UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders),
- UT_Handler_MM_ReadFileHeaders, &Hdr);
-
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_LoadMem16FromFile, 1);
+ UtAssert_STUB_COUNT(MM_LoadMem16FromFile, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_LD_MEM_FILE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Load Memory From File Command: Loaded %d bytes to "
- "address %p from file '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_LD_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Load Memory From File Command: Loaded %d bytes to "
+ "address %p from file '%s'");
}
-void Test_MM_LoadMemFromFileCmd_MEM8(void) {
- CFE_Status_t Result;
- MM_LoadDumpFileHeader_t Hdr;
- uint32 ComputedCrc;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
-
- ComputedCrc = 99;
- Hdr.Crc = ComputedCrc;
- Hdr.MemType = MM_MemType_MEM8;
+void Test_MM_LoadMemFromFileCmd_MEM8(void)
+{
+ CFE_Status_t Result;
+ MM_LoadDumpFileHeader_t Hdr;
+ uint32 ComputedCrc;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_LoadMem8FromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
-
- UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile),
- UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
- UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders),
- UT_Handler_MM_ReadFileHeaders, &Hdr);
-
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(MM_LoadMem8FromFile, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_LD_MEM_FILE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Load Memory From File Command: Loaded %d bytes to "
- "address %p from file '%s'");
-}
-
-void Test_MM_LoadMemFromFileCmd_NoReadFileHeaders(void) {
- CFE_Status_t Result;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_ERROR);
-
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
-}
-
-void Test_MM_LoadMemFromFileCmd_NoVerifyLoadFileSize(void) {
- CFE_Status_t Result;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_ERR_INVALID_SIZE);
-
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
-}
-
-void Test_MM_LoadMemFromFileCmd_lseekError(void) {
- CFE_Status_t Result;
- MM_LoadDumpFileHeader_t Hdr;
- uint32 ComputedCrc;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- ComputedCrc = 99;
- Hdr.Crc = ComputedCrc;
-
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek), OS_ERROR);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
-
- UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile),
- UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
- UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders),
- UT_Handler_MM_ReadFileHeaders, &Hdr);
-
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_LOAD_FILE_CRC_ERR_EID, CFE_EVS_EventType_ERROR,
- "Load file CRC failure: Expected = 0x%X Calculated = 0x%X File = '%s'");
-}
-
-void Test_MM_LoadMemFromFileCmd_LoadParamsError(void) {
- CFE_Status_t Result;
- MM_LoadDumpFileHeader_t Hdr;
- uint32 ComputedCrc;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- ComputedCrc = 99;
- Hdr.Crc = ComputedCrc;
-
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams),
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
-
- UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile),
- UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
- UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders),
- UT_Handler_MM_ReadFileHeaders, &Hdr);
-
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_FILE_LOAD_PARAMS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Load file failed parameters check: File = '%s'");
-}
-
-void Test_MM_LoadMemFromFileCmd_SymNameError(void) {
- CFE_Status_t Result;
- MM_LoadDumpFileHeader_t Hdr;
- uint32 ComputedCrc;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- ComputedCrc = 99;
- Hdr.Crc = ComputedCrc;
-
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
-
- UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile),
- UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
- UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders),
- UT_Handler_MM_ReadFileHeaders, &Hdr);
-
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'");
-}
-
-void Test_MM_LoadMemFromFileCmd_LoadFileCRCError(void) {
- CFE_Status_t Result;
- MM_LoadDumpFileHeader_t Hdr;
- uint32 ComputedCrc;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
-
- ComputedCrc = 99;
- Hdr.Crc = ComputedCrc + 1;
+ memset(&Hdr, 0, sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+ ComputedCrc = 99;
+ Hdr.Crc = ComputedCrc;
+ Hdr.MemType = MM_MemType_MEM8;
- UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile),
- UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
- UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders),
- UT_Handler_MM_ReadFileHeaders, &Hdr);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_LoadMem8FromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+ UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile), UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
+ UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders), UT_Handler_MM_ReadFileHeaders, &Hdr);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_LOAD_FILE_CRC_ERR_EID, CFE_EVS_EventType_ERROR,
- "Load file CRC failure: Expected = 0x%X Calculated = 0x%X File = '%s'");
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(MM_LoadMem8FromFile, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_LD_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Load Memory From File Command: Loaded %d bytes to "
+ "address %p from file '%s'");
}
-void Test_MM_LoadMemFromFileCmd_ComputeCRCError(void) {
- CFE_Status_t Result;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+void Test_MM_LoadMemFromFileCmd_NoReadFileHeaders(void)
+{
+ CFE_Status_t Result;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_ERROR);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+}
+
+void Test_MM_LoadMemFromFileCmd_NoVerifyLoadFileSize(void)
+{
+ CFE_Status_t Result;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_ERR_INVALID_SIZE);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+}
+
+void Test_MM_LoadMemFromFileCmd_lseekError(void)
+{
+ CFE_Status_t Result;
+ MM_LoadDumpFileHeader_t Hdr;
+ uint32 ComputedCrc;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ ComputedCrc = 99;
+ Hdr.Crc = ComputedCrc;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+
+ UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile), UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
+ UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders), UT_Handler_MM_ReadFileHeaders, &Hdr);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_LOAD_FILE_CRC_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Load file CRC failure: Expected = 0x%X Calculated = 0x%X File = '%s'");
+}
+
+void Test_MM_LoadMemFromFileCmd_LoadParamsError(void)
+{
+ CFE_Status_t Result;
+ MM_LoadDumpFileHeader_t Hdr;
+ uint32 ComputedCrc;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ ComputedCrc = 99;
+ Hdr.Crc = ComputedCrc;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+
+ UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile), UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
+ UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders), UT_Handler_MM_ReadFileHeaders, &Hdr);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_FILE_LOAD_PARAMS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Load file failed parameters check: File = '%s'");
+}
+
+void Test_MM_LoadMemFromFileCmd_SymNameError(void)
+{
+ CFE_Status_t Result;
+ MM_LoadDumpFileHeader_t Hdr;
+ uint32 ComputedCrc;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ ComputedCrc = 99;
+ Hdr.Crc = ComputedCrc;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+
+ UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile), UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
+ UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders), UT_Handler_MM_ReadFileHeaders, &Hdr);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'");
+}
+
+void Test_MM_LoadMemFromFileCmd_LoadFileCRCError(void)
+{
+ CFE_Status_t Result;
+ MM_LoadDumpFileHeader_t Hdr;
+ uint32 ComputedCrc;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ ComputedCrc = 99;
+ Hdr.Crc = ComputedCrc + 1;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+
+ UT_SetHandlerFunction(UT_KEY(MM_ComputeCRCFromFile), UT_Handler_MM_ComputeCRCFromFile, &ComputedCrc);
+ UT_SetHandlerFunction(UT_KEY(MM_ReadFileHeaders), UT_Handler_MM_ReadFileHeaders, &Hdr);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_ERROR);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_LOAD_FILE_CRC_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Load file CRC failure: Expected = 0x%X Calculated = 0x%X File = '%s'");
+}
+
+void Test_MM_LoadMemFromFileCmd_ComputeCRCError(void)
+{
+ CFE_Status_t Result;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadFileSize), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_COMPUTECRCFROMFILE_ERR_EID, CFE_EVS_EventType_ERROR,
- "MM_ComputeCRCFromFile error received: RC = 0x%08X File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_COMPUTECRCFROMFILE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "MM_ComputeCRCFromFile error received: RC = 0x%08X File = '%s'");
}
-void Test_MM_LoadMemFromFileCmd_CloseError(void) {
- CFE_Status_t Result;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+void Test_MM_LoadMemFromFileCmd_CloseError(void)
+{
+ CFE_Status_t Result;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- /* Skip most of the function since it's tested elsewhere */
- UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_ERROR);
+ /* Skip most of the function since it's tested elsewhere */
+ UT_SetDefaultReturnValue(UT_KEY(MM_ReadFileHeaders), OS_ERROR);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 2);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 2);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_CLOSE_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_close error received: RC = 0x%08X File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_CLOSE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_close error received: RC = 0x%08X File = '%s'");
}
-void Test_MM_LoadMemFromFileCmd_OpenError(void) {
- CFE_Status_t Result;
- MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
+void Test_MM_LoadMemFromFileCmd_OpenError(void)
+{
+ CFE_Status_t Result;
+ MM_LoadMemFromFileCmd_t LoadMemFromFileCmd;
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFileCmd(&LoadMemFromFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_OPEN_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_OpenCreate error received: RC = %d File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_OPEN_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_OpenCreate error received: RC = %d File = '%s'");
}
-void Test_MM_FillMemCmd_RAM(void) {
- CFE_Status_t Result;
- MM_FillMemCmd_t FillMemCmd;
+void Test_MM_FillMemCmd_RAM(void)
+{
+ CFE_Status_t Result;
+ MM_FillMemCmd_t FillMemCmd;
- memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
+ memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
- FillMemCmd.Payload.MemType = MM_MemType_RAM;
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
+ FillMemCmd.Payload.MemType = MM_MemType_RAM;
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_FillMem), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_FillMem), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_FillMemCmd(&FillMemCmd);
+ /* Execute the function being tested */
+ Result = MM_FillMemCmd(&FillMemCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_FILL_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Fill Memory Command: Filled %d bytes at address: %p "
- "with pattern: 0x%08X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_FILL_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Fill Memory Command: Filled %d bytes at address: %p "
+ "with pattern: 0x%08X");
}
-void Test_MM_FillMemCmd_EEPROM(void) {
- CFE_Status_t Result;
- MM_FillMemCmd_t FillMemCmd;
+void Test_MM_FillMemCmd_EEPROM(void)
+{
+ CFE_Status_t Result;
+ MM_FillMemCmd_t FillMemCmd;
- memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
+ memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
- FillMemCmd.Payload.MemType = MM_MemType_EEPROM;
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
+ FillMemCmd.Payload.MemType = MM_MemType_EEPROM;
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_FillMem), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_FillMem), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_FillMemCmd(&FillMemCmd);
+ /* Execute the function being tested */
+ Result = MM_FillMemCmd(&FillMemCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_FILL_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Fill Memory Command: Filled %d bytes at address: %p "
- "with pattern: 0x%08X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_FILL_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Fill Memory Command: Filled %d bytes at address: %p "
+ "with pattern: 0x%08X");
}
-void Test_MM_FillMemCmd_MEM32(void) {
- CFE_Status_t Result;
- MM_FillMemCmd_t FillMemCmd;
+void Test_MM_FillMemCmd_MEM32(void)
+{
+ CFE_Status_t Result;
+ MM_FillMemCmd_t FillMemCmd;
- memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
+ memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
- FillMemCmd.Payload.MemType = MM_MemType_MEM32;
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
+ FillMemCmd.Payload.MemType = MM_MemType_MEM32;
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_FillMem32), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_FillMem32), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_FillMemCmd(&FillMemCmd);
+ /* Execute the function being tested */
+ Result = MM_FillMemCmd(&FillMemCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_FillMem32, 1);
+ UtAssert_STUB_COUNT(MM_FillMem32, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_FILL_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Fill Memory Command: Filled %d bytes at address: %p "
- "with pattern: 0x%08X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_FILL_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Fill Memory Command: Filled %d bytes at address: %p "
+ "with pattern: 0x%08X");
}
-void Test_MM_FillMemCmd_MEM16(void) {
- CFE_Status_t Result;
- MM_FillMemCmd_t FillMemCmd;
+void Test_MM_FillMemCmd_MEM16(void)
+{
+ CFE_Status_t Result;
+ MM_FillMemCmd_t FillMemCmd;
- memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
+ memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
- FillMemCmd.Payload.MemType = MM_MemType_MEM16;
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
+ FillMemCmd.Payload.MemType = MM_MemType_MEM16;
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_FillMem16), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_FillMem16), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_FillMemCmd(&FillMemCmd);
+ /* Execute the function being tested */
+ Result = MM_FillMemCmd(&FillMemCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_FillMem16, 1);
+ UtAssert_STUB_COUNT(MM_FillMem16, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_FILL_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Fill Memory Command: Filled %d bytes at address: %p "
- "with pattern: 0x%08X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_FILL_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Fill Memory Command: Filled %d bytes at address: %p "
+ "with pattern: 0x%08X");
}
-void Test_MM_FillMemCmd_MEM8(void) {
- CFE_Status_t Result;
- MM_FillMemCmd_t FillMemCmd;
+void Test_MM_FillMemCmd_MEM8(void)
+{
+ CFE_Status_t Result;
+ MM_FillMemCmd_t FillMemCmd;
- memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
+ memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
- FillMemCmd.Payload.MemType = MM_MemType_MEM8;
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
+ FillMemCmd.Payload.MemType = MM_MemType_MEM8;
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_FILL;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_FillMem8), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_FillMem8), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_FillMemCmd(&FillMemCmd);
+ /* Execute the function being tested */
+ Result = MM_FillMemCmd(&FillMemCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_FillMem8, 1);
+ UtAssert_STUB_COUNT(MM_FillMem8, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_FILL_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Fill Memory Command: Filled %d bytes at address: %p "
- "with pattern: 0x%08X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_FILL_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Fill Memory Command: Filled %d bytes at address: %p "
+ "with pattern: 0x%08X");
}
-void Test_MM_FillMemCmd_SymNameError(void) {
- CFE_Status_t Result;
- MM_FillMemCmd_t FillMemCmd;
+void Test_MM_FillMemCmd_SymNameError(void)
+{
+ CFE_Status_t Result;
+ MM_FillMemCmd_t FillMemCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_FillMemCmd(&FillMemCmd);
+ /* Execute the function being tested */
+ Result = MM_FillMemCmd(&FillMemCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'");
}
-void Test_MM_FillMemCmd_NoLastActionFill(void) {
- CFE_Status_t Result;
- MM_FillMemCmd_t FillMemCmd;
+void Test_MM_FillMemCmd_NoLastActionFill(void)
+{
+ CFE_Status_t Result;
+ MM_FillMemCmd_t FillMemCmd;
- memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
+ memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
- FillMemCmd.Payload.MemType = MM_MemType_RAM;
- MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_NOACTION;
+ FillMemCmd.Payload.MemType = MM_MemType_RAM;
+ MM_AppData.HkTlm.Payload.LastAction = MM_LastAction_NOACTION;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_FillMemCmd(&FillMemCmd);
+ /* Execute the function being tested */
+ Result = MM_FillMemCmd(&FillMemCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillMemCmd_NoVerifyLoadDump(void) {
- CFE_Status_t Result;
- MM_FillMemCmd_t FillMemCmd;
+void Test_MM_FillMemCmd_NoVerifyLoadDump(void)
+{
+ CFE_Status_t Result;
+ MM_FillMemCmd_t FillMemCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_ERROR);
- /* Execute the function being tested */
- Result = MM_FillMemCmd(&FillMemCmd);
+ /* Execute the function being tested */
+ Result = MM_FillMemCmd(&FillMemCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillMemCmd_BadType(void) {
- CFE_Status_t Result;
- MM_FillMemCmd_t FillMemCmd;
+void Test_MM_FillMemCmd_BadType(void)
+{
+ CFE_Status_t Result;
+ MM_FillMemCmd_t FillMemCmd;
- memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
+ memset(&(FillMemCmd.Payload), 0, sizeof(MM_FillMemCmd_Payload_t));
- FillMemCmd.Payload.MemType = 99;
- FillMemCmd.Payload.NumOfBytes = 1;
+ FillMemCmd.Payload.MemType = 99;
+ FillMemCmd.Payload.NumOfBytes = 1;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_FillMemCmd(&FillMemCmd);
+ /* Execute the function being tested */
+ Result = MM_FillMemCmd(&FillMemCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_PeekCmd_Nominal(void) {
- CFE_Status_t Result;
- MM_PeekCmd_t PeekCmd;
+void Test_MM_PeekCmd_Nominal(void)
+{
+ CFE_Status_t Result;
+ MM_PeekCmd_t PeekCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_PeekMem), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_PeekMem), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_PeekCmd(&PeekCmd);
+ /* Execute the function being tested */
+ Result = MM_PeekCmd(&PeekCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_PeekCmd_SymNameError(void) {
- CFE_Status_t Result;
- MM_PeekCmd_t PeekCmd;
+void Test_MM_PeekCmd_SymNameError(void)
+{
+ CFE_Status_t Result;
+ MM_PeekCmd_t PeekCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR_NAME_LENGTH);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR_NAME_LENGTH);
- /* Execute the function being tested */
- Result = MM_PeekCmd(&PeekCmd);
+ /* Execute the function being tested */
+ Result = MM_PeekCmd(&PeekCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'");
}
-void Test_MM_PeekCmd_NoVerifyPeekPokeParams(void) {
- CFE_Status_t Result;
- MM_PeekCmd_t PeekCmd;
+void Test_MM_PeekCmd_NoVerifyPeekPokeParams(void)
+{
+ CFE_Status_t Result;
+ MM_PeekCmd_t PeekCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_PeekCmd(&PeekCmd);
+ /* Execute the function being tested */
+ Result = MM_PeekCmd(&PeekCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_PeekCmd_PeekErr(void) {
- CFE_Status_t Result;
- MM_PeekCmd_t PeekCmd;
+void Test_MM_PeekCmd_PeekErr(void)
+{
+ CFE_Status_t Result;
+ MM_PeekCmd_t PeekCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_PeekMem), CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyPeekPokeParams), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_PeekMem), CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_PeekCmd(&PeekCmd);
+ /* Execute the function being tested */
+ Result = MM_PeekCmd(&PeekCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpMemToFileCmd_RAM(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- cpuaddr SymAddr;
-
- memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
-
- SymAddr = 0x42;
- DumpMemToFileCmd.Payload.MemType = MM_MemType_RAM;
- DumpMemToFileCmd.Payload.NumOfBytes = 50;
- strncpy(DumpMemToFileCmd.Payload.FileName, "filename_RAM",
- sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
-
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_DumpMemToFile), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- /* Second call to MM_WriteFileHeaders will also return OS_SUCCESS as set above
- */
-
- UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr,
- &SymAddr);
-
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
-
- /* Verify the results */
- UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction,
- MM_LastAction_DUMP_TO_FILE);
- UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType,
- DumpMemToFileCmd.Payload.MemType);
- UtAssert_ADDRESS_EQ(
- CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
- UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed,
- DumpMemToFileCmd.Payload.NumOfBytes);
- UtAssert_StrCmp(MM_AppData.HkTlm.Payload.FileName,
- DumpMemToFileCmd.Payload.FileName, "Expected '%s' == '%s",
- MM_AppData.HkTlm.Payload.FileName,
- DumpMemToFileCmd.Payload.FileName);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(MM_DumpMemToFile, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_DMP_MEM_FILE_INF_EID,
- CFE_EVS_EventType_INFORMATION,
- "Dump Memory To File Command: Dumped %d bytes from "
- "address %p to file '%s'");
-}
-
-void Test_MM_DumpMemToFileCmd_EEPROM(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- cpuaddr SymAddr;
-
- memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
-
- SymAddr = 0x42;
- DumpMemToFileCmd.Payload.MemType = MM_MemType_EEPROM;
- DumpMemToFileCmd.Payload.NumOfBytes = 40;
- strncpy(DumpMemToFileCmd.Payload.FileName, "filename_EEPROM",
- sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
-
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_DumpMemToFile), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- /* Second call to MM_WriteFileHeaders will also return OS_SUCCESS as set above
- */
-
- UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr,
- &SymAddr);
-
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
-
- /* Verify the results */
- UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction,
- MM_LastAction_DUMP_TO_FILE);
- UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType,
- DumpMemToFileCmd.Payload.MemType);
- UtAssert_ADDRESS_EQ(
- CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
- UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed,
- DumpMemToFileCmd.Payload.NumOfBytes);
- UtAssert_StrCmp(MM_AppData.HkTlm.Payload.FileName,
- DumpMemToFileCmd.Payload.FileName, "Expected '%s' == '%s",
- MM_AppData.HkTlm.Payload.FileName,
- DumpMemToFileCmd.Payload.FileName);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(MM_DumpMemToFile, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_DMP_MEM_FILE_INF_EID,
- CFE_EVS_EventType_INFORMATION,
- "Dump Memory To File Command: Dumped %d bytes from "
- "address %p to file '%s'");
-}
-
-void Test_MM_DumpMemToFileCmd_MEM32(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- cpuaddr SymAddr;
-
- memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
-
- SymAddr = 0x42;
- DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM32;
- DumpMemToFileCmd.Payload.NumOfBytes = 32;
- strncpy(DumpMemToFileCmd.Payload.FileName, "filename_32",
- sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
-
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem32ToFile), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- /* Second call to MM_WriteFileHeaders will also return OS_SUCCESS as set above
- */
-
- UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr,
- &SymAddr);
-
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
-
- /* Verify the results */
- UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction,
- MM_LastAction_DUMP_TO_FILE);
- UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType,
- DumpMemToFileCmd.Payload.MemType);
- UtAssert_ADDRESS_EQ(
- CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
- UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed,
- DumpMemToFileCmd.Payload.NumOfBytes);
- UtAssert_StrCmp(MM_AppData.HkTlm.Payload.FileName,
- DumpMemToFileCmd.Payload.FileName, "Expected '%s' == '%s",
- MM_AppData.HkTlm.Payload.FileName,
- DumpMemToFileCmd.Payload.FileName);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(MM_DumpMem32ToFile, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_DMP_MEM_FILE_INF_EID,
- CFE_EVS_EventType_INFORMATION,
- "Dump Memory To File Command: Dumped %d bytes from "
- "address %p to file '%s'");
-}
-
-void Test_MM_DumpMemToFileCmd_MEM16(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- cpuaddr SymAddr;
-
- memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
-
- SymAddr = 0x42;
- DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM16;
- DumpMemToFileCmd.Payload.NumOfBytes = 16;
- strncpy(DumpMemToFileCmd.Payload.FileName, "filename_16",
- sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
-
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem16ToFile), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- /* Second call to MM_WriteFileHeaders will also return OS_SUCCESS as set above
- */
-
- UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr,
- &SymAddr);
-
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
-
- /* Verify the results */
- UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction,
- MM_LastAction_DUMP_TO_FILE);
- UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType,
- DumpMemToFileCmd.Payload.MemType);
- UtAssert_ADDRESS_EQ(
- CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
- UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed,
- DumpMemToFileCmd.Payload.NumOfBytes);
- UtAssert_StrCmp(MM_AppData.HkTlm.Payload.FileName,
- DumpMemToFileCmd.Payload.FileName, "Expected '%s' == '%s",
- MM_AppData.HkTlm.Payload.FileName,
- DumpMemToFileCmd.Payload.FileName);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(MM_DumpMem16ToFile, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_DMP_MEM_FILE_INF_EID,
- CFE_EVS_EventType_INFORMATION,
- "Dump Memory To File Command: Dumped %d bytes from "
- "address %p to file '%s'");
-}
-
-void Test_MM_DumpMemToFileCmd_MEM8(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- cpuaddr SymAddr;
-
- memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
-
- SymAddr = 0x42;
- DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM8;
- DumpMemToFileCmd.Payload.NumOfBytes = 8;
- strncpy(DumpMemToFileCmd.Payload.FileName, "filename_8",
- sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
-
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem8ToFile), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- /* Second call to MM_WriteFileHeaders will also return OS_SUCCESS as set above
- */
-
- UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr,
- &SymAddr);
-
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
-
- /* Verify the results */
- UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction,
- MM_LastAction_DUMP_TO_FILE);
- UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType,
- DumpMemToFileCmd.Payload.MemType);
- UtAssert_ADDRESS_EQ(
- CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
- UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed,
- DumpMemToFileCmd.Payload.NumOfBytes);
- UtAssert_StrCmp(MM_AppData.HkTlm.Payload.FileName,
- DumpMemToFileCmd.Payload.FileName, "Expected '%s' == '%s",
- MM_AppData.HkTlm.Payload.FileName,
- DumpMemToFileCmd.Payload.FileName);
-
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(MM_DumpMem8ToFile, 1);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_DMP_MEM_FILE_INF_EID,
- CFE_EVS_EventType_INFORMATION,
- "Dump Memory To File Command: Dumped %d bytes from "
- "address %p to file '%s'");
-}
-
-void Test_MM_DumpMemToFileCmd_ComputeCRCError(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- MM_LoadDumpFileHeader_t MMFileHeader;
-
- memset(&MMFileHeader, 0, sizeof(MM_LoadDumpFileHeader_t));
-
- MMFileHeader.MemType = MM_MemType_RAM;
-
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_DumpMemToFile), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
-
- UT_SetHandlerFunction(UT_KEY(MM_WriteFileHeaders),
- UT_Handler_MM_WriteFileHeaders, &MMFileHeader);
-
- /* Set to generate error message MM_COMPUTECRCFROMFILE_ERR_EID */
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_ERROR);
+void Test_MM_DumpMemToFileCmd_RAM(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+ cpuaddr SymAddr;
+
+ memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
+ SymAddr = 0x42;
+ DumpMemToFileCmd.Payload.MemType = MM_MemType_RAM;
+ DumpMemToFileCmd.Payload.NumOfBytes = 50;
+ strncpy(DumpMemToFileCmd.Payload.FileName, "filename_RAM", sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
+
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_DumpMemToFile), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ /* Second call to MM_WriteFileHeaders will also return OS_SUCCESS as set above
+ */
+
+ UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr, &SymAddr);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
+
+ /* Verify the results */
+ UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_DUMP_TO_FILE);
+ UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType, DumpMemToFileCmd.Payload.MemType);
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
+ UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed, DumpMemToFileCmd.Payload.NumOfBytes);
+ UtAssert_StrCmp(MM_AppData.HkTlm.Payload.FileName,
+ DumpMemToFileCmd.Payload.FileName,
+ "Expected '%s' == '%s",
+ MM_AppData.HkTlm.Payload.FileName,
+ DumpMemToFileCmd.Payload.FileName);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(MM_DumpMemToFile, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DMP_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Dump Memory To File Command: Dumped %d bytes from "
+ "address %p to file '%s'");
+}
+
+void Test_MM_DumpMemToFileCmd_EEPROM(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+ cpuaddr SymAddr;
+
+ memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
+
+ SymAddr = 0x42;
+ DumpMemToFileCmd.Payload.MemType = MM_MemType_EEPROM;
+ DumpMemToFileCmd.Payload.NumOfBytes = 40;
+ strncpy(DumpMemToFileCmd.Payload.FileName, "filename_EEPROM", sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
+
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_DumpMemToFile), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ /* Second call to MM_WriteFileHeaders will also return OS_SUCCESS as set above
+ */
+
+ UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr, &SymAddr);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
+
+ /* Verify the results */
+ UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_DUMP_TO_FILE);
+ UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType, DumpMemToFileCmd.Payload.MemType);
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
+ UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed, DumpMemToFileCmd.Payload.NumOfBytes);
+ UtAssert_StrCmp(MM_AppData.HkTlm.Payload.FileName,
+ DumpMemToFileCmd.Payload.FileName,
+ "Expected '%s' == '%s",
+ MM_AppData.HkTlm.Payload.FileName,
+ DumpMemToFileCmd.Payload.FileName);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(MM_DumpMemToFile, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DMP_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Dump Memory To File Command: Dumped %d bytes from "
+ "address %p to file '%s'");
+}
+
+void Test_MM_DumpMemToFileCmd_MEM32(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+ cpuaddr SymAddr;
+
+ memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
+
+ SymAddr = 0x42;
+ DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM32;
+ DumpMemToFileCmd.Payload.NumOfBytes = 32;
+ strncpy(DumpMemToFileCmd.Payload.FileName, "filename_32", sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
+
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem32ToFile), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ /* Second call to MM_WriteFileHeaders will also return OS_SUCCESS as set above
+ */
+
+ UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr, &SymAddr);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
+
+ /* Verify the results */
+ UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_DUMP_TO_FILE);
+ UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType, DumpMemToFileCmd.Payload.MemType);
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
+ UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed, DumpMemToFileCmd.Payload.NumOfBytes);
+ UtAssert_StrCmp(MM_AppData.HkTlm.Payload.FileName,
+ DumpMemToFileCmd.Payload.FileName,
+ "Expected '%s' == '%s",
+ MM_AppData.HkTlm.Payload.FileName,
+ DumpMemToFileCmd.Payload.FileName);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(MM_DumpMem32ToFile, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DMP_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Dump Memory To File Command: Dumped %d bytes from "
+ "address %p to file '%s'");
+}
+
+void Test_MM_DumpMemToFileCmd_MEM16(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+ cpuaddr SymAddr;
+
+ memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
+
+ SymAddr = 0x42;
+ DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM16;
+ DumpMemToFileCmd.Payload.NumOfBytes = 16;
+ strncpy(DumpMemToFileCmd.Payload.FileName, "filename_16", sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
+
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem16ToFile), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ /* Second call to MM_WriteFileHeaders will also return OS_SUCCESS as set above
+ */
+
+ UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr, &SymAddr);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
+
+ /* Verify the results */
+ UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_DUMP_TO_FILE);
+ UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType, DumpMemToFileCmd.Payload.MemType);
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
+ UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed, DumpMemToFileCmd.Payload.NumOfBytes);
+ UtAssert_StrCmp(MM_AppData.HkTlm.Payload.FileName,
+ DumpMemToFileCmd.Payload.FileName,
+ "Expected '%s' == '%s",
+ MM_AppData.HkTlm.Payload.FileName,
+ DumpMemToFileCmd.Payload.FileName);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(MM_DumpMem16ToFile, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DMP_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Dump Memory To File Command: Dumped %d bytes from "
+ "address %p to file '%s'");
+}
+
+void Test_MM_DumpMemToFileCmd_MEM8(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+ cpuaddr SymAddr;
+
+ memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
+
+ SymAddr = 0x42;
+ DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM8;
+ DumpMemToFileCmd.Payload.NumOfBytes = 8;
+ strncpy(DumpMemToFileCmd.Payload.FileName, "filename_8", sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
+
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem8ToFile), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ /* Second call to MM_WriteFileHeaders will also return OS_SUCCESS as set above
+ */
+
+ UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr, &SymAddr);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
+
+ /* Verify the results */
+ UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_DUMP_TO_FILE);
+ UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType, DumpMemToFileCmd.Payload.MemType);
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
+ UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed, DumpMemToFileCmd.Payload.NumOfBytes);
+ UtAssert_StrCmp(MM_AppData.HkTlm.Payload.FileName,
+ DumpMemToFileCmd.Payload.FileName,
+ "Expected '%s' == '%s",
+ MM_AppData.HkTlm.Payload.FileName,
+ DumpMemToFileCmd.Payload.FileName);
+
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(MM_DumpMem8ToFile, 1);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DMP_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Dump Memory To File Command: Dumped %d bytes from "
+ "address %p to file '%s'");
+}
+
+void Test_MM_DumpMemToFileCmd_ComputeCRCError(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+ MM_LoadDumpFileHeader_t MMFileHeader;
+
+ memset(&MMFileHeader, 0, sizeof(MM_LoadDumpFileHeader_t));
+
+ MMFileHeader.MemType = MM_MemType_RAM;
+
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_DumpMemToFile), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+
+ UT_SetHandlerFunction(UT_KEY(MM_WriteFileHeaders), UT_Handler_MM_WriteFileHeaders, &MMFileHeader);
+
+ /* Set to generate error message MM_COMPUTECRCFROMFILE_ERR_EID */
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_ERROR);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_COMPUTECRCFROMFILE_ERR_EID, CFE_EVS_EventType_ERROR,
- "MM_ComputeCRCFromFile error received: RC = 0x%08X File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_COMPUTECRCFROMFILE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "MM_ComputeCRCFromFile error received: RC = 0x%08X File = '%s'");
}
-void Test_MM_DumpMemToFileCmd_CloseError(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+void Test_MM_DumpMemToFileCmd_CloseError(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
+ memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
- DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM8;
+ DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM8;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemValidateRange), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem8ToFile), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemValidateRange), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem8ToFile), CFE_PSP_SUCCESS);
- /* Set to generate error message MM_OS_CLOSE_ERR_EID */
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_ERROR);
+ /* Set to generate error message MM_OS_CLOSE_ERR_EID */
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 2);
- MM_Test_Verify_Event(0, MM_DMP_MEM_FILE_INF_EID,
- CFE_EVS_EventType_INFORMATION,
- "Dump Memory To File Command: Dumped %d bytes from "
- "address %p to file '%s'");
+ MM_Test_Verify_Event(0,
+ MM_DMP_MEM_FILE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Dump Memory To File Command: Dumped %d bytes from "
+ "address %p to file '%s'");
- MM_Test_Verify_Event(1, MM_OS_CLOSE_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_close error received: RC = 0x%08X File = '%s'");
+ MM_Test_Verify_Event(1,
+ MM_OS_CLOSE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_close error received: RC = 0x%08X File = '%s'");
}
-void Test_MM_DumpMemToFileCmd_CreatError(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+void Test_MM_DumpMemToFileCmd_CreatError(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_CREAT_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_OpenCreate error received: RC = %d File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_CREAT_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_OpenCreate error received: RC = %d File = '%s'");
}
-void Test_MM_DumpMemToFileCmd_InvalidDumpResult(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+void Test_MM_DumpMemToFileCmd_InvalidDumpResult(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
+ memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
- DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM8;
+ DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM8;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem8ToFile),
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem8ToFile), CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpMemToFileCmd_lseekError(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+void Test_MM_DumpMemToFileCmd_lseekError(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
+ memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
- DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM8;
+ DumpMemToFileCmd.Payload.MemType = MM_MemType_MEM8;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem8ToFile), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_DumpMem8ToFile), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpMemToFileCmd_SymNameError(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+void Test_MM_DumpMemToFileCmd_SymNameError(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'");
}
-void Test_MM_DumpMemToFileCmd_NoVerifyDumpParams(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+void Test_MM_DumpMemToFileCmd_NoVerifyDumpParams(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_ERROR);
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpMemToFileCmd_NoWriteHeaders(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+void Test_MM_DumpMemToFileCmd_NoWriteHeaders(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_ERR_INVALID_SIZE);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_ERR_INVALID_SIZE);
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
}
-void Test_MM_DumpMemToFileCmd_BadType(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+void Test_MM_DumpMemToFileCmd_BadType(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
+ memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
- DumpMemToFileCmd.Payload.MemType = 99;
+ DumpMemToFileCmd.Payload.MemType = 99;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_close), OS_SUCCESS);
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&DumpMemToFileCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpMemToFileCmd_ReWriteHeadersErr(void) {
- CFE_Status_t Result;
- MM_DumpMemToFileCmd_t DumpMemToFileCmd;
- cpuaddr SymAddr;
+void Test_MM_DumpMemToFileCmd_ReWriteHeadersErr(void)
+{
+ CFE_Status_t Result;
+ MM_DumpMemToFileCmd_t DumpMemToFileCmd;
+ cpuaddr SymAddr;
- memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
+ memset(&(DumpMemToFileCmd.Payload), 0, sizeof(MM_DumpMemToFileCmd_Payload_t));
- SymAddr = 0x42;
- DumpMemToFileCmd.Payload.MemType = MM_MemType_RAM;
- DumpMemToFileCmd.Payload.NumOfBytes = 50;
- strncpy(DumpMemToFileCmd.Payload.FileName, "filename_RAM",
- sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
+ SymAddr = 0x42;
+ DumpMemToFileCmd.Payload.MemType = MM_MemType_RAM;
+ DumpMemToFileCmd.Payload.NumOfBytes = 50;
+ strncpy(DumpMemToFileCmd.Payload.FileName, "filename_RAM", sizeof(DumpMemToFileCmd.Payload.FileName) - 1);
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
- UT_SetDeferredRetcode(UT_KEY(MM_WriteFileHeaders), 2, OS_ERR_INVALID_SIZE);
- UT_SetDefaultReturnValue(UT_KEY(MM_DumpMemToFile), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(OS_lseek),
- sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t));
- UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_WriteFileHeaders), OS_SUCCESS);
+ UT_SetDeferredRetcode(UT_KEY(MM_WriteFileHeaders), 2, OS_ERR_INVALID_SIZE);
+ UT_SetDefaultReturnValue(UT_KEY(MM_DumpMemToFile), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(OS_lseek), sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(MM_ComputeCRCFromFile), OS_SUCCESS);
- UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr,
- &SymAddr);
+ UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr, &SymAddr);
- /* Execute the function being tested */
- Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFileCmd(&(DumpMemToFileCmd));
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpInEventCmd_Nominal(void) {
- CFE_Status_t Result;
- MM_DumpInEventCmd_t DumpInEventCmd;
- cpuaddr SymAddr;
+void Test_MM_DumpInEventCmd_Nominal(void)
+{
+ CFE_Status_t Result;
+ MM_DumpInEventCmd_t DumpInEventCmd;
+ cpuaddr SymAddr;
- memset(&(DumpInEventCmd.Payload), 0, sizeof(MM_DumpInEventCmd_Payload_t));
+ memset(&(DumpInEventCmd.Payload), 0, sizeof(MM_DumpInEventCmd_Payload_t));
- SymAddr = 0x42;
- DumpInEventCmd.Payload.NumOfBytes = 1;
- DumpInEventCmd.Payload.MemType = MM_MemType_EEPROM;
+ SymAddr = 0x42;
+ DumpInEventCmd.Payload.NumOfBytes = 1;
+ DumpInEventCmd.Payload.MemType = MM_MemType_EEPROM;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_FillDumpInEventBuffer), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_FillDumpInEventBuffer), CFE_PSP_SUCCESS);
- UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr,
- &SymAddr);
+ UT_SetHandlerFunction(UT_KEY(MM_ResolveSymAddr), UT_Handler_MM_ResolveSymAddr, &SymAddr);
- /* Execute the function being tested */
- Result = MM_DumpInEventCmd(&DumpInEventCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpInEventCmd(&DumpInEventCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 1);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 1);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction,
- MM_LastAction_DUMP_INEVENT);
- UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType,
- DumpInEventCmd.Payload.MemType);
- UtAssert_ADDRESS_EQ(
- CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
- UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed,
- DumpInEventCmd.Payload.NumOfBytes);
+ UtAssert_UINT8_EQ(MM_AppData.HkTlm.Payload.LastAction, MM_LastAction_DUMP_INEVENT);
+ UtAssert_EQ(MM_MemType_Enum_t, MM_AppData.HkTlm.Payload.MemType, DumpInEventCmd.Payload.MemType);
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), SymAddr);
+ UtAssert_EQ(size_t, MM_AppData.HkTlm.Payload.BytesProcessed, DumpInEventCmd.Payload.NumOfBytes);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_DUMP_INEVENT_INF_EID,
- CFE_EVS_EventType_INFORMATION, "%s");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0, MM_DUMP_INEVENT_INF_EID, CFE_EVS_EventType_INFORMATION, "%s");
}
-void Test_MM_DumpInEventCmd_SymNameError(void) {
- CFE_Status_t Result;
- MM_DumpInEventCmd_t DumpInEventCmd;
+void Test_MM_DumpInEventCmd_SymNameError(void)
+{
+ CFE_Status_t Result;
+ MM_DumpInEventCmd_t DumpInEventCmd;
- /* Set to generate error message MM_SYMNAME_ERR_EID */
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR_NAME_LENGTH);
+ /* Set to generate error message MM_SYMNAME_ERR_EID */
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_ERROR_NAME_LENGTH);
- /* Execute the function being tested */
- Result = MM_DumpInEventCmd(&DumpInEventCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpInEventCmd(&DumpInEventCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_SYMNAME_ERR_EID, CFE_EVS_EventType_ERROR,
- "Symbolic address can't be resolved: Name = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_SYMNAME_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Symbolic address can't be resolved: Name = '%s'");
}
-void Test_MM_DumpInEventCmd_NoVerifyDumpParams(void) {
- CFE_Status_t Result;
- MM_DumpInEventCmd_t DumpInEventCmd;
+void Test_MM_DumpInEventCmd_NoVerifyDumpParams(void)
+{
+ CFE_Status_t Result;
+ MM_DumpInEventCmd_t DumpInEventCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_ERROR);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_ERROR);
- /* Execute the function being tested */
- Result = MM_DumpInEventCmd(&DumpInEventCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpInEventCmd(&DumpInEventCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpInEventCmd_FillDumpInvalid(void) {
- CFE_Status_t Result;
- MM_DumpInEventCmd_t DumpInEventCmd;
+void Test_MM_DumpInEventCmd_FillDumpInvalid(void)
+{
+ CFE_Status_t Result;
+ MM_DumpInEventCmd_t DumpInEventCmd;
- UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
- UT_SetDefaultReturnValue(UT_KEY(MM_FillDumpInEventBuffer),
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ UT_SetDefaultReturnValue(UT_KEY(MM_ResolveSymAddr), OS_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_VerifyLoadDumpParams), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(MM_FillDumpInEventBuffer), CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_DumpInEventCmd(&DumpInEventCmd);
+ /* Execute the function being tested */
+ Result = MM_DumpInEventCmd(&DumpInEventCmd);
- /* Verify results */
- UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Verify results */
+ UtAssert_EQ(CFE_Status_t, Result, CFE_SUCCESS);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- /* Error event is issued in MM_FillDumpInEventBuffer and thus not visible here
- */
+ /* Error event is issued in MM_FillDumpInEventBuffer and thus not visible here
+ */
}
/*
* Register the test cases to execute with the unit test tool
*/
-void UtTest_Setup(void) {
- ADD_TEST(Test_MM_SendHkCmd_Nominal);
- ADD_TEST(Test_MM_NoopCmd_Nominal);
- ADD_TEST(Test_MM_ResetCountersCmd_Nominal);
- ADD_TEST(Test_MM_LookupSymCmd_Nominal);
- ADD_TEST(Test_MM_LookupSymCmd_SymbolNameNull);
- ADD_TEST(Test_MM_LookupSymCmd_SymbolLookupError);
- ADD_TEST(Test_MM_SymTblToFileCmd_Nominal);
- ADD_TEST(Test_MM_SymTblToFileCmd_SymbolFilenameNull);
- ADD_TEST(Test_MM_SymTblToFileCmd_SymbolTableDumpError);
- ADD_TEST(Test_MM_EepromWriteEnaCmd_Nominal);
- ADD_TEST(Test_MM_EepromWriteEnaCmd_Error);
- ADD_TEST(Test_MM_EepromWriteDisCmd_Nominal);
- ADD_TEST(Test_MM_EepromWriteDisCmd_Error);
- ADD_TEST(Test_MM_PokeCmd_EEPROM);
- ADD_TEST(Test_MM_PokeCmd_NonEEPROM);
- ADD_TEST(Test_MM_PokeCmd_SymNameError);
- ADD_TEST(Test_MM_PokeCmd_NoVerifyPeekPokeParams);
- ADD_TEST(Test_MM_PokeCmd_PokeErr);
- ADD_TEST(Test_MM_LoadMemWIDCmd_Nominal);
- ADD_TEST(Test_MM_LoadMemWIDCmd_CRCError);
- ADD_TEST(Test_MM_LoadMemWIDCmd_SymNameErr);
- ADD_TEST(Test_MM_LoadMemWIDCmd_NoVerifyLoadWIDParams);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_RAM);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_BadType);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_EEPROM);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_MEM32);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_MEM32Invalid);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_MEM16);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_MEM8);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_NoReadFileHeaders);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_NoVerifyLoadFileSize);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_lseekError);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_LoadParamsError);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_SymNameError);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_LoadFileCRCError);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_ComputeCRCError);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_CloseError);
- ADD_TEST(Test_MM_LoadMemFromFileCmd_OpenError);
- ADD_TEST(Test_MM_FillMemCmd_RAM);
- ADD_TEST(Test_MM_FillMemCmd_EEPROM);
- ADD_TEST(Test_MM_FillMemCmd_MEM32);
- ADD_TEST(Test_MM_FillMemCmd_MEM16);
- ADD_TEST(Test_MM_FillMemCmd_MEM8);
- ADD_TEST(Test_MM_FillMemCmd_SymNameError);
- ADD_TEST(Test_MM_FillMemCmd_NoLastActionFill);
- ADD_TEST(Test_MM_FillMemCmd_NoVerifyLoadDump);
- ADD_TEST(Test_MM_FillMemCmd_BadType);
- ADD_TEST(Test_MM_PeekCmd_Nominal);
- ADD_TEST(Test_MM_PeekCmd_SymNameError);
- ADD_TEST(Test_MM_PeekCmd_NoVerifyPeekPokeParams);
- ADD_TEST(Test_MM_PeekCmd_PeekErr);
- ADD_TEST(Test_MM_DumpMemToFileCmd_RAM);
- ADD_TEST(Test_MM_DumpMemToFileCmd_EEPROM);
- ADD_TEST(Test_MM_DumpMemToFileCmd_MEM32);
- ADD_TEST(Test_MM_DumpMemToFileCmd_MEM16);
- ADD_TEST(Test_MM_DumpMemToFileCmd_MEM8);
- ADD_TEST(Test_MM_DumpMemToFileCmd_ComputeCRCError);
- ADD_TEST(Test_MM_DumpMemToFileCmd_CloseError);
- ADD_TEST(Test_MM_DumpMemToFileCmd_CreatError);
- ADD_TEST(Test_MM_DumpMemToFileCmd_InvalidDumpResult);
- ADD_TEST(Test_MM_DumpMemToFileCmd_lseekError);
- ADD_TEST(Test_MM_DumpMemToFileCmd_SymNameError);
- ADD_TEST(Test_MM_DumpMemToFileCmd_NoVerifyDumpParams);
- ADD_TEST(Test_MM_DumpMemToFileCmd_NoWriteHeaders);
- ADD_TEST(Test_MM_DumpMemToFileCmd_BadType);
- ADD_TEST(Test_MM_DumpMemToFileCmd_ReWriteHeadersErr);
- ADD_TEST(Test_MM_DumpInEventCmd_Nominal);
- ADD_TEST(Test_MM_DumpInEventCmd_SymNameError);
- ADD_TEST(Test_MM_DumpInEventCmd_NoVerifyDumpParams);
- ADD_TEST(Test_MM_DumpInEventCmd_FillDumpInvalid);
+void UtTest_Setup(void)
+{
+ ADD_TEST(Test_MM_SendHkCmd_Nominal);
+ ADD_TEST(Test_MM_NoopCmd_Nominal);
+ ADD_TEST(Test_MM_ResetCountersCmd_Nominal);
+ ADD_TEST(Test_MM_LookupSymCmd_Nominal);
+ ADD_TEST(Test_MM_LookupSymCmd_SymbolNameNull);
+ ADD_TEST(Test_MM_LookupSymCmd_SymbolLookupError);
+ ADD_TEST(Test_MM_SymTblToFileCmd_Nominal);
+ ADD_TEST(Test_MM_SymTblToFileCmd_SymbolFilenameNull);
+ ADD_TEST(Test_MM_SymTblToFileCmd_SymbolTableDumpError);
+ ADD_TEST(Test_MM_EepromWriteEnaCmd_Nominal);
+ ADD_TEST(Test_MM_EepromWriteEnaCmd_Error);
+ ADD_TEST(Test_MM_EepromWriteDisCmd_Nominal);
+ ADD_TEST(Test_MM_EepromWriteDisCmd_Error);
+ ADD_TEST(Test_MM_PokeCmd_EEPROM);
+ ADD_TEST(Test_MM_PokeCmd_NonEEPROM);
+ ADD_TEST(Test_MM_PokeCmd_SymNameError);
+ ADD_TEST(Test_MM_PokeCmd_NoVerifyPeekPokeParams);
+ ADD_TEST(Test_MM_PokeCmd_PokeErr);
+ ADD_TEST(Test_MM_LoadMemWIDCmd_Nominal);
+ ADD_TEST(Test_MM_LoadMemWIDCmd_CRCError);
+ ADD_TEST(Test_MM_LoadMemWIDCmd_SymNameErr);
+ ADD_TEST(Test_MM_LoadMemWIDCmd_NoVerifyLoadWIDParams);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_RAM);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_BadType);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_EEPROM);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_MEM32);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_MEM32Invalid);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_MEM16);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_MEM8);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_NoReadFileHeaders);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_NoVerifyLoadFileSize);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_lseekError);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_LoadParamsError);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_SymNameError);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_LoadFileCRCError);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_ComputeCRCError);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_CloseError);
+ ADD_TEST(Test_MM_LoadMemFromFileCmd_OpenError);
+ ADD_TEST(Test_MM_FillMemCmd_RAM);
+ ADD_TEST(Test_MM_FillMemCmd_EEPROM);
+ ADD_TEST(Test_MM_FillMemCmd_MEM32);
+ ADD_TEST(Test_MM_FillMemCmd_MEM16);
+ ADD_TEST(Test_MM_FillMemCmd_MEM8);
+ ADD_TEST(Test_MM_FillMemCmd_SymNameError);
+ ADD_TEST(Test_MM_FillMemCmd_NoLastActionFill);
+ ADD_TEST(Test_MM_FillMemCmd_NoVerifyLoadDump);
+ ADD_TEST(Test_MM_FillMemCmd_BadType);
+ ADD_TEST(Test_MM_PeekCmd_Nominal);
+ ADD_TEST(Test_MM_PeekCmd_SymNameError);
+ ADD_TEST(Test_MM_PeekCmd_NoVerifyPeekPokeParams);
+ ADD_TEST(Test_MM_PeekCmd_PeekErr);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_RAM);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_EEPROM);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_MEM32);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_MEM16);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_MEM8);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_ComputeCRCError);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_CloseError);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_CreatError);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_InvalidDumpResult);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_lseekError);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_SymNameError);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_NoVerifyDumpParams);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_NoWriteHeaders);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_BadType);
+ ADD_TEST(Test_MM_DumpMemToFileCmd_ReWriteHeadersErr);
+ ADD_TEST(Test_MM_DumpInEventCmd_Nominal);
+ ADD_TEST(Test_MM_DumpInEventCmd_SymNameError);
+ ADD_TEST(Test_MM_DumpInEventCmd_NoVerifyDumpParams);
+ ADD_TEST(Test_MM_DumpInEventCmd_FillDumpInvalid);
}
diff --git a/unit-test/mm_dispatch_tests.c b/unit-test/mm_dispatch_tests.c
index 8899950..fa222bd 100644
--- a/unit-test/mm_dispatch_tests.c
+++ b/unit-test/mm_dispatch_tests.c
@@ -43,926 +43,868 @@
/* Function Definitions */
/* ==================== */
-void Test_MM_VerifyCmdLength_Nominal(void) {
- bool Result;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
- CFE_MSG_FcnCode_t FcnCode;
+void Test_MM_VerifyCmdLength_Nominal(void)
+{
+ bool Result;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
+ CFE_MSG_FcnCode_t FcnCode;
- /* Set up values for test */
- ExpectedLen = sizeof(MM_NoopCmd_t);
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- FcnCode = MM_NOOP_CC;
+ /* Set up values for test */
+ ExpectedLen = sizeof(MM_NoopCmd_t);
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ FcnCode = MM_NOOP_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Run function under test */
- Result = MM_VerifyCmdLength(NULL, sizeof(MM_NoopCmd_t));
+ /* Run function under test */
+ Result = MM_VerifyCmdLength(NULL, sizeof(MM_NoopCmd_t));
- /* Evaluate run */
- UtAssert_True(Result, "MM_VerifyCmdLength returned true");
+ /* Evaluate run */
+ UtAssert_True(Result, "MM_VerifyCmdLength returned true");
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyCmdLength_InvalidSize(void) {
- bool Result;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
- CFE_MSG_FcnCode_t FcnCode;
+void Test_MM_VerifyCmdLength_InvalidSize(void)
+{
+ bool Result;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
+ CFE_MSG_FcnCode_t FcnCode;
- /* Set up values for test */
- ExpectedLen = sizeof(MM_NoopCmd_t) + 1;
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- FcnCode = MM_NOOP_CC;
+ /* Set up values for test */
+ ExpectedLen = sizeof(MM_NoopCmd_t) + 1;
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ FcnCode = MM_NOOP_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Run function under test */
- Result = MM_VerifyCmdLength(NULL, sizeof(MM_NoopCmd_t));
+ /* Run function under test */
+ Result = MM_VerifyCmdLength(NULL, sizeof(MM_NoopCmd_t));
- /* Evaluate run */
- UtAssert_BOOL_FALSE(Result);
+ /* Evaluate run */
+ UtAssert_BOOL_FALSE(Result);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_CMD_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid Msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_CMD_LEN_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Invalid Msg length: ID = 0x%X, CC = %u, Len = %u, Expected = %u");
}
-void Test_MM_ProcessGroundCommand_NoopCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_NoopCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_NoopCmd() */
- CommandCode = MM_NOOP_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_NoopCmd() */
+ CommandCode = MM_NOOP_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_NoopCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_NoopCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_NoopCmd, 1);
+ UtAssert_STUB_COUNT(MM_NoopCmd, 1);
}
-void Test_MM_ProcessGroundCommand_NoopCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_NoopCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_NoopCmd() */
- CommandCode = MM_NOOP_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_NoopCmd() */
+ CommandCode = MM_NOOP_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_NoopCmd, 0);
+ UtAssert_STUB_COUNT(MM_NoopCmd, 0);
}
-void Test_MM_ProcessGroundCommand_ResetCountersCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_ResetCountersCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_ResetCountersCmd() */
- CommandCode = MM_RESET_COUNTERS_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_ResetCountersCmd() */
+ CommandCode = MM_RESET_COUNTERS_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_ResetCountersCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_ResetCountersCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_ResetCountersCmd, 1);
+ UtAssert_STUB_COUNT(MM_ResetCountersCmd, 1);
}
-void Test_MM_ProcessGroundCommand_ResetCountersCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_ResetCountersCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_ResetCountersCmd() */
- CommandCode = MM_RESET_COUNTERS_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_ResetCountersCmd() */
+ CommandCode = MM_RESET_COUNTERS_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_ResetCountersCmd, 0);
+ UtAssert_STUB_COUNT(MM_ResetCountersCmd, 0);
}
-void Test_MM_ProcessGroundCommand_PeekCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_PeekCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_PeekCmd() */
- CommandCode = MM_PEEK_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_PeekCmd() */
+ CommandCode = MM_PEEK_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_PeekCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_PeekCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_PeekCmd, 1);
+ UtAssert_STUB_COUNT(MM_PeekCmd, 1);
}
-void Test_MM_ProcessGroundCommand_PeekCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_PeekCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_PeekCmd() */
- CommandCode = MM_PEEK_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_PeekCmd() */
+ CommandCode = MM_PEEK_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_PeekCmd, 0);
+ UtAssert_STUB_COUNT(MM_PeekCmd, 0);
}
-void Test_MM_ProcessGroundCommand_PokeCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_PokeCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_PokeCmd() */
- CommandCode = MM_POKE_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_PokeCmd() */
+ CommandCode = MM_POKE_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_PokeCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_PokeCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_PokeCmd, 1);
+ UtAssert_STUB_COUNT(MM_PokeCmd, 1);
}
-void Test_MM_ProcessGroundCommand_PokeCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_PokeCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_PokeCmd() */
- CommandCode = MM_POKE_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_PokeCmd() */
+ CommandCode = MM_POKE_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_PokeCmd, 0);
+ UtAssert_STUB_COUNT(MM_PokeCmd, 0);
}
-void Test_MM_ProcessGroundCommand_LoadMemWIDCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_LoadMemWIDCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_LoadMemWIDCmd() */
- CommandCode = MM_LOAD_MEM_WID_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_LoadMemWIDCmd() */
+ CommandCode = MM_LOAD_MEM_WID_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_LoadMemWIDCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_LoadMemWIDCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_LoadMemWIDCmd, 1);
+ UtAssert_STUB_COUNT(MM_LoadMemWIDCmd, 1);
}
-void Test_MM_ProcessGroundCommand_LoadMemWIDCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_LoadMemWIDCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_LoadMemWIDCmd() */
- CommandCode = MM_LOAD_MEM_WID_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_LoadMemWIDCmd() */
+ CommandCode = MM_LOAD_MEM_WID_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_LoadMemWIDCmd, 0);
+ UtAssert_STUB_COUNT(MM_LoadMemWIDCmd, 0);
}
-void Test_MM_ProcessGroundCommand_LoadMemFromFileCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_LoadMemFromFileCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_LoadMemFromFileCmd() */
- CommandCode = MM_LOAD_MEM_FROM_FILE_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_LoadMemFromFileCmd() */
+ CommandCode = MM_LOAD_MEM_FROM_FILE_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_LoadMemFromFileCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_LoadMemFromFileCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_LoadMemFromFileCmd, 1);
+ UtAssert_STUB_COUNT(MM_LoadMemFromFileCmd, 1);
}
-void Test_MM_ProcessGroundCommand_LoadMemFromFileCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_LoadMemFromFileCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_LoadMemFromFileCmd() */
- CommandCode = MM_LOAD_MEM_FROM_FILE_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_LoadMemFromFileCmd() */
+ CommandCode = MM_LOAD_MEM_FROM_FILE_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_LoadMemFromFileCmd, 0);
+ UtAssert_STUB_COUNT(MM_LoadMemFromFileCmd, 0);
}
-void Test_MM_ProcessGroundCommand_DumpMemToFileCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_DumpMemToFileCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_DumpMemToFileCmd() */
- CommandCode = MM_DUMP_MEM_TO_FILE_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_DumpMemToFileCmd() */
+ CommandCode = MM_DUMP_MEM_TO_FILE_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_DumpMemToFileCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_DumpMemToFileCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_DumpMemToFileCmd, 1);
+ UtAssert_STUB_COUNT(MM_DumpMemToFileCmd, 1);
}
-void Test_MM_ProcessGroundCommand_DumpMemToFileCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_DumpMemToFileCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_DumpMemToFileCmd() */
- CommandCode = MM_DUMP_MEM_TO_FILE_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_DumpMemToFileCmd() */
+ CommandCode = MM_DUMP_MEM_TO_FILE_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_DumpMemToFileCmd, 0);
+ UtAssert_STUB_COUNT(MM_DumpMemToFileCmd, 0);
}
-void Test_MM_ProcessGroundCommand_DumpInEventCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_DumpInEventCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_DumpInEventCmd() */
- CommandCode = MM_DUMP_IN_EVENT_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_DumpInEventCmd() */
+ CommandCode = MM_DUMP_IN_EVENT_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_DumpInEventCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_DumpInEventCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_DumpInEventCmd, 1);
+ UtAssert_STUB_COUNT(MM_DumpInEventCmd, 1);
}
-void Test_MM_ProcessGroundCommand_DumpInEventCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_DumpInEventCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_DumpInEventCmd() */
- CommandCode = MM_DUMP_IN_EVENT_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_DumpInEventCmd() */
+ CommandCode = MM_DUMP_IN_EVENT_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_DumpInEventCmd, 0);
+ UtAssert_STUB_COUNT(MM_DumpInEventCmd, 0);
}
-void Test_MM_ProcessGroundCommand_FillMemCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_FillMemCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_FillMemCmd() */
- CommandCode = MM_FILL_MEM_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_FillMemCmd() */
+ CommandCode = MM_FILL_MEM_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_FillMemCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_FillMemCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_FillMemCmd, 1);
+ UtAssert_STUB_COUNT(MM_FillMemCmd, 1);
}
-void Test_MM_ProcessGroundCommand_FillMemCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_FillMemCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_FillMemCmd() */
- CommandCode = MM_FILL_MEM_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_FillMemCmd() */
+ CommandCode = MM_FILL_MEM_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_FillMemCmd, 0);
+ UtAssert_STUB_COUNT(MM_FillMemCmd, 0);
}
-void Test_MM_ProcessGroundCommand_LookupSymCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_LookupSymCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_LookupSymCmd() */
- CommandCode = MM_LOOKUP_SYM_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_LookupSymCmd() */
+ CommandCode = MM_LOOKUP_SYM_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_LookupSymCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_LookupSymCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_LookupSymCmd, 1);
+ UtAssert_STUB_COUNT(MM_LookupSymCmd, 1);
}
-void Test_MM_ProcessGroundCommand_LookupSymCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_LookupSymCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_LookupSymCmd() */
- CommandCode = MM_LOOKUP_SYM_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_LookupSymCmd() */
+ CommandCode = MM_LOOKUP_SYM_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_LookupSymCmd, 0);
+ UtAssert_STUB_COUNT(MM_LookupSymCmd, 0);
}
-void Test_MM_ProcessGroundCommand_SymTblToFileCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_SymTblToFileCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_SymTblToFileCmd() */
- CommandCode = MM_SYM_TBL_TO_FILE_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_SymTblToFileCmd() */
+ CommandCode = MM_SYM_TBL_TO_FILE_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_SymTblToFileCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_SymTblToFileCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_SymTblToFileCmd, 1);
+ UtAssert_STUB_COUNT(MM_SymTblToFileCmd, 1);
}
-void Test_MM_ProcessGroundCommand_SymTblToFileCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_SymTblToFileCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_SymTblToFileCmd() */
- CommandCode = MM_SYM_TBL_TO_FILE_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_SymTblToFileCmd() */
+ CommandCode = MM_SYM_TBL_TO_FILE_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_SymTblToFileCmd, 0);
+ UtAssert_STUB_COUNT(MM_SymTblToFileCmd, 0);
}
-void Test_MM_ProcessGroundCommand_EepromWriteEnaCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_EepromWriteEnaCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_EepromWriteEnaCmd() */
- CommandCode = MM_EEPROM_WRITE_ENA_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_EepromWriteEnaCmd() */
+ CommandCode = MM_EEPROM_WRITE_ENA_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_EepromWriteEnaCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_EepromWriteEnaCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_EepromWriteEnaCmd, 1);
+ UtAssert_STUB_COUNT(MM_EepromWriteEnaCmd, 1);
}
-void Test_MM_ProcessGroundCommand_EepromWriteEnaCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_EepromWriteEnaCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_EepromWriteEnaCmd() */
- CommandCode = MM_EEPROM_WRITE_ENA_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_EepromWriteEnaCmd() */
+ CommandCode = MM_EEPROM_WRITE_ENA_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_EepromWriteEnaCmd, 0);
+ UtAssert_STUB_COUNT(MM_EepromWriteEnaCmd, 0);
}
-void Test_MM_ProcessGroundCommand_EepromWriteDisCmd(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_ProcessGroundCommand_EepromWriteDisCmd(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_EepromWriteDisCmd() */
- CommandCode = MM_EEPROM_WRITE_DIS_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_EepromWriteDisCmd() */
+ CommandCode = MM_EEPROM_WRITE_DIS_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_EepromWriteDisCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_EepromWriteDisCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(MM_EepromWriteDisCmd, 1);
+ UtAssert_STUB_COUNT(MM_EepromWriteDisCmd, 1);
}
-void Test_MM_ProcessGroundCommand_EepromWriteDisCmdErr(void) {
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
- CFE_SB_MsgId_t MsgId;
+void Test_MM_ProcessGroundCommand_EepromWriteDisCmdErr(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
+ CFE_SB_MsgId_t MsgId;
- /* Provide a message ID for test */
- MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Provide a message ID for test */
+ MsgId = CFE_SB_MSGID_C(MM_MISSION_CMD_TOPICID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Set up to run MM_EepromWriteDisCmd() */
- CommandCode = MM_EEPROM_WRITE_DIS_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_EepromWriteDisCmd() */
+ CommandCode = MM_EEPROM_WRITE_DIS_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to fail command length verification */
- ExpectedLen = 0;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to fail command length verification */
+ ExpectedLen = 0;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(MM_EepromWriteDisCmd, 0);
+ UtAssert_STUB_COUNT(MM_EepromWriteDisCmd, 0);
}
-void Test_MM_ProcessGroundCommand_UnknownCC(void) {
- CFE_MSG_FcnCode_t CommandCode;
+void Test_MM_ProcessGroundCommand_UnknownCC(void)
+{
+ CFE_MSG_FcnCode_t CommandCode;
- /* Set up for a failed command code check */
- CommandCode = 200;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up for a failed command code check */
+ CommandCode = 200;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Run function under test */
- MM_ProcessGroundCommand(NULL);
+ /* Run function under test */
+ MM_ProcessGroundCommand(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MM_CC_ERR_EID);
- UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType,
- CFE_EVS_EventType_ERROR);
+ UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventID, MM_CC_ERR_EID);
+ UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[0].EventType, CFE_EVS_EventType_ERROR);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- UtAssert_StrnCmp("Invalid ground command code %d",
- context_CFE_EVS_SendEvent[0].Spec,
- CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
- "Event string matched expected result, '%s'",
- context_CFE_EVS_SendEvent[0].Spec);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ UtAssert_StrnCmp("Invalid ground command code %d",
+ context_CFE_EVS_SendEvent[0].Spec,
+ CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
+ "Event string matched expected result, '%s'",
+ context_CFE_EVS_SendEvent[0].Spec);
}
-void Test_MM_TaskPipe_SendHk(void) {
- CFE_SB_MsgId_t MsgId;
+void Test_MM_TaskPipe_SendHk(void)
+{
+ CFE_SB_MsgId_t MsgId;
- /* Set up to send an HK packet */
- MsgId = CFE_SB_ValueToMsgId(MM_SEND_HK_MID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Set up to send an HK packet */
+ MsgId = CFE_SB_ValueToMsgId(MM_SEND_HK_MID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Run function under test */
- MM_TaskPipe(NULL);
+ /* Run function under test */
+ MM_TaskPipe(NULL);
- /* Evaluate run */
- UtAssert_STUB_COUNT(MM_SendHkCmd, 1);
+ /* Evaluate run */
+ UtAssert_STUB_COUNT(MM_SendHkCmd, 1);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
}
-void Test_MM_TaskPipe_Cmd(void) {
- CFE_SB_MsgId_t MsgId;
- CFE_MSG_FcnCode_t CommandCode;
- size_t ExpectedLen;
+void Test_MM_TaskPipe_Cmd(void)
+{
+ CFE_SB_MsgId_t MsgId;
+ CFE_MSG_FcnCode_t CommandCode;
+ size_t ExpectedLen;
- /* Set up to run MM_NoopCmd() */
- CommandCode = MM_NOOP_CC;
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode,
- sizeof(CFE_MSG_FcnCode_t), false);
+ /* Set up to run MM_NoopCmd() */
+ CommandCode = MM_NOOP_CC;
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &CommandCode, sizeof(CFE_MSG_FcnCode_t), false);
- /* Set up to pass command length verification */
- ExpectedLen = sizeof(MM_NoopCmd_t);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t),
- false);
+ /* Set up to pass command length verification */
+ ExpectedLen = sizeof(MM_NoopCmd_t);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &ExpectedLen, sizeof(size_t), false);
- /* Set up to send an HK packet */
- MsgId = CFE_SB_ValueToMsgId(MM_CMD_MID);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Set up to send an HK packet */
+ MsgId = CFE_SB_ValueToMsgId(MM_CMD_MID);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Run function under test */
- MM_TaskPipe(NULL);
+ /* Run function under test */
+ MM_TaskPipe(NULL);
- /* Evaluate run */
- UtAssert_STUB_COUNT(MM_NoopCmd, 1);
+ /* Evaluate run */
+ UtAssert_STUB_COUNT(MM_NoopCmd, 1);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
}
-void Test_MM_TaskPipe_UnknownMID(void) {
- CFE_SB_MsgId_t MsgId;
+void Test_MM_TaskPipe_UnknownMID(void)
+{
+ CFE_SB_MsgId_t MsgId;
- /* Set up to send an HK packet */
- MsgId = CFE_SB_ValueToMsgId(400);
- UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t),
- false);
+ /* Set up to send an HK packet */
+ MsgId = CFE_SB_ValueToMsgId(400);
+ UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(CFE_SB_MsgId_t), false);
- /* Run function under test */
- MM_TaskPipe(NULL);
+ /* Run function under test */
+ MM_TaskPipe(NULL);
- /* Evaluate run */
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.ErrCounter, 1);
+ /* Evaluate run */
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_EQ(uint8_t, MM_AppData.HkTlm.Payload.CommandErrorCounter, 1);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_MID_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid command pipe message ID: 0x%08lX");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0, MM_MID_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid command pipe message ID: 0x%08lX");
}
/*
* Register the test cases to execute with the unit test tool
*/
-void UtTest_Setup(void) {
- ADD_TEST(Test_MM_VerifyCmdLength_Nominal);
- ADD_TEST(Test_MM_VerifyCmdLength_InvalidSize);
- ADD_TEST(Test_MM_ProcessGroundCommand_NoopCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_NoopCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_ResetCountersCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_ResetCountersCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_PeekCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_PeekCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_PokeCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_PokeCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_LoadMemWIDCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_LoadMemWIDCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_LoadMemFromFileCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_LoadMemFromFileCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_DumpMemToFileCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_DumpMemToFileCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_DumpInEventCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_DumpInEventCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_FillMemCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_FillMemCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_LookupSymCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_LookupSymCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_SymTblToFileCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_SymTblToFileCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_EepromWriteEnaCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_EepromWriteEnaCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_EepromWriteDisCmd);
- ADD_TEST(Test_MM_ProcessGroundCommand_EepromWriteDisCmdErr);
- ADD_TEST(Test_MM_ProcessGroundCommand_UnknownCC);
- ADD_TEST(Test_MM_TaskPipe_SendHk);
- ADD_TEST(Test_MM_TaskPipe_Cmd);
- ADD_TEST(Test_MM_TaskPipe_UnknownMID);
-}
\ No newline at end of file
+void UtTest_Setup(void)
+{
+ ADD_TEST(Test_MM_VerifyCmdLength_Nominal);
+ ADD_TEST(Test_MM_VerifyCmdLength_InvalidSize);
+ ADD_TEST(Test_MM_ProcessGroundCommand_NoopCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_NoopCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_ResetCountersCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_ResetCountersCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_PeekCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_PeekCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_PokeCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_PokeCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_LoadMemWIDCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_LoadMemWIDCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_LoadMemFromFileCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_LoadMemFromFileCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_DumpMemToFileCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_DumpMemToFileCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_DumpInEventCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_DumpInEventCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_FillMemCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_FillMemCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_LookupSymCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_LookupSymCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_SymTblToFileCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_SymTblToFileCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_EepromWriteEnaCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_EepromWriteEnaCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_EepromWriteDisCmd);
+ ADD_TEST(Test_MM_ProcessGroundCommand_EepromWriteDisCmdErr);
+ ADD_TEST(Test_MM_ProcessGroundCommand_UnknownCC);
+ ADD_TEST(Test_MM_TaskPipe_SendHk);
+ ADD_TEST(Test_MM_TaskPipe_Cmd);
+ ADD_TEST(Test_MM_TaskPipe_UnknownMID);
+}
diff --git a/unit-test/mm_dump_tests.c b/unit-test/mm_dump_tests.c
index 9c1fa88..8814d0e 100644
--- a/unit-test/mm_dump_tests.c
+++ b/unit-test/mm_dump_tests.c
@@ -49,708 +49,719 @@
#include
#include
-void Test_MM_PeekMem_Byte(void) {
- MM_PeekCmd_t CmdPacket;
- uint32 SrcAddress = 1;
- int32 Result;
-
- CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
- CmdPacket.Payload.MemType = MM_MemType_RAM;
-
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemRead8), CFE_PSP_SUCCESS);
-
- /* Execute the function being tested */
- Result = MM_PeekMem(&CmdPacket, SrcAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), 1);
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 1,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 1");
- UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 1,
- "MM_AppData.HkTlm.Payload.DataValue == 1");
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_PEEK_BYTE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Peek Command: Addr = %p Size = %u bits Data = 0x%08X");
+void Test_MM_PeekMem_Byte(void)
+{
+ MM_PeekCmd_t CmdPacket;
+ uint32 SrcAddress = 1;
+ int32 Result;
+
+ CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemRead8), CFE_PSP_SUCCESS);
+
+ /* Execute the function being tested */
+ Result = MM_PeekMem(&CmdPacket, SrcAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), 1);
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 1, "MM_AppData.HkTlm.Payload.BytesProcessed == 1");
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 1, "MM_AppData.HkTlm.Payload.DataValue == 1");
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PEEK_BYTE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Peek Command: Addr = %p Size = %u bits Data = 0x%08X");
}
-void Test_MM_PeekMem_ByteError(void) {
- MM_PeekCmd_t CmdPacket;
- uint32 SrcAddress = 1;
- int32 Result;
+void Test_MM_PeekMem_ByteError(void)
+{
+ MM_PeekCmd_t CmdPacket;
+ uint32 SrcAddress = 1;
+ int32 Result;
- CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
- /* Set to generate error message MM_PSP_READ_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead8), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_READ_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead8), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_PeekMem(&CmdPacket, SrcAddress);
+ /* Execute the function being tested */
+ Result = MM_PeekMem(&CmdPacket, SrcAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=%d, Address=%p, MemType=MEM%u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=%d, Address=%p, MemType=MEM%u");
}
-void Test_MM_PeekMem_Word(void) {
- MM_PeekCmd_t CmdPacket;
- uint32 SrcAddress = 1;
- int32 Result;
-
- CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
- CmdPacket.Payload.MemType = MM_MemType_RAM;
-
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemRead16), CFE_PSP_SUCCESS);
-
- /* Execute the function being tested */
- Result = MM_PeekMem(&CmdPacket, SrcAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), 1);
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 2");
- UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 0,
- "MM_AppData.HkTlm.Payload.DataValue == 0");
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_PEEK_WORD_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Peek Command: Addr = %p Size = %u bits Data = 0x%08X");
+void Test_MM_PeekMem_Word(void)
+{
+ MM_PeekCmd_t CmdPacket;
+ uint32 SrcAddress = 1;
+ int32 Result;
+
+ CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemRead16), CFE_PSP_SUCCESS);
+
+ /* Execute the function being tested */
+ Result = MM_PeekMem(&CmdPacket, SrcAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), 1);
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2, "MM_AppData.HkTlm.Payload.BytesProcessed == 2");
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 0, "MM_AppData.HkTlm.Payload.DataValue == 0");
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PEEK_WORD_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Peek Command: Addr = %p Size = %u bits Data = 0x%08X");
}
-void Test_MM_PeekMem_WordError(void) {
- MM_PeekCmd_t CmdPacket;
- uint32 SrcAddress = 0;
- int32 Result;
+void Test_MM_PeekMem_WordError(void)
+{
+ MM_PeekCmd_t CmdPacket;
+ uint32 SrcAddress = 0;
+ int32 Result;
- CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
- /* Set to generate error message MM_PSP_READ_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead16), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_READ_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead16), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_PeekMem(&CmdPacket, SrcAddress);
+ /* Execute the function being tested */
+ Result = MM_PeekMem(&CmdPacket, SrcAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=%d, Address=%p, MemType=MEM%u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=%d, Address=%p, MemType=MEM%u");
}
-void Test_MM_PeekMem_DWord(void) {
- MM_PeekCmd_t CmdPacket;
- uint32 SrcAddress = 1;
- int32 Result;
-
- CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
- CmdPacket.Payload.MemType = MM_MemType_RAM;
-
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemRead32), CFE_PSP_SUCCESS);
-
- /* Execute the function being tested */
- Result = MM_PeekMem(&CmdPacket, SrcAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), 1);
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 4,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 4");
- UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 0,
- "MM_AppData.HkTlm.Payload.DataValue == 0");
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_PEEK_DWORD_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Peek Command: Addr = %p Size = %u bits Data = 0x%08X");
+void Test_MM_PeekMem_DWord(void)
+{
+ MM_PeekCmd_t CmdPacket;
+ uint32 SrcAddress = 1;
+ int32 Result;
+
+ CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemRead32), CFE_PSP_SUCCESS);
+
+ /* Execute the function being tested */
+ Result = MM_PeekMem(&CmdPacket, SrcAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_PEEK");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), 1);
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 4, "MM_AppData.HkTlm.Payload.BytesProcessed == 4");
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 0, "MM_AppData.HkTlm.Payload.DataValue == 0");
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PEEK_DWORD_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Peek Command: Addr = %p Size = %u bits Data = 0x%08X");
}
-void Test_MM_PeekMem_DWordError(void) {
- MM_PeekCmd_t CmdPacket;
- uint32 SrcAddress = 0;
- int32 Result;
+void Test_MM_PeekMem_DWordError(void)
+{
+ MM_PeekCmd_t CmdPacket;
+ uint32 SrcAddress = 0;
+ int32 Result;
- CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
- /* Set to generate error message MM_PSP_READ_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead32), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_READ_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead32), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_PeekMem(&CmdPacket, SrcAddress);
+ /* Execute the function being tested */
+ Result = MM_PeekMem(&CmdPacket, SrcAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=%d, Address=%p, MemType=MEM%u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=%d, Address=%p, MemType=MEM%u");
}
-void Test_MM_PeekMem_DefaultSwitch(void) {
- MM_PeekCmd_t CmdPacket;
- uint32 SrcAddress = 1;
- int32 Result;
+void Test_MM_PeekMem_DefaultSwitch(void)
+{
+ MM_PeekCmd_t CmdPacket;
+ uint32 SrcAddress = 1;
+ int32 Result;
- CmdPacket.Payload.DataSize = 99;
+ CmdPacket.Payload.DataSize = 99;
- /* Execute the function being tested */
- Result = MM_PeekMem(&CmdPacket, SrcAddress);
+ /* Execute the function being tested */
+ Result = MM_PeekMem(&CmdPacket, SrcAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=%d, Address=%p, MemType=MEM%u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=%d, Address=%p, MemType=MEM%u");
}
-void Test_MM_DumpMemToFile_Nominal(void) {
- osal_id_t FileHandle = MM_UT_OBJID_1;
- char FileName[CFE_MISSION_MAX_PATH_LEN];
- MM_LoadDumpFileHeader_t FileHeader;
- int32 Result;
-
- strncpy(FileName, "filename", sizeof(FileName) - 1);
- FileName[sizeof(FileName) - 1] = '\0';
-
- FileHeader.NumOfBytes = 1;
- /* a valid source address is required input to memcpy */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(&MM_AppData.LoadBuffer[0]);
- FileHeader.MemType = MM_MemType_RAM;
-
- /* Execute the function being tested */
- Result = MM_DumpMemToFile(FileHandle, FileName, &FileHeader);
-
- /* Verify results */
- UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == FileHeader.MemType,
- "MM_AppData.HkTlm.Payload.MemType == FileHeader.MemType");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
- CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 1,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 1");
- UtAssert_STRINGBUF_EQ(MM_AppData.HkTlm.Payload.FileName,
- sizeof(MM_AppData.HkTlm.Payload.FileName), FileName,
- sizeof(FileName));
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_DumpMemToFile_Nominal(void)
+{
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ char FileName[CFE_MISSION_MAX_PATH_LEN];
+ MM_LoadDumpFileHeader_t FileHeader;
+ int32 Result;
+
+ strncpy(FileName, "filename", sizeof(FileName) - 1);
+ FileName[sizeof(FileName) - 1] = '\0';
+
+ FileHeader.NumOfBytes = 1;
+ /* a valid source address is required input to memcpy */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(&MM_AppData.LoadBuffer[0]);
+ FileHeader.MemType = MM_MemType_RAM;
+
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFile(FileHandle, FileName, &FileHeader);
+
+ /* Verify results */
+ UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == FileHeader.MemType,
+ "MM_AppData.HkTlm.Payload.MemType == FileHeader.MemType");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
+ CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 1, "MM_AppData.HkTlm.Payload.BytesProcessed == 1");
+ UtAssert_STRINGBUF_EQ(MM_AppData.HkTlm.Payload.FileName,
+ sizeof(MM_AppData.HkTlm.Payload.FileName),
+ FileName,
+ sizeof(FileName));
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpMemToFile_CPUHogging(void) {
- osal_id_t FileHandle = MM_UT_OBJID_1;
- char FileName[CFE_MISSION_MAX_PATH_LEN];
- MM_LoadDumpFileHeader_t FileHeader;
- int32 Result;
- char Data[2 * MM_INTERNAL_MAX_DUMP_DATA_SEG] = {0};
-
- strncpy(FileName, "filename", sizeof(FileName) - 1);
- FileName[sizeof(FileName) - 1] = '\0';
-
- FileHeader.NumOfBytes = sizeof(Data);
- /* a valid source address is required input to memcpy */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(Data);
- FileHeader.MemType = MM_MemType_RAM;
-
- /* Execute the function being tested */
- Result = MM_DumpMemToFile(FileHandle, FileName, &FileHeader);
-
- /* Verify results */
- UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == FileHeader.MemType,
- "MM_AppData.HkTlm.Payload.MemType == FileHeader.MemType");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
- CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed ==
- 2 * MM_INTERNAL_MAX_DUMP_DATA_SEG,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 2 * "
- "MM_INTERNAL_MAX_DUMP_DATA_SEG");
- UtAssert_STRINGBUF_EQ(MM_AppData.HkTlm.Payload.FileName,
- sizeof(MM_AppData.HkTlm.Payload.FileName), FileName,
- sizeof(FileName));
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_DumpMemToFile_CPUHogging(void)
+{
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ char FileName[CFE_MISSION_MAX_PATH_LEN];
+ MM_LoadDumpFileHeader_t FileHeader;
+ int32 Result;
+ char Data[2 * MM_INTERNAL_MAX_DUMP_DATA_SEG] = { 0 };
+
+ strncpy(FileName, "filename", sizeof(FileName) - 1);
+ FileName[sizeof(FileName) - 1] = '\0';
+
+ FileHeader.NumOfBytes = sizeof(Data);
+ /* a valid source address is required input to memcpy */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(Data);
+ FileHeader.MemType = MM_MemType_RAM;
+
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFile(FileHandle, FileName, &FileHeader);
+
+ /* Verify results */
+ UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == FileHeader.MemType,
+ "MM_AppData.HkTlm.Payload.MemType == FileHeader.MemType");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
+ CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2 * MM_INTERNAL_MAX_DUMP_DATA_SEG,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == 2 * "
+ "MM_INTERNAL_MAX_DUMP_DATA_SEG");
+ UtAssert_STRINGBUF_EQ(MM_AppData.HkTlm.Payload.FileName,
+ sizeof(MM_AppData.HkTlm.Payload.FileName),
+ FileName,
+ sizeof(FileName));
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpMemToFile_WriteError(void) {
- osal_id_t FileHandle = MM_UT_OBJID_1;
- char FileName[CFE_MISSION_MAX_PATH_LEN];
- MM_LoadDumpFileHeader_t FileHeader;
- int32 Result;
+void Test_MM_DumpMemToFile_WriteError(void)
+{
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ char FileName[CFE_MISSION_MAX_PATH_LEN];
+ MM_LoadDumpFileHeader_t FileHeader;
+ int32 Result;
- strncpy(FileName, "filename", sizeof(FileName) - 1);
- FileName[sizeof(FileName) - 1] = '\0';
+ strncpy(FileName, "filename", sizeof(FileName) - 1);
+ FileName[sizeof(FileName) - 1] = '\0';
- FileHeader.NumOfBytes = 1;
- /* a valid source address is required input to memcpy */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(&MM_AppData.LoadBuffer[0]);
- FileHeader.MemType = MM_MemType_RAM;
+ FileHeader.NumOfBytes = 1;
+ /* a valid source address is required input to memcpy */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(&MM_AppData.LoadBuffer[0]);
+ FileHeader.MemType = MM_MemType_RAM;
- /* Set to generate error message MM_OS_WRITE_EXP_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(OS_write), 1, OS_ERROR);
+ /* Set to generate error message MM_OS_WRITE_EXP_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(OS_write), 1, OS_ERROR);
- /* Execute the function being tested */
- Result = MM_DumpMemToFile(FileHandle, FileName, &FileHeader);
+ /* Execute the function being tested */
+ Result = MM_DumpMemToFile(FileHandle, FileName, &FileHeader);
- /* Verify results */
- UtAssert_True(Result == OS_ERROR, "Result == OS_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == OS_ERROR, "Result == OS_ERROR");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_WRITE_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_write error received: RC = %d, Expected = %u, File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_WRITE_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_write error received: RC = %d, Expected = %u, File = '%s'");
}
-void Test_MM_WriteFileHeaders_Nominal(void) {
- char FileName[CFE_MISSION_MAX_PATH_LEN];
- osal_id_t FileHandle = MM_UT_OBJID_1;
- CFE_FS_Header_t CFEHeader;
- MM_LoadDumpFileHeader_t MMHeader;
- int32 Result;
+void Test_MM_WriteFileHeaders_Nominal(void)
+{
+ char FileName[CFE_MISSION_MAX_PATH_LEN];
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ CFE_FS_Header_t CFEHeader;
+ MM_LoadDumpFileHeader_t MMHeader;
+ int32 Result;
- strncpy(FileName, "filename", sizeof(FileName) - 1);
- FileName[sizeof(FileName) - 1] = '\0';
+ strncpy(FileName, "filename", sizeof(FileName) - 1);
+ FileName[sizeof(FileName) - 1] = '\0';
- MMHeader.NumOfBytes = 1;
- MMHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- MMHeader.MemType = MM_MemType_RAM;
+ MMHeader.NumOfBytes = 1;
+ MMHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ MMHeader.MemType = MM_MemType_RAM;
- UT_SetDefaultReturnValue(UT_KEY(CFE_FS_WriteHeader), sizeof(CFE_FS_Header_t));
+ UT_SetDefaultReturnValue(UT_KEY(CFE_FS_WriteHeader), sizeof(CFE_FS_Header_t));
- /* Execute the function being tested */
- Result = MM_WriteFileHeaders(FileName, FileHandle, &CFEHeader, &MMHeader);
+ /* Execute the function being tested */
+ Result = MM_WriteFileHeaders(FileName, FileHandle, &CFEHeader, &MMHeader);
- /* Verify results */
- UtAssert_INT32_EQ(Result, OS_SUCCESS);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, OS_SUCCESS);
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_WriteFileHeaders_WriteHeaderError(void) {
- char FileName[CFE_MISSION_MAX_PATH_LEN];
- osal_id_t FileHandle = MM_UT_OBJID_1;
- CFE_FS_Header_t CFEHeader;
- MM_LoadDumpFileHeader_t MMHeader;
- int32 Result;
+void Test_MM_WriteFileHeaders_WriteHeaderError(void)
+{
+ char FileName[CFE_MISSION_MAX_PATH_LEN];
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ CFE_FS_Header_t CFEHeader;
+ MM_LoadDumpFileHeader_t MMHeader;
+ int32 Result;
- strncpy(FileName, "filename", sizeof(FileName) - 1);
- FileName[sizeof(FileName) - 1] = '\0';
+ strncpy(FileName, "filename", sizeof(FileName) - 1);
+ FileName[sizeof(FileName) - 1] = '\0';
- MMHeader.NumOfBytes = 1;
- MMHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- MMHeader.MemType = MM_MemType_RAM;
+ MMHeader.NumOfBytes = 1;
+ MMHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ MMHeader.MemType = MM_MemType_RAM;
- /* Set to generate error message MM_CFE_FS_WRITEHDR_ERR_EID */
- UT_SetDefaultReturnValue(UT_KEY(CFE_FS_WriteHeader), CFE_FS_BAD_ARGUMENT);
+ /* Set to generate error message MM_CFE_FS_WRITEHDR_ERR_EID */
+ UT_SetDefaultReturnValue(UT_KEY(CFE_FS_WriteHeader), CFE_FS_BAD_ARGUMENT);
- /* Execute the function being tested */
- Result = MM_WriteFileHeaders(FileName, FileHandle, &CFEHeader, &MMHeader);
+ /* Execute the function being tested */
+ Result = MM_WriteFileHeaders(FileName, FileHandle, &CFEHeader, &MMHeader);
- /* Verify results */
- UtAssert_INT32_EQ(Result, OS_ERR_INVALID_SIZE);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, OS_ERR_INVALID_SIZE);
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_CFE_FS_WRITEHDR_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_FS_WriteHeader error received: RC = %d Expected = %d File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_CFE_FS_WRITEHDR_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_FS_WriteHeader error received: RC = %d Expected = %d File = '%s'");
}
-void Test_MM_WriteFileHeaders_WriteError(void) {
- char FileName[CFE_MISSION_MAX_PATH_LEN];
- osal_id_t FileHandle = MM_UT_OBJID_1;
- CFE_FS_Header_t CFEHeader;
- MM_LoadDumpFileHeader_t MMHeader;
- int32 Result;
+void Test_MM_WriteFileHeaders_WriteError(void)
+{
+ char FileName[CFE_MISSION_MAX_PATH_LEN];
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ CFE_FS_Header_t CFEHeader;
+ MM_LoadDumpFileHeader_t MMHeader;
+ int32 Result;
- strncpy(FileName, "filename", sizeof(FileName) - 1);
- FileName[sizeof(FileName) - 1] = '\0';
+ strncpy(FileName, "filename", sizeof(FileName) - 1);
+ FileName[sizeof(FileName) - 1] = '\0';
- MMHeader.NumOfBytes = 1;
- MMHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- MMHeader.MemType = MM_MemType_RAM;
+ MMHeader.NumOfBytes = 1;
+ MMHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ MMHeader.MemType = MM_MemType_RAM;
- /* Set to generate error message MM_CFE_FS_WRITEHDR_ERR_EID */
- UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR);
+ /* Set to generate error message MM_CFE_FS_WRITEHDR_ERR_EID */
+ UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR);
- /* Execute the function being tested */
- Result = MM_WriteFileHeaders(FileName, FileHandle, &CFEHeader, &MMHeader);
+ /* Execute the function being tested */
+ Result = MM_WriteFileHeaders(FileName, FileHandle, &CFEHeader, &MMHeader);
- /* Verify results */
- UtAssert_INT32_EQ(Result, OS_ERR_INVALID_SIZE);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, OS_ERR_INVALID_SIZE);
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_WRITE_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_write error received: RC = %d Expected = %u File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_WRITE_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_write error received: RC = %d Expected = %u File = '%s'");
}
-void Test_MM_FillDumpInEventBuffer_RAM(void) {
- MM_DumpInEventCmd_t CmdPacket;
- /* a valid source address is required input to memcpy */
- cpuaddr SrcAddress = (cpuaddr)&MM_AppData.LoadBuffer[0];
- int32 Result;
+void Test_MM_FillDumpInEventBuffer_RAM(void)
+{
+ MM_DumpInEventCmd_t CmdPacket;
+ /* a valid source address is required input to memcpy */
+ cpuaddr SrcAddress = (cpuaddr)&MM_AppData.LoadBuffer[0];
+ int32 Result;
- CmdPacket.Payload.MemType = MM_MemType_RAM;
- CmdPacket.Payload.NumOfBytes = 1;
- CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+ CmdPacket.Payload.NumOfBytes = 1;
+ CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- /* Execute the function being tested */
- Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket,
- (uint8 *)(&MM_AppData.DumpBuffer[0]));
+ /* Execute the function being tested */
+ Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket, (uint8 *)(&MM_AppData.DumpBuffer[0]));
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillDumpInEventBuffer_BadType(void) {
- MM_DumpInEventCmd_t CmdPacket;
- /* a valid source address is required input to memcpy */
- cpuaddr SrcAddress = (cpuaddr)&MM_AppData.LoadBuffer[0];
- int32 Result;
+void Test_MM_FillDumpInEventBuffer_BadType(void)
+{
+ MM_DumpInEventCmd_t CmdPacket;
+ /* a valid source address is required input to memcpy */
+ cpuaddr SrcAddress = (cpuaddr)&MM_AppData.LoadBuffer[0];
+ int32 Result;
- CmdPacket.Payload.MemType = 99;
- CmdPacket.Payload.NumOfBytes = 1;
- CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ CmdPacket.Payload.MemType = 99;
+ CmdPacket.Payload.NumOfBytes = 1;
+ CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- /* Execute the function being tested */
- Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket,
- (uint8 *)(&MM_AppData.DumpBuffer[0]));
+ /* Execute the function being tested */
+ Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket, (uint8 *)(&MM_AppData.DumpBuffer[0]));
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillDumpInEventBuffer_EEPROM(void) {
- MM_DumpInEventCmd_t CmdPacket;
- /* a valid source address is required input to memcpy */
- cpuaddr SrcAddress = (cpuaddr)&MM_AppData.LoadBuffer[0];
- int32 Result;
+void Test_MM_FillDumpInEventBuffer_EEPROM(void)
+{
+ MM_DumpInEventCmd_t CmdPacket;
+ /* a valid source address is required input to memcpy */
+ cpuaddr SrcAddress = (cpuaddr)&MM_AppData.LoadBuffer[0];
+ int32 Result;
- CmdPacket.Payload.MemType = MM_MemType_EEPROM;
- CmdPacket.Payload.NumOfBytes = 1;
- CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ CmdPacket.Payload.MemType = MM_MemType_EEPROM;
+ CmdPacket.Payload.NumOfBytes = 1;
+ CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- /* Execute the function being tested */
- Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket,
- (uint8 *)(&MM_AppData.DumpBuffer[0]));
+ /* Execute the function being tested */
+ Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket, (uint8 *)(&MM_AppData.DumpBuffer[0]));
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillDumpInEventBuffer_MEM32(void) {
- MM_DumpInEventCmd_t CmdPacket;
- /* CFE_PSP_MemRead32 stub returns success with non-zero address */
- cpuaddr SrcAddress = 1;
- int32 Result;
+void Test_MM_FillDumpInEventBuffer_MEM32(void)
+{
+ MM_DumpInEventCmd_t CmdPacket;
+ /* CFE_PSP_MemRead32 stub returns success with non-zero address */
+ cpuaddr SrcAddress = 1;
+ int32 Result;
- CmdPacket.Payload.MemType = MM_MemType_MEM32;
- CmdPacket.Payload.NumOfBytes = 4;
- CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ CmdPacket.Payload.MemType = MM_MemType_MEM32;
+ CmdPacket.Payload.NumOfBytes = 4;
+ CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- /* Execute the function being tested */
- Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket,
- (uint8 *)(&MM_AppData.DumpBuffer[0]));
+ /* Execute the function being tested */
+ Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket, (uint8 *)(&MM_AppData.DumpBuffer[0]));
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillDumpInEventBuffer_MEM16(void) {
- MM_DumpInEventCmd_t CmdPacket;
- /* CFE_PSP_MemRead16 stub returns success with non-zero address */
- cpuaddr SrcAddress = 1;
- int32 Result;
+void Test_MM_FillDumpInEventBuffer_MEM16(void)
+{
+ MM_DumpInEventCmd_t CmdPacket;
+ /* CFE_PSP_MemRead16 stub returns success with non-zero address */
+ cpuaddr SrcAddress = 1;
+ int32 Result;
- CmdPacket.Payload.MemType = MM_MemType_MEM16;
- CmdPacket.Payload.NumOfBytes = 2;
- CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ CmdPacket.Payload.MemType = MM_MemType_MEM16;
+ CmdPacket.Payload.NumOfBytes = 2;
+ CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- /* Execute the function being tested */
- Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket,
- (uint8 *)(&MM_AppData.DumpBuffer[0]));
+ /* Execute the function being tested */
+ Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket, (uint8 *)(&MM_AppData.DumpBuffer[0]));
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillDumpInEventBuffer_MEM8(void) {
- MM_DumpInEventCmd_t CmdPacket;
- cpuaddr SrcAddress = 0;
- int32 Result;
+void Test_MM_FillDumpInEventBuffer_MEM8(void)
+{
+ MM_DumpInEventCmd_t CmdPacket;
+ cpuaddr SrcAddress = 0;
+ int32 Result;
- CmdPacket.Payload.MemType = MM_MemType_MEM8;
- CmdPacket.Payload.NumOfBytes = 1;
- CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ CmdPacket.Payload.MemType = MM_MemType_MEM8;
+ CmdPacket.Payload.NumOfBytes = 1;
+ CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- /* Execute the function being tested */
- Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket,
- (uint8 *)(&MM_AppData.DumpBuffer[0]));
+ /* Execute the function being tested */
+ Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket, (uint8 *)(&MM_AppData.DumpBuffer[0]));
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillDumpInEventBuffer_MEM32ReadError(void) {
- MM_DumpInEventCmd_t CmdPacket;
- cpuaddr SrcAddress = 0;
- int32 Result;
+void Test_MM_FillDumpInEventBuffer_MEM32ReadError(void)
+{
+ MM_DumpInEventCmd_t CmdPacket;
+ cpuaddr SrcAddress = 0;
+ int32 Result;
- CmdPacket.Payload.MemType = MM_MemType_MEM32;
- CmdPacket.Payload.NumOfBytes = 4;
- CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ CmdPacket.Payload.MemType = MM_MemType_MEM32;
+ CmdPacket.Payload.NumOfBytes = 4;
+ CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- /* Set to generate error message MM_PSP_READ_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead32), 1, CFE_PSP_ERROR);
+ /* Set to generate error message MM_PSP_READ_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead32), 1, CFE_PSP_ERROR);
- /* Execute the function being tested */
- Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket,
- (uint8 *)(&MM_AppData.DumpBuffer[0]));
+ /* Execute the function being tested */
+ Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket, (uint8 *)(&MM_AppData.DumpBuffer[0]));
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM32");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM32");
}
-void Test_MM_FillDumpInEventBuffer_MEM16ReadError(void) {
- MM_DumpInEventCmd_t CmdPacket;
- cpuaddr SrcAddress = 0;
- int32 Result;
+void Test_MM_FillDumpInEventBuffer_MEM16ReadError(void)
+{
+ MM_DumpInEventCmd_t CmdPacket;
+ cpuaddr SrcAddress = 0;
+ int32 Result;
- CmdPacket.Payload.MemType = MM_MemType_MEM16;
- CmdPacket.Payload.NumOfBytes = 4;
- CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ CmdPacket.Payload.MemType = MM_MemType_MEM16;
+ CmdPacket.Payload.NumOfBytes = 4;
+ CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- /* Set to generate error message MM_PSP_READ_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead16), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_READ_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead16), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket,
- (uint8 *)(&MM_AppData.DumpBuffer[0]));
+ /* Execute the function being tested */
+ Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket, (uint8 *)(&MM_AppData.DumpBuffer[0]));
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM16");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM16");
}
-void Test_MM_FillDumpInEventBuffer_MEM8ReadError(void) {
- MM_DumpInEventCmd_t CmdPacket;
- cpuaddr SrcAddress = 0;
- int32 Result;
+void Test_MM_FillDumpInEventBuffer_MEM8ReadError(void)
+{
+ MM_DumpInEventCmd_t CmdPacket;
+ cpuaddr SrcAddress = 0;
+ int32 Result;
- CmdPacket.Payload.MemType = MM_MemType_MEM8;
- CmdPacket.Payload.NumOfBytes = 4;
- CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ CmdPacket.Payload.MemType = MM_MemType_MEM8;
+ CmdPacket.Payload.NumOfBytes = 4;
+ CmdPacket.Payload.SrcSymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- /* Set to generate error message MM_PSP_READ_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead8), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_READ_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead8), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket,
- (uint8 *)(&MM_AppData.DumpBuffer[0]));
+ /* Execute the function being tested */
+ Result = MM_FillDumpInEventBuffer(SrcAddress, &CmdPacket, (uint8 *)(&MM_AppData.DumpBuffer[0]));
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM8");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=%d, Src=%p, Tgt=%p, Type=MEM8");
}
/*
* Register the test cases to execute with the unit test tool
*/
-void UtTest_Setup(void) {
- ADD_TEST(Test_MM_PeekMem_Byte);
- ADD_TEST(Test_MM_PeekMem_ByteError);
- ADD_TEST(Test_MM_PeekMem_Word);
- ADD_TEST(Test_MM_PeekMem_WordError);
- ADD_TEST(Test_MM_PeekMem_DWord);
- ADD_TEST(Test_MM_PeekMem_DWordError);
- ADD_TEST(Test_MM_PeekMem_DefaultSwitch);
- ADD_TEST(Test_MM_DumpMemToFile_Nominal);
- ADD_TEST(Test_MM_DumpMemToFile_CPUHogging);
- ADD_TEST(Test_MM_DumpMemToFile_WriteError);
- ADD_TEST(Test_MM_WriteFileHeaders_Nominal);
- ADD_TEST(Test_MM_WriteFileHeaders_WriteHeaderError);
- ADD_TEST(Test_MM_WriteFileHeaders_WriteError);
- ADD_TEST(Test_MM_FillDumpInEventBuffer_RAM);
- ADD_TEST(Test_MM_FillDumpInEventBuffer_BadType);
- ADD_TEST(Test_MM_FillDumpInEventBuffer_EEPROM);
- ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM32);
- ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM16);
- ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM8);
- ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM32ReadError);
- ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM16ReadError);
- ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM8ReadError);
+void UtTest_Setup(void)
+{
+ ADD_TEST(Test_MM_PeekMem_Byte);
+ ADD_TEST(Test_MM_PeekMem_ByteError);
+ ADD_TEST(Test_MM_PeekMem_Word);
+ ADD_TEST(Test_MM_PeekMem_WordError);
+ ADD_TEST(Test_MM_PeekMem_DWord);
+ ADD_TEST(Test_MM_PeekMem_DWordError);
+ ADD_TEST(Test_MM_PeekMem_DefaultSwitch);
+ ADD_TEST(Test_MM_DumpMemToFile_Nominal);
+ ADD_TEST(Test_MM_DumpMemToFile_CPUHogging);
+ ADD_TEST(Test_MM_DumpMemToFile_WriteError);
+ ADD_TEST(Test_MM_WriteFileHeaders_Nominal);
+ ADD_TEST(Test_MM_WriteFileHeaders_WriteHeaderError);
+ ADD_TEST(Test_MM_WriteFileHeaders_WriteError);
+ ADD_TEST(Test_MM_FillDumpInEventBuffer_RAM);
+ ADD_TEST(Test_MM_FillDumpInEventBuffer_BadType);
+ ADD_TEST(Test_MM_FillDumpInEventBuffer_EEPROM);
+ ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM32);
+ ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM16);
+ ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM8);
+ ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM32ReadError);
+ ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM16ReadError);
+ ADD_TEST(Test_MM_FillDumpInEventBuffer_MEM8ReadError);
}
diff --git a/unit-test/mm_eds_dispatch_tests.c b/unit-test/mm_eds_dispatch_tests.c
index 135bea9..b3e91b2 100644
--- a/unit-test/mm_eds_dispatch_tests.c
+++ b/unit-test/mm_eds_dispatch_tests.c
@@ -46,23 +46,24 @@
**********************************************************************************
*/
-void Test_MM_TaskPipe(void) {
- /*
- * Test Case For:
- * void MM_TaskPipe
- */
- CFE_SB_Buffer_t UtBuf;
+void Test_MM_TaskPipe(void)
+{
+ /*
+ * Test Case For:
+ * void MM_TaskPipe
+ */
+ CFE_SB_Buffer_t UtBuf;
- UT_SetDeferredRetcode(UT_KEY(CFE_EDSMSG_Dispatch), 1, CFE_SUCCESS);
+ UT_SetDeferredRetcode(UT_KEY(CFE_EDSMSG_Dispatch), 1, CFE_SUCCESS);
- memset(&UtBuf, 0, sizeof(UtBuf));
- UtAssert_VOIDCALL(MM_TaskPipe(&UtBuf));
+ memset(&UtBuf, 0, sizeof(UtBuf));
+ UtAssert_VOIDCALL(MM_TaskPipe(&UtBuf));
}
/*
* Register the test cases to execute with the unit test tool
*/
-void UtTest_Setup(void) {
- UtTest_Add(Test_MM_TaskPipe, MM_Test_Setup, MM_Test_TearDown,
- "Test_MM_TaskPipe");
+void UtTest_Setup(void)
+{
+ UtTest_Add(Test_MM_TaskPipe, MM_Test_Setup, MM_Test_TearDown, "Test_MM_TaskPipe");
}
diff --git a/unit-test/mm_load_tests.c b/unit-test/mm_load_tests.c
index d774cad..8f15596 100644
--- a/unit-test/mm_load_tests.c
+++ b/unit-test/mm_load_tests.c
@@ -53,888 +53,891 @@
* Function Definitions
*/
-void Test_MM_PokeMem_NoDataSize(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
-
- CmdPacket.Payload.MemType = MM_MemType_RAM;
- CmdPacket.Payload.DataSize = 0;
- DestAddress = 1;
-
- /* Execute the function being tested */
- Result = MM_PokeMem(&CmdPacket, DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM%u");
+void Test_MM_PokeMem_NoDataSize(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
+
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+ CmdPacket.Payload.DataSize = 0;
+ DestAddress = 1;
+
+ /* Execute the function being tested */
+ Result = MM_PokeMem(&CmdPacket, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM%u");
}
-void Test_MM_PokeMem_8bit(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
-
- CmdPacket.Payload.MemType = MM_MemType_RAM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint8)(5);
- DestAddress = 1;
-
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemWrite8), CFE_PSP_SUCCESS);
-
- /* Execute the function being tested */
- Result = MM_PokeMem(&CmdPacket, DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
-
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5,
- "MM_AppData.HkTlm.Payload.DataValue == 5");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 1,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 1");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_POKE_BYTE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Poke Command: Addr = %p, Size = %u bits, Data = 0x%08X");
+void Test_MM_PokeMem_8bit(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
+
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint8)(5);
+ DestAddress = 1;
+
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemWrite8), CFE_PSP_SUCCESS);
+
+ /* Execute the function being tested */
+ Result = MM_PokeMem(&CmdPacket, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5, "MM_AppData.HkTlm.Payload.DataValue == 5");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 1, "MM_AppData.HkTlm.Payload.BytesProcessed == 1");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_POKE_BYTE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Poke Command: Addr = %p, Size = %u bits, Data = 0x%08X");
}
-void Test_MM_PokeMem_8bitError(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
+void Test_MM_PokeMem_8bitError(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
- CmdPacket.Payload.MemType = MM_MemType_RAM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint8)(5);
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint8)(5);
- /* CFE_PSP_MemWrite8 stub returns success with non-zero address */
- DestAddress = 0;
+ /* CFE_PSP_MemWrite8 stub returns success with non-zero address */
+ DestAddress = 0;
- /* Set to generate error message MM_PSP_WRITE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite8), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_WRITE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite8), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_PokeMem(&CmdPacket, DestAddress);
+ /* Execute the function being tested */
+ Result = MM_PokeMem(&CmdPacket, DestAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM%u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM%u");
}
-void Test_MM_PokeMem_16bit(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
+void Test_MM_PokeMem_16bit(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
- CmdPacket.Payload.MemType = MM_MemType_RAM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint16)(5);
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint16)(5);
- DestAddress = 1;
+ DestAddress = 1;
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemWrite16), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemWrite16), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result = MM_PokeMem(&CmdPacket, DestAddress);
+ /* Execute the function being tested */
+ Result = MM_PokeMem(&CmdPacket, DestAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5,
- "MM_AppData.HkTlm.Payload.DataValue == 5");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 2");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5, "MM_AppData.HkTlm.Payload.DataValue == 5");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2, "MM_AppData.HkTlm.Payload.BytesProcessed == 2");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_POKE_WORD_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Poke Command: Addr = %p, Size = %u bits, Data = 0x%08X");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_POKE_WORD_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Poke Command: Addr = %p, Size = %u bits, Data = 0x%08X");
}
-void Test_MM_PokeMem_16bitError(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
+void Test_MM_PokeMem_16bitError(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
- CmdPacket.Payload.MemType = MM_MemType_RAM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint16)(5);
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint16)(5);
- /* CFE_PSP_MemWrite16 stub returns success with non-zero address */
- DestAddress = 0;
+ /* CFE_PSP_MemWrite16 stub returns success with non-zero address */
+ DestAddress = 0;
- /* Set to generate error message MM_PSP_WRITE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite16), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_WRITE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite16), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_PokeMem(&CmdPacket, DestAddress);
+ /* Execute the function being tested */
+ Result = MM_PokeMem(&CmdPacket, DestAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM%u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM%u");
}
-void Test_MM_PokeMem_32bit(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
-
- CmdPacket.Payload.MemType = MM_MemType_RAM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint32)(5);
-
- DestAddress = 1;
-
- /* Execute the function being tested */
- Result = MM_PokeMem(&CmdPacket, DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
-
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5,
- "MM_AppData.HkTlm.Payload.DataValue == 5");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 4,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 4");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_POKE_DWORD_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Poke Command: Addr = %p, Size = %u bits, Data = 0x%08X");
+void Test_MM_PokeMem_32bit(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
+
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint32)(5);
+
+ DestAddress = 1;
+
+ /* Execute the function being tested */
+ Result = MM_PokeMem(&CmdPacket, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_RAM");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5, "MM_AppData.HkTlm.Payload.DataValue == 5");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 4, "MM_AppData.HkTlm.Payload.BytesProcessed == 4");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_POKE_DWORD_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Poke Command: Addr = %p, Size = %u bits, Data = 0x%08X");
}
-void Test_MM_PokeMem_32bitError(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
+void Test_MM_PokeMem_32bitError(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
- CmdPacket.Payload.MemType = MM_MemType_RAM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint32)(5);
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint32)(5);
- /* CFE_PSP_MemWrite32 stub returns success with non-zero address */
- DestAddress = 0;
+ /* CFE_PSP_MemWrite32 stub returns success with non-zero address */
+ DestAddress = 0;
- /* Set to generate error message MM_PSP_WRITE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite32), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_WRITE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite32), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_PokeMem(&CmdPacket, DestAddress);
+ /* Execute the function being tested */
+ Result = MM_PokeMem(&CmdPacket, DestAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM%u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM%u");
}
-void Test_MM_PokeEeprom_NoDataSize(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
+void Test_MM_PokeEeprom_NoDataSize(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
- CmdPacket.Payload.MemType = MM_MemType_EEPROM;
- CmdPacket.Payload.DataSize = 0;
+ CmdPacket.Payload.MemType = MM_MemType_EEPROM;
+ CmdPacket.Payload.DataSize = 0;
- DestAddress = 1;
+ DestAddress = 1;
- /* Execute the function being tested */
- Result = MM_PokeEeprom(&CmdPacket, DestAddress);
+ /* Execute the function being tested */
+ Result = MM_PokeEeprom(&CmdPacket, DestAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_PokeEeprom_8bit(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
-
- CmdPacket.Payload.MemType = MM_MemType_EEPROM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint8)(5);
-
- DestAddress = 1;
-
- /* Execute the function being tested */
- Result = MM_PokeEeprom(&CmdPacket, DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
-
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5,
- "MM_AppData.HkTlm.Payload.DataValue == 5");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 1,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 1");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_POKE_BYTE_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Poke Command: Addr = %p, Size = 8 bits, Data = 0x%02X");
+void Test_MM_PokeEeprom_8bit(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
+
+ CmdPacket.Payload.MemType = MM_MemType_EEPROM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint8)(5);
+
+ DestAddress = 1;
+
+ /* Execute the function being tested */
+ Result = MM_PokeEeprom(&CmdPacket, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5, "MM_AppData.HkTlm.Payload.DataValue == 5");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 1, "MM_AppData.HkTlm.Payload.BytesProcessed == 1");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_POKE_BYTE_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Poke Command: Addr = %p, Size = 8 bits, Data = 0x%02X");
}
-void Test_MM_PokeEeprom_8bitError(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
+void Test_MM_PokeEeprom_8bitError(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
- CmdPacket.Payload.MemType = MM_MemType_EEPROM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint8)(5);
+ CmdPacket.Payload.MemType = MM_MemType_EEPROM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_BYTE_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint8)(5);
- /* CFE_PSP_MemWrite8 stub returns success with non-zero address */
- DestAddress = 0;
+ /* CFE_PSP_MemWrite8 stub returns success with non-zero address */
+ DestAddress = 0;
- /* Set to generate error message MM_OS_EEPROMWRITE8_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_EepromWrite8), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_OS_EEPROMWRITE8_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_EepromWrite8), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_PokeEeprom(&CmdPacket, DestAddress);
+ /* Execute the function being tested */
+ Result = MM_PokeEeprom(&CmdPacket, DestAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_EEPROMWRITE8_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_EepromWrite8 error received: RC = 0x%08X, Addr = %p");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_EEPROMWRITE8_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_EepromWrite8 error received: RC = 0x%08X, Addr = %p");
}
-void Test_MM_PokeEeprom_16bit(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
-
- CmdPacket.Payload.MemType = MM_MemType_EEPROM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint16)(5);
-
- DestAddress = 1;
-
- /* Execute the function being tested */
- Result = MM_PokeEeprom(&CmdPacket, DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
-
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5,
- "MM_AppData.HkTlm.Payload.DataValue == 5");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 2");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_POKE_WORD_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Poke Command: Addr = %p, Size = 16 bits, Data = 0x%04X");
+void Test_MM_PokeEeprom_16bit(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
+
+ CmdPacket.Payload.MemType = MM_MemType_EEPROM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint16)(5);
+
+ DestAddress = 1;
+
+ /* Execute the function being tested */
+ Result = MM_PokeEeprom(&CmdPacket, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5, "MM_AppData.HkTlm.Payload.DataValue == 5");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2, "MM_AppData.HkTlm.Payload.BytesProcessed == 2");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_POKE_WORD_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Poke Command: Addr = %p, Size = 16 bits, Data = 0x%04X");
}
-void Test_MM_PokeEeprom_16bitError(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
+void Test_MM_PokeEeprom_16bitError(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
- CmdPacket.Payload.MemType = MM_MemType_EEPROM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint16)(5);
+ CmdPacket.Payload.MemType = MM_MemType_EEPROM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_WORD_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint16)(5);
- /* CFE_PSP_MemWrite16 stub returns success with non-zero address */
- DestAddress = 0;
+ /* CFE_PSP_MemWrite16 stub returns success with non-zero address */
+ DestAddress = 0;
- /* Set to generate error message MM_OS_EEPROMWRITE16_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_EepromWrite16), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_OS_EEPROMWRITE16_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_EepromWrite16), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_PokeEeprom(&CmdPacket, DestAddress);
+ /* Execute the function being tested */
+ Result = MM_PokeEeprom(&CmdPacket, DestAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_EEPROMWRITE16_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_EepromWrite16 error received: RC = 0x%08X, Addr = %p");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_EEPROMWRITE16_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_EepromWrite16 error received: RC = 0x%08X, Addr = %p");
}
-void Test_MM_PokeEeprom_32bit(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
-
- CmdPacket.Payload.MemType = MM_MemType_EEPROM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint32)(5);
-
- DestAddress = 1;
-
- /* Execute the function being tested */
- Result = MM_PokeEeprom(&CmdPacket, DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
-
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5,
- "MM_AppData.HkTlm.Payload.DataValue == 5");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 4,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 4");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_POKE_DWORD_INF_EID, CFE_EVS_EventType_INFORMATION,
- "Poke Command: Addr = %p, Size = 32 bits, Data = 0x%08X");
+void Test_MM_PokeEeprom_32bit(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
+
+ CmdPacket.Payload.MemType = MM_MemType_EEPROM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint32)(5);
+
+ DestAddress = 1;
+
+ /* Execute the function being tested */
+ Result = MM_PokeEeprom(&CmdPacket, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_POKE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == 5, "MM_AppData.HkTlm.Payload.DataValue == 5");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 4, "MM_AppData.HkTlm.Payload.BytesProcessed == 4");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_POKE_DWORD_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "Poke Command: Addr = %p, Size = 32 bits, Data = 0x%08X");
}
-void Test_MM_PokeEeprom_32bitError(void) {
- MM_PokeCmd_t CmdPacket;
- cpuaddr DestAddress;
- CFE_Status_t Result;
+void Test_MM_PokeEeprom_32bitError(void)
+{
+ MM_PokeCmd_t CmdPacket;
+ cpuaddr DestAddress;
+ CFE_Status_t Result;
- CmdPacket.Payload.MemType = MM_MemType_EEPROM;
- CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
- CmdPacket.Payload.Data = (uint32)(5);
+ CmdPacket.Payload.MemType = MM_MemType_EEPROM;
+ CmdPacket.Payload.DataSize = MM_INTERNAL_DWORD_BIT_WIDTH;
+ CmdPacket.Payload.Data = (uint32)(5);
- /* CFE_PSP_MemWrite32 stub returns success with non-zero address */
- DestAddress = 0;
+ /* CFE_PSP_MemWrite32 stub returns success with non-zero address */
+ DestAddress = 0;
- /* Set to generate error message MM_OS_EEPROMWRITE32_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_EepromWrite32), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_OS_EEPROMWRITE32_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_EepromWrite32), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_PokeEeprom(&CmdPacket, DestAddress);
+ /* Execute the function being tested */
+ Result = MM_PokeEeprom(&CmdPacket, DestAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_EEPROMWRITE32_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_EepromWrite32 error received: RC = 0x%08X, Addr = %p");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_EEPROMWRITE32_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_EepromWrite32 error received: RC = 0x%08X, Addr = %p");
}
-void Test_MM_LoadMemFromFile_PreventCPUHogging(void) {
- int32 Result;
- MM_LoadDumpFileHeader_t FileHeader;
- char FileName[] = "filename";
- cpuaddr DestAddress;
- uint8 OutBuff[(2 * MM_INTERNAL_MAX_LOAD_DATA_SEG) + 2];
-
- memset(MM_AppData.LoadBuffer, 0,
- sizeof(uint32) * (MM_INTERNAL_MAX_LOAD_DATA_SEG / 4));
- FileHeader.MemType = MM_MemType_EEPROM;
- FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
- DestAddress = (cpuaddr)OutBuff;
-
- /* Set to satisfy condition "(ReadLength = OS_read(FileHandle, ioBuffer,
- * SegmentSize)) == SegmentSize" */
- UT_SetDefaultReturnValue(UT_KEY(OS_read), MM_INTERNAL_MAX_LOAD_DATA_SEG);
-
- /* Execute the function being tested */
- Result =
- MM_LoadMemFromFile(MM_UT_OBJID_1, FileName, &FileHeader, DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed ==
- 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG,
- "MM_AppData.HkTlm.Payload.BytesProcessed == "
- "2*MM_INTERNAL_MAX_LOAD_DATA_SEG");
- UtAssert_STRINGBUF_EQ(MM_AppData.HkTlm.Payload.FileName,
- sizeof(MM_AppData.HkTlm.Payload.FileName), FileName,
- sizeof(FileName));
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_LoadMemFromFile_PreventCPUHogging(void)
+{
+ int32 Result;
+ MM_LoadDumpFileHeader_t FileHeader;
+ char FileName[] = "filename";
+ cpuaddr DestAddress;
+ uint8 OutBuff[(2 * MM_INTERNAL_MAX_LOAD_DATA_SEG) + 2];
+
+ memset(MM_AppData.LoadBuffer, 0, sizeof(uint32) * (MM_INTERNAL_MAX_LOAD_DATA_SEG / 4));
+ FileHeader.MemType = MM_MemType_EEPROM;
+ FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ DestAddress = (cpuaddr)OutBuff;
+
+ /* Set to satisfy condition "(ReadLength = OS_read(FileHandle, ioBuffer,
+ * SegmentSize)) == SegmentSize" */
+ UT_SetDefaultReturnValue(UT_KEY(OS_read), MM_INTERNAL_MAX_LOAD_DATA_SEG);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFile(MM_UT_OBJID_1, FileName, &FileHeader, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_EEPROM");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == "
+ "2*MM_INTERNAL_MAX_LOAD_DATA_SEG");
+ UtAssert_STRINGBUF_EQ(MM_AppData.HkTlm.Payload.FileName,
+ sizeof(MM_AppData.HkTlm.Payload.FileName),
+ FileName,
+ sizeof(FileName));
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_LoadMemFromFile_ReadError(void) {
- int32 Result;
- MM_LoadDumpFileHeader_t FileHeader;
- cpuaddr DestAddress;
+void Test_MM_LoadMemFromFile_ReadError(void)
+{
+ int32 Result;
+ MM_LoadDumpFileHeader_t FileHeader;
+ cpuaddr DestAddress;
- FileHeader.MemType = MM_MemType_EEPROM;
- FileHeader.NumOfBytes = 2;
- DestAddress = 0;
+ FileHeader.MemType = MM_MemType_EEPROM;
+ FileHeader.NumOfBytes = 2;
+ DestAddress = 0;
- /* Set to generate error message MM_OS_READ_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(OS_read), 1, 0);
+ /* Set to generate error message MM_OS_READ_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(OS_read), 1, 0);
- /* Execute the function being tested */
- Result = MM_LoadMemFromFile(MM_UT_OBJID_1, (char *)"filename", &FileHeader,
- DestAddress);
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFile(MM_UT_OBJID_1, (char *)"filename", &FileHeader, DestAddress);
- /* Verify results */
- UtAssert_INT32_EQ(Result, OS_ERROR);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, OS_ERROR);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_read error received: RC = 0x%08X Expected = %u File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_read error received: RC = 0x%08X Expected = %u File = '%s'");
}
-void Test_MM_LoadMemFromFile_NotEepromMemType(void) {
- int32 Result;
- MM_LoadDumpFileHeader_t FileHeader;
- char FileName[] = "filename";
- cpuaddr DestAddress;
- uint8 OutBuff[(2 * MM_INTERNAL_MAX_LOAD_DATA_SEG) + 2];
-
- FileHeader.MemType = MM_MemType_MEM8;
- FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
- DestAddress = (cpuaddr)OutBuff;
-
- /* Set to satisfy condition "(ReadLength = OS_read(FileHandle, ioBuffer,
- * SegmentSize)) == SegmentSize" */
- UT_SetDefaultReturnValue(UT_KEY(OS_read), MM_INTERNAL_MAX_LOAD_DATA_SEG);
-
- /* Execute the function being tested */
- Result =
- MM_LoadMemFromFile(MM_UT_OBJID_1, FileName, &FileHeader, DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed ==
- 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG,
- "MM_AppData.HkTlm.Payload.BytesProcessed == "
- "2*MM_INTERNAL_MAX_LOAD_DATA_SEG");
- UtAssert_STRINGBUF_EQ(MM_AppData.HkTlm.Payload.FileName,
- sizeof(MM_AppData.HkTlm.Payload.FileName), FileName,
- sizeof(FileName));
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_LoadMemFromFile_NotEepromMemType(void)
+{
+ int32 Result;
+ MM_LoadDumpFileHeader_t FileHeader;
+ char FileName[] = "filename";
+ cpuaddr DestAddress;
+ uint8 OutBuff[(2 * MM_INTERNAL_MAX_LOAD_DATA_SEG) + 2];
+
+ FileHeader.MemType = MM_MemType_MEM8;
+ FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ DestAddress = (cpuaddr)OutBuff;
+
+ /* Set to satisfy condition "(ReadLength = OS_read(FileHandle, ioBuffer,
+ * SegmentSize)) == SegmentSize" */
+ UT_SetDefaultReturnValue(UT_KEY(OS_read), MM_INTERNAL_MAX_LOAD_DATA_SEG);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMemFromFile(MM_UT_OBJID_1, FileName, &FileHeader, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == "
+ "2*MM_INTERNAL_MAX_LOAD_DATA_SEG");
+ UtAssert_STRINGBUF_EQ(MM_AppData.HkTlm.Payload.FileName,
+ sizeof(MM_AppData.HkTlm.Payload.FileName),
+ FileName,
+ sizeof(FileName));
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadFileSize_Nominal(void) {
- int32 Status;
- MM_LoadDumpFileHeader_t FileHeader;
- os_fstat_t FileStats;
+void Test_MM_VerifyLoadFileSize_Nominal(void)
+{
+ int32 Status;
+ MM_LoadDumpFileHeader_t FileHeader;
+ os_fstat_t FileStats;
- memset(&FileHeader, 0, sizeof(MM_LoadDumpFileHeader_t));
- FileHeader.NumOfBytes = 1;
+ memset(&FileHeader, 0, sizeof(MM_LoadDumpFileHeader_t));
+ FileHeader.NumOfBytes = 1;
- memset(&FileStats, 0, sizeof(os_fstat_t));
- FileStats.FileSize = FileHeader.NumOfBytes + sizeof(CFE_FS_Header_t) +
- sizeof(MM_LoadDumpFileHeader_t);
+ memset(&FileStats, 0, sizeof(os_fstat_t));
+ FileStats.FileSize = FileHeader.NumOfBytes + sizeof(CFE_FS_Header_t) + sizeof(MM_LoadDumpFileHeader_t);
- UT_SetDefaultReturnValue(UT_KEY(OS_stat), OS_SUCCESS);
- UT_SetDataBuffer(UT_KEY(OS_stat), &FileStats, sizeof(os_fstat_t), false);
+ UT_SetDefaultReturnValue(UT_KEY(OS_stat), OS_SUCCESS);
+ UT_SetDataBuffer(UT_KEY(OS_stat), &FileStats, sizeof(os_fstat_t), false);
- /* Execute the function being tested */
- Status = MM_VerifyLoadFileSize(NULL, &FileHeader);
+ /* Execute the function being tested */
+ Status = MM_VerifyLoadFileSize(NULL, &FileHeader);
- /* Verify results */
- UtAssert_EQ(int32, Status, OS_SUCCESS);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ /* Verify results */
+ UtAssert_EQ(int32, Status, OS_SUCCESS);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadFileSize_StatError(void) {
- int32 Result;
- MM_LoadDumpFileHeader_t FileHeader;
+void Test_MM_VerifyLoadFileSize_StatError(void)
+{
+ int32 Result;
+ MM_LoadDumpFileHeader_t FileHeader;
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(OS_stat), 1, OS_FS_ERR_PATH_INVALID);
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(OS_stat), 1, OS_FS_ERR_PATH_INVALID);
- /* Execute the function being tested */
- Result = MM_VerifyLoadFileSize((char *)"filename", &FileHeader);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadFileSize((char *)"filename", &FileHeader);
- /* Verify results */
- UtAssert_True(Result == OS_FS_ERR_PATH_INVALID,
- "Result == OS_FS_ERR_PATH_INVALID");
+ /* Verify results */
+ UtAssert_True(Result == OS_FS_ERR_PATH_INVALID, "Result == OS_FS_ERR_PATH_INVALID");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_STAT_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_stat error received: RC = 0x%08X File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_STAT_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_stat error received: RC = 0x%08X File = '%s'");
}
-void Test_MM_VerifyLoadFileSize_SizeError(void) {
- int32 Result;
- MM_LoadDumpFileHeader_t FileHeader;
+void Test_MM_VerifyLoadFileSize_SizeError(void)
+{
+ int32 Result;
+ MM_LoadDumpFileHeader_t FileHeader;
- FileHeader.NumOfBytes = 99;
+ FileHeader.NumOfBytes = 99;
- /* Execute the function being tested */
- Result = MM_VerifyLoadFileSize((char *)"filename", &FileHeader);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadFileSize((char *)"filename", &FileHeader);
- /* Verify results */
- UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
+ /* Verify results */
+ UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_LD_FILE_SIZE_ERR_EID, CFE_EVS_EventType_ERROR,
- "Load file size error: Reported by OS = %d Expected = %u File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_LD_FILE_SIZE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Load file size error: Reported by OS = %d Expected = %u File = '%s'");
}
-void Test_MM_ReadFileHeaders_Nominal(void) {
- int32 Status;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- CFE_FS_Header_t CFEHeader;
- MM_LoadDumpFileHeader_t MMHeader;
+void Test_MM_ReadFileHeaders_Nominal(void)
+{
+ int32 Status;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ CFE_FS_Header_t CFEHeader;
+ MM_LoadDumpFileHeader_t MMHeader;
- UT_SetDefaultReturnValue(UT_KEY(CFE_FS_ReadHeader), sizeof(CFE_FS_Header_t));
- UT_SetDefaultReturnValue(UT_KEY(OS_read), sizeof(MM_LoadDumpFileHeader_t));
+ UT_SetDefaultReturnValue(UT_KEY(CFE_FS_ReadHeader), sizeof(CFE_FS_Header_t));
+ UT_SetDefaultReturnValue(UT_KEY(OS_read), sizeof(MM_LoadDumpFileHeader_t));
- /* Execute the function being tested */
- Status = MM_ReadFileHeaders(NULL, FileHandle, &CFEHeader, &MMHeader);
+ /* Execute the function being tested */
+ Status = MM_ReadFileHeaders(NULL, FileHandle, &CFEHeader, &MMHeader);
- /* Verify results */
- UtAssert_EQ(int32, Status, OS_SUCCESS);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ /* Verify results */
+ UtAssert_EQ(int32, Status, OS_SUCCESS);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_ReadFileHeaders_ReadHeaderError(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- CFE_FS_Header_t CFEHeader;
- MM_LoadDumpFileHeader_t MMHeader;
-
- /* Set to satisfy condition "OS_Status != sizeof(CFE_FS_Header_t)" */
- UT_SetDeferredRetcode(UT_KEY(CFE_FS_ReadHeader), 1, CFE_FS_BAD_ARGUMENT);
-
- /* Execute the function being tested */
- Result =
- MM_ReadFileHeaders((char *)"filename", FileHandle, &CFEHeader, &MMHeader);
-
- /* Verify results */
- UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_CFE_FS_READHDR_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_FS_ReadHeader error received: RC = 0x%08X Expected "
- "= %u File = '%s'");
+void Test_MM_ReadFileHeaders_ReadHeaderError(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ CFE_FS_Header_t CFEHeader;
+ MM_LoadDumpFileHeader_t MMHeader;
+
+ /* Set to satisfy condition "OS_Status != sizeof(CFE_FS_Header_t)" */
+ UT_SetDeferredRetcode(UT_KEY(CFE_FS_ReadHeader), 1, CFE_FS_BAD_ARGUMENT);
+
+ /* Execute the function being tested */
+ Result = MM_ReadFileHeaders((char *)"filename", FileHandle, &CFEHeader, &MMHeader);
+
+ /* Verify results */
+ UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_CFE_FS_READHDR_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_FS_ReadHeader error received: RC = 0x%08X Expected "
+ "= %u File = '%s'");
}
-void Test_MM_ReadFileHeaders_ReadError(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- CFE_FS_Header_t CFEHeader;
- MM_LoadDumpFileHeader_t MMHeader;
+void Test_MM_ReadFileHeaders_ReadError(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ CFE_FS_Header_t CFEHeader;
+ MM_LoadDumpFileHeader_t MMHeader;
- /* Set to generate error message MM_OS_READ_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_ERROR);
+ /* Set to generate error message MM_OS_READ_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_ERROR);
- /* Execute the function being tested */
- Result =
- MM_ReadFileHeaders((char *)"filename", FileHandle, &CFEHeader, &MMHeader);
+ /* Execute the function being tested */
+ Result = MM_ReadFileHeaders((char *)"filename", FileHandle, &CFEHeader, &MMHeader);
- /* Verify results */
- UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
+ /* Verify results */
+ UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_READ_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_read error received: RC = 0x%08X Expected = %u File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_READ_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_read error received: RC = 0x%08X Expected = %u File = '%s'");
}
-void Test_MM_FillMem_Eeprom(void) {
- MM_FillMemCmd_t CmdPacket;
- uint8 OutBuff[(2 * MM_INTERNAL_MAX_LOAD_DATA_SEG) + 2];
- cpuaddr DestAddress;
-
- memset(&CmdPacket, 0, sizeof(CmdPacket));
-
- CmdPacket.Payload.MemType = MM_MemType_EEPROM;
- CmdPacket.Payload.NumOfBytes = 2;
- DestAddress = (cpuaddr)OutBuff;
-
- /* Execute the function being tested */
- MM_FillMem(DestAddress, &CmdPacket);
-
- /* Verify results */
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType,
- "MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
- "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 2");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
- UtAssert_STUB_COUNT(CFE_ES_PerfLogAdd, 2);
+void Test_MM_FillMem_Eeprom(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ uint8 OutBuff[(2 * MM_INTERNAL_MAX_LOAD_DATA_SEG) + 2];
+ cpuaddr DestAddress;
+
+ memset(&CmdPacket, 0, sizeof(CmdPacket));
+
+ CmdPacket.Payload.MemType = MM_MemType_EEPROM;
+ CmdPacket.Payload.NumOfBytes = 2;
+ DestAddress = (cpuaddr)OutBuff;
+
+ /* Execute the function being tested */
+ MM_FillMem(DestAddress, &CmdPacket);
+
+ /* Verify results */
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType,
+ "MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
+ "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2, "MM_AppData.HkTlm.Payload.BytesProcessed == 2");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_ES_PerfLogAdd, 2);
}
-void Test_MM_FillMem_NonEeprom(void) {
- MM_FillMemCmd_t CmdPacket;
- uint8 OutBuff[(2 * MM_INTERNAL_MAX_LOAD_DATA_SEG) + 2];
- cpuaddr DestAddress;
-
- memset(&CmdPacket, 0, sizeof(CmdPacket));
-
- CmdPacket.Payload.MemType = MM_MemType_RAM;
- CmdPacket.Payload.NumOfBytes = 2;
- DestAddress = (cpuaddr)OutBuff;
-
- /* Execute the function being tested */
- MM_FillMem(DestAddress, &CmdPacket);
-
- /* Verify results */
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType,
- "MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
- "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2,
- "MM_AppData.HkTlm.Payload.BytesProcessed == 2");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
- UtAssert_STUB_COUNT(CFE_ES_PerfLogAdd, 0);
+void Test_MM_FillMem_NonEeprom(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ uint8 OutBuff[(2 * MM_INTERNAL_MAX_LOAD_DATA_SEG) + 2];
+ cpuaddr DestAddress;
+
+ memset(&CmdPacket, 0, sizeof(CmdPacket));
+
+ CmdPacket.Payload.MemType = MM_MemType_RAM;
+ CmdPacket.Payload.NumOfBytes = 2;
+ DestAddress = (cpuaddr)OutBuff;
+
+ /* Execute the function being tested */
+ MM_FillMem(DestAddress, &CmdPacket);
+
+ /* Verify results */
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType,
+ "MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
+ "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 2, "MM_AppData.HkTlm.Payload.BytesProcessed == 2");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_ES_PerfLogAdd, 0);
}
-void Test_MM_FillMem_MaxFillDataSegment(void) {
- MM_FillMemCmd_t CmdPacket;
- uint8 OutBuff[(2 * MM_INTERNAL_MAX_LOAD_DATA_SEG) + 2];
- cpuaddr DestAddress;
-
- memset(&CmdPacket, 0, sizeof(CmdPacket));
-
- CmdPacket.Payload.MemType = MM_MemType_EEPROM;
- CmdPacket.Payload.NumOfBytes = MM_INTERNAL_MAX_FILL_DATA_SEG + 1;
- DestAddress = (cpuaddr)OutBuff;
-
- /* Execute the function being tested */
- MM_FillMem(DestAddress, &CmdPacket);
-
- /* Verify results */
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType,
- "MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
- "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed ==
- MM_INTERNAL_MAX_FILL_DATA_SEG + 1,
- "MM_AppData.HkTlm.Payload.BytesProcessed == "
- "MM_INTERNAL_MAX_FILL_DATA_SEG + 1");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_FillMem_MaxFillDataSegment(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ uint8 OutBuff[(2 * MM_INTERNAL_MAX_LOAD_DATA_SEG) + 2];
+ cpuaddr DestAddress;
+
+ memset(&CmdPacket, 0, sizeof(CmdPacket));
+
+ CmdPacket.Payload.MemType = MM_MemType_EEPROM;
+ CmdPacket.Payload.NumOfBytes = MM_INTERNAL_MAX_FILL_DATA_SEG + 1;
+ DestAddress = (cpuaddr)OutBuff;
+
+ /* Execute the function being tested */
+ MM_FillMem(DestAddress, &CmdPacket);
+
+ /* Verify results */
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType,
+ "MM_AppData.HkTlm.Payload.MemType == CmdPacket.Payload.MemType");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
+ "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == MM_INTERNAL_MAX_FILL_DATA_SEG + 1,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == "
+ "MM_INTERNAL_MAX_FILL_DATA_SEG + 1");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
/*
* Register the test cases to execute with the unit test tool
*/
-void UtTest_Setup(void) {
- ADD_TEST(Test_MM_PokeMem_NoDataSize);
- ADD_TEST(Test_MM_PokeMem_8bit);
- ADD_TEST(Test_MM_PokeMem_8bitError);
- ADD_TEST(Test_MM_PokeMem_16bit);
- ADD_TEST(Test_MM_PokeMem_16bitError);
- ADD_TEST(Test_MM_PokeMem_32bit);
- ADD_TEST(Test_MM_PokeMem_32bitError);
- ADD_TEST(Test_MM_PokeEeprom_NoDataSize);
- ADD_TEST(Test_MM_PokeEeprom_8bit);
- ADD_TEST(Test_MM_PokeEeprom_8bitError);
- ADD_TEST(Test_MM_PokeEeprom_16bit);
- ADD_TEST(Test_MM_PokeEeprom_16bitError);
- ADD_TEST(Test_MM_PokeEeprom_32bit);
- ADD_TEST(Test_MM_PokeEeprom_32bitError);
- ADD_TEST(Test_MM_LoadMemFromFile_PreventCPUHogging);
- ADD_TEST(Test_MM_LoadMemFromFile_ReadError);
- ADD_TEST(Test_MM_LoadMemFromFile_NotEepromMemType);
- ADD_TEST(Test_MM_VerifyLoadFileSize_Nominal);
- ADD_TEST(Test_MM_VerifyLoadFileSize_StatError);
- ADD_TEST(Test_MM_VerifyLoadFileSize_SizeError);
- ADD_TEST(Test_MM_ReadFileHeaders_Nominal);
- ADD_TEST(Test_MM_ReadFileHeaders_ReadHeaderError);
- ADD_TEST(Test_MM_ReadFileHeaders_ReadError);
- ADD_TEST(Test_MM_FillMem_Eeprom);
- ADD_TEST(Test_MM_FillMem_NonEeprom);
- ADD_TEST(Test_MM_FillMem_MaxFillDataSegment);
+void UtTest_Setup(void)
+{
+ ADD_TEST(Test_MM_PokeMem_NoDataSize);
+ ADD_TEST(Test_MM_PokeMem_8bit);
+ ADD_TEST(Test_MM_PokeMem_8bitError);
+ ADD_TEST(Test_MM_PokeMem_16bit);
+ ADD_TEST(Test_MM_PokeMem_16bitError);
+ ADD_TEST(Test_MM_PokeMem_32bit);
+ ADD_TEST(Test_MM_PokeMem_32bitError);
+ ADD_TEST(Test_MM_PokeEeprom_NoDataSize);
+ ADD_TEST(Test_MM_PokeEeprom_8bit);
+ ADD_TEST(Test_MM_PokeEeprom_8bitError);
+ ADD_TEST(Test_MM_PokeEeprom_16bit);
+ ADD_TEST(Test_MM_PokeEeprom_16bitError);
+ ADD_TEST(Test_MM_PokeEeprom_32bit);
+ ADD_TEST(Test_MM_PokeEeprom_32bitError);
+ ADD_TEST(Test_MM_LoadMemFromFile_PreventCPUHogging);
+ ADD_TEST(Test_MM_LoadMemFromFile_ReadError);
+ ADD_TEST(Test_MM_LoadMemFromFile_NotEepromMemType);
+ ADD_TEST(Test_MM_VerifyLoadFileSize_Nominal);
+ ADD_TEST(Test_MM_VerifyLoadFileSize_StatError);
+ ADD_TEST(Test_MM_VerifyLoadFileSize_SizeError);
+ ADD_TEST(Test_MM_ReadFileHeaders_Nominal);
+ ADD_TEST(Test_MM_ReadFileHeaders_ReadHeaderError);
+ ADD_TEST(Test_MM_ReadFileHeaders_ReadError);
+ ADD_TEST(Test_MM_FillMem_Eeprom);
+ ADD_TEST(Test_MM_FillMem_NonEeprom);
+ ADD_TEST(Test_MM_FillMem_MaxFillDataSegment);
}
diff --git a/unit-test/mm_mem16_tests.c b/unit-test/mm_mem16_tests.c
index 44657fb..330fdf3 100644
--- a/unit-test/mm_mem16_tests.c
+++ b/unit-test/mm_mem16_tests.c
@@ -49,423 +49,418 @@
* Function Definitions
*/
-void Test_MM_LoadMem16FromFile_Nominal(void) {
- CFE_Status_t Result;
- cpuaddr DestAddress = 1;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- FileHeader.NumOfBytes = 2;
-
- /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
- * SegmentSize)) != SegmentSize" */
- UT_SetDeferredRetcode(UT_KEY(OS_write), 1, FileHeader.NumOfBytes);
-
- /* Execute the function being tested */
- Result = MM_LoadMem16FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_LoadMem16FromFile_Nominal(void)
+{
+ CFE_Status_t Result;
+ cpuaddr DestAddress = 1;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ FileHeader.NumOfBytes = 2;
+
+ /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
+ * SegmentSize)) != SegmentSize" */
+ UT_SetDeferredRetcode(UT_KEY(OS_write), 1, FileHeader.NumOfBytes);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMem16FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_LoadMem16FromFile_CPUHogging(void) {
- CFE_Status_t Result;
- cpuaddr DestAddress = 1;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
-
- /* Set to always fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
- * SegmentSize)) != SegmentSize" */
- UT_SetDefaultReturnValue(UT_KEY(OS_write), FileHeader.NumOfBytes);
-
- /* Execute the function being tested */
- Result = MM_LoadMem16FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_LoadMem16FromFile_CPUHogging(void)
+{
+ CFE_Status_t Result;
+ cpuaddr DestAddress = 1;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
+
+ /* Set to always fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
+ * SegmentSize)) != SegmentSize" */
+ UT_SetDefaultReturnValue(UT_KEY(OS_write), FileHeader.NumOfBytes);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMem16FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_LoadMem16FromFile_ReadError(void) {
- CFE_Status_t Result;
- cpuaddr DestAddress = 1;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void Test_MM_LoadMem16FromFile_ReadError(void)
+{
+ CFE_Status_t Result;
+ cpuaddr DestAddress = 1;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- FileHeader.NumOfBytes = 2;
+ FileHeader.NumOfBytes = 2;
- /* Set to generate error message MM_OS_READ_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_ERROR);
+ /* Set to generate error message MM_OS_READ_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_ERROR);
- /* Execute the function being tested */
- Result = MM_LoadMem16FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
+ /* Execute the function being tested */
+ Result = MM_LoadMem16FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_read error received: RC = 0x%08X Expected = %u File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_read error received: RC = 0x%08X Expected = %u File = '%s'");
}
-void Test_MM_LoadMem16FromFile_WriteError(void) {
- /* CFE_PSP_MemWrite16 stub returns success with non-zero address */
- CFE_Status_t Result;
- cpuaddr DestAddress = 0;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void Test_MM_LoadMem16FromFile_WriteError(void)
+{
+ /* CFE_PSP_MemWrite16 stub returns success with non-zero address */
+ CFE_Status_t Result;
+ cpuaddr DestAddress = 0;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- memset(&FileHeader, 0, sizeof(FileHeader));
+ memset(&FileHeader, 0, sizeof(FileHeader));
- FileHeader.NumOfBytes = 2;
+ FileHeader.NumOfBytes = 2;
- /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
- * SegmentSize)) != SegmentSize" */
- UT_SetDeferredRetcode(UT_KEY(OS_read), 1, FileHeader.NumOfBytes);
+ /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
+ * SegmentSize)) != SegmentSize" */
+ UT_SetDeferredRetcode(UT_KEY(OS_read), 1, FileHeader.NumOfBytes);
- /* Set to generate error message MM_PSP_WRITE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite16), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_WRITE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite16), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_LoadMem16FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
+ /* Execute the function being tested */
+ Result = MM_LoadMem16FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM16");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM16");
}
-void Test_MM_DumpMem16ToFile_Nominal(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- FileHeader.NumOfBytes = MM_INTERNAL_MAX_DUMP_DATA_SEG;
- /* CFE_PSP_MemRead16 stub returns success with non-zero address */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
-
- /* Execute the function being tested */
- Result = MM_DumpMem16ToFile(FileHandle, (char *)"filename", &FileHeader);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
- CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_DumpMem16ToFile_Nominal(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ FileHeader.NumOfBytes = MM_INTERNAL_MAX_DUMP_DATA_SEG;
+ /* CFE_PSP_MemRead16 stub returns success with non-zero address */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMem16ToFile(FileHandle, (char *)"filename", &FileHeader);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
+ CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpMem16ToFile_CPUHogging(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
- /* CFE_PSP_MemRead16 stub returns success with non-zero address */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
-
- /* Execute the function being tested */
- Result = MM_DumpMem16ToFile(FileHandle, (char *)"filename", &FileHeader);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
- CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_DumpMem16ToFile_CPUHogging(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ /* CFE_PSP_MemRead16 stub returns success with non-zero address */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMem16ToFile(FileHandle, (char *)"filename", &FileHeader);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
+ CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpMem16ToFile_ReadError(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void Test_MM_DumpMem16ToFile_ReadError(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- FileHeader.NumOfBytes = 2;
+ FileHeader.NumOfBytes = 2;
- /* CFE_PSP_MemRead16 stub returns success with non-zero address */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ /* CFE_PSP_MemRead16 stub returns success with non-zero address */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead16), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead16), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_DumpMem16ToFile(FileHandle, (char *)"filename", &FileHeader);
+ /* Execute the function being tested */
+ Result = MM_DumpMem16ToFile(FileHandle, (char *)"filename", &FileHeader);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM16");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM16");
}
-void Test_MM_DumpMem16ToFile_WriteError(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void Test_MM_DumpMem16ToFile_WriteError(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- memset(&FileHeader, 0, sizeof(FileHeader));
+ memset(&FileHeader, 0, sizeof(FileHeader));
- FileHeader.NumOfBytes = 2;
+ FileHeader.NumOfBytes = 2;
- /* Set to generate error message MM_OS_WRITE_EXP_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(OS_write), 1, OS_ERROR);
+ /* Set to generate error message MM_OS_WRITE_EXP_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(OS_write), 1, OS_ERROR);
- /* Execute the function being tested */
- Result = MM_DumpMem16ToFile(FileHandle, (char *)"filename", &FileHeader);
+ /* Execute the function being tested */
+ Result = MM_DumpMem16ToFile(FileHandle, (char *)"filename", &FileHeader);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_WRITE_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_write error received: RC = 0x%08X Expected = %u File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_WRITE_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_write error received: RC = 0x%08X Expected = %u File = '%s'");
}
-void Test_MM_FillMem16_Nominal(void) {
- MM_FillMemCmd_t CmdPacket;
- cpuaddr DestAddress = 1;
- int32 Result;
-
- CmdPacket.Payload.NumOfBytes = 2;
- CmdPacket.Payload.FillPattern = 3;
-
- /* Execute the function being tested */
- Result = MM_FillMem16(DestAddress, &CmdPacket);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
- "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed ==
- CmdPacket.Payload.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == "
- "CmdPacket.Payload.NumOfBytes");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_FillMem16_Nominal(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ cpuaddr DestAddress = 1;
+ int32 Result;
+
+ CmdPacket.Payload.NumOfBytes = 2;
+ CmdPacket.Payload.FillPattern = 3;
+
+ /* Execute the function being tested */
+ Result = MM_FillMem16(DestAddress, &CmdPacket);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
+ "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == CmdPacket.Payload.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == "
+ "CmdPacket.Payload.NumOfBytes");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillMem16_CPUHogging(void) {
- MM_FillMemCmd_t CmdPacket;
- cpuaddr DestAddress = 1;
- int32 Result;
-
- CmdPacket.Payload.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
- CmdPacket.Payload.FillPattern = 3;
-
- /* Execute the function being tested */
- Result = MM_FillMem16(DestAddress, &CmdPacket);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
- "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed ==
- CmdPacket.Payload.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == "
- "CmdPacket.Payload.NumOfBytes");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_FillMem16_CPUHogging(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ cpuaddr DestAddress = 1;
+ int32 Result;
+
+ CmdPacket.Payload.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ CmdPacket.Payload.FillPattern = 3;
+
+ /* Execute the function being tested */
+ Result = MM_FillMem16(DestAddress, &CmdPacket);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM16");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
+ "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == CmdPacket.Payload.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == "
+ "CmdPacket.Payload.NumOfBytes");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillMem16_WriteError(void) {
- MM_FillMemCmd_t CmdPacket;
- /* CFE_PSP_MemWrite16 stub returns success with non-zero address */
- cpuaddr DestAddress = 0;
- int32 Result;
+void Test_MM_FillMem16_WriteError(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ /* CFE_PSP_MemWrite16 stub returns success with non-zero address */
+ cpuaddr DestAddress = 0;
+ int32 Result;
- CmdPacket.Payload.NumOfBytes = 2;
- CmdPacket.Payload.FillPattern = 3;
+ CmdPacket.Payload.NumOfBytes = 2;
+ CmdPacket.Payload.FillPattern = 3;
- /* Set to generate error message MM_PSP_WRITE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite16), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_WRITE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite16), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_FillMem16(DestAddress, &CmdPacket);
+ /* Execute the function being tested */
+ Result = MM_FillMem16(DestAddress, &CmdPacket);
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM16");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM16");
}
-void Test_MM_FillMem16_Align(void) {
- MM_FillMemCmd_t CmdPacket;
- cpuaddr DestAddress = 1;
- int32 Result;
+void Test_MM_FillMem16_Align(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ cpuaddr DestAddress = 1;
+ int32 Result;
- CmdPacket.Payload.NumOfBytes = 3;
- CmdPacket.Payload.FillPattern = 4;
+ CmdPacket.Payload.NumOfBytes = 3;
+ CmdPacket.Payload.FillPattern = 4;
- /* Execute the function being tested */
- Result = MM_FillMem16(DestAddress, &CmdPacket);
+ /* Execute the function being tested */
+ Result = MM_FillMem16(DestAddress, &CmdPacket);
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_FILL_MEM16_ALIGN_WARN_INF_EID, CFE_EVS_EventType_INFORMATION,
- "MM_FillMem16 NumOfBytes not multiple of 2. Reducing from %u to %u.");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_FILL_MEM16_ALIGN_WARN_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "MM_FillMem16 NumOfBytes not multiple of 2. Reducing from %u to %u.");
}
/*
* Register the test cases to execute with the unit test tool
*/
-void UtTest_Setup(void) {
- ADD_TEST(Test_MM_LoadMem16FromFile_Nominal);
- ADD_TEST(Test_MM_LoadMem16FromFile_CPUHogging);
- ADD_TEST(Test_MM_LoadMem16FromFile_ReadError);
- ADD_TEST(Test_MM_LoadMem16FromFile_WriteError);
- ADD_TEST(Test_MM_DumpMem16ToFile_Nominal);
- ADD_TEST(Test_MM_DumpMem16ToFile_CPUHogging);
- ADD_TEST(Test_MM_DumpMem16ToFile_ReadError);
- ADD_TEST(Test_MM_DumpMem16ToFile_WriteError);
- ADD_TEST(Test_MM_FillMem16_Nominal);
- ADD_TEST(Test_MM_FillMem16_CPUHogging);
- ADD_TEST(Test_MM_FillMem16_WriteError);
- ADD_TEST(Test_MM_FillMem16_Align);
+void UtTest_Setup(void)
+{
+ ADD_TEST(Test_MM_LoadMem16FromFile_Nominal);
+ ADD_TEST(Test_MM_LoadMem16FromFile_CPUHogging);
+ ADD_TEST(Test_MM_LoadMem16FromFile_ReadError);
+ ADD_TEST(Test_MM_LoadMem16FromFile_WriteError);
+ ADD_TEST(Test_MM_DumpMem16ToFile_Nominal);
+ ADD_TEST(Test_MM_DumpMem16ToFile_CPUHogging);
+ ADD_TEST(Test_MM_DumpMem16ToFile_ReadError);
+ ADD_TEST(Test_MM_DumpMem16ToFile_WriteError);
+ ADD_TEST(Test_MM_FillMem16_Nominal);
+ ADD_TEST(Test_MM_FillMem16_CPUHogging);
+ ADD_TEST(Test_MM_FillMem16_WriteError);
+ ADD_TEST(Test_MM_FillMem16_Align);
}
diff --git a/unit-test/mm_mem32_tests.c b/unit-test/mm_mem32_tests.c
index c03e95d..061ff3b 100644
--- a/unit-test/mm_mem32_tests.c
+++ b/unit-test/mm_mem32_tests.c
@@ -49,434 +49,434 @@
* Function Definitions
*/
-void MM_LoadMem32FromFile_Test_Nominal(void) {
- CFE_Status_t Result;
- cpuaddr DestAddress = 1;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- FileHeader.NumOfBytes = 4;
-
- /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
- * SegmentSize)) != SegmentSize" */
- UT_SetDeferredRetcode(UT_KEY(OS_write), 1, FileHeader.NumOfBytes);
-
- /* Execute the function being tested */
- Result = MM_LoadMem32FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void MM_LoadMem32FromFile_Test_Nominal(void)
+{
+ CFE_Status_t Result;
+ cpuaddr DestAddress = 1;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ FileHeader.NumOfBytes = 4;
+
+ /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
+ * SegmentSize)) != SegmentSize" */
+ UT_SetDeferredRetcode(UT_KEY(OS_write), 1, FileHeader.NumOfBytes);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMem32FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void MM_LoadMem32FromFile_Test_CPUHogging(void) {
- CFE_Status_t Result;
- cpuaddr DestAddress = 1;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- FileHeader.NumOfBytes = 4 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
-
- /* Set to always fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
- * SegmentSize)) != SegmentSize" */
- UT_SetDefaultReturnValue(UT_KEY(OS_write), FileHeader.NumOfBytes);
-
- /* Execute the function being tested */
- Result = MM_LoadMem32FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void MM_LoadMem32FromFile_Test_CPUHogging(void)
+{
+ CFE_Status_t Result;
+ cpuaddr DestAddress = 1;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ FileHeader.NumOfBytes = 4 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
+
+ /* Set to always fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
+ * SegmentSize)) != SegmentSize" */
+ UT_SetDefaultReturnValue(UT_KEY(OS_write), FileHeader.NumOfBytes);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMem32FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void MM_LoadMem32FromFile_Test_ReadError(void) {
- CFE_Status_t Result;
- cpuaddr DestAddress = 1;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void MM_LoadMem32FromFile_Test_ReadError(void)
+{
+ CFE_Status_t Result;
+ cpuaddr DestAddress = 1;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- FileHeader.NumOfBytes = 4;
+ FileHeader.NumOfBytes = 4;
- /* Set to generate error message MM_OS_READ_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_ERROR);
+ /* Set to generate error message MM_OS_READ_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_ERROR);
- /* Execute the function being tested */
- Result = MM_LoadMem32FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
+ /* Execute the function being tested */
+ Result = MM_LoadMem32FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_read error received: RC = 0x%08X Expected = %u File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_read error received: RC = 0x%08X Expected = %u File = '%s'");
}
-void MM_LoadMem32FromFile_Test_WriteError(void) {
- /* CFE_PSP_MemWrite32 stub returns success with non-zero address */
- CFE_Status_t Result;
- cpuaddr DestAddress = 0;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void MM_LoadMem32FromFile_Test_WriteError(void)
+{
+ /* CFE_PSP_MemWrite32 stub returns success with non-zero address */
+ CFE_Status_t Result;
+ cpuaddr DestAddress = 0;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- memset(&FileHeader, 0, sizeof(FileHeader));
+ memset(&FileHeader, 0, sizeof(FileHeader));
- FileHeader.NumOfBytes = 4;
+ FileHeader.NumOfBytes = 4;
- /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
- * SegmentSize)) != SegmentSize" */
- UT_SetDeferredRetcode(UT_KEY(OS_read), 1, FileHeader.NumOfBytes);
+ /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
+ * SegmentSize)) != SegmentSize" */
+ UT_SetDeferredRetcode(UT_KEY(OS_read), 1, FileHeader.NumOfBytes);
- /* Set to generate error message MM_PSP_WRITE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite32), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_WRITE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite32), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_LoadMem32FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
+ /* Execute the function being tested */
+ Result = MM_LoadMem32FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=%d, Address=%p, MemType=MEM32");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=%d, Address=%p, MemType=MEM32");
}
-void MM_DumpMem32ToFile_Test_Nominal(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- memset(&FileHeader, 0, sizeof(FileHeader));
-
- FileHeader.NumOfBytes = MM_INTERNAL_MAX_DUMP_DATA_SEG;
- /* CFE_PSP_MemRead32 stub returns success with non-zero address */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
-
- /* Execute the function being tested */
- Result = MM_DumpMem32ToFile(FileHandle, (char *)"filename", &FileHeader);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void MM_DumpMem32ToFile_Test_Nominal(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ memset(&FileHeader, 0, sizeof(FileHeader));
+
+ FileHeader.NumOfBytes = MM_INTERNAL_MAX_DUMP_DATA_SEG;
+ /* CFE_PSP_MemRead32 stub returns success with non-zero address */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMem32ToFile(FileHandle, (char *)"filename", &FileHeader);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
+ CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void MM_DumpMem32ToFile_Test_CPUHogging(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- FileHeader.NumOfBytes = 4 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
- /* CFE_PSP_MemRead32 stub returns success with non-zero address */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
-
- /* Execute the function being tested */
- Result = MM_DumpMem32ToFile(FileHandle, (char *)"filename", &FileHeader);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void MM_DumpMem32ToFile_Test_CPUHogging(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ FileHeader.NumOfBytes = 4 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ /* CFE_PSP_MemRead32 stub returns success with non-zero address */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMem32ToFile(FileHandle, (char *)"filename", &FileHeader);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
+ CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void MM_DumpMem32ToFile_Test_ReadError(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void MM_DumpMem32ToFile_Test_ReadError(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- FileHeader.NumOfBytes = 4;
+ FileHeader.NumOfBytes = 4;
- /* CFE_PSP_MemRead32 stub returns success with non-zero address */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ /* CFE_PSP_MemRead32 stub returns success with non-zero address */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead32), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead32), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_DumpMem32ToFile(FileHandle, (char *)"filename", &FileHeader);
+ /* Execute the function being tested */
+ Result = MM_DumpMem32ToFile(FileHandle, (char *)"filename", &FileHeader);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM32");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM32");
}
-void MM_DumpMem32ToFile_Test_WriteError(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void MM_DumpMem32ToFile_Test_WriteError(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- memset(&FileHeader, 0, sizeof(FileHeader));
+ memset(&FileHeader, 0, sizeof(FileHeader));
- FileHeader.NumOfBytes = 4;
+ FileHeader.NumOfBytes = 4;
- /* Set to generate error message MM_OS_WRITE_EXP_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(OS_write), 1, OS_ERROR);
+ /* Set to generate error message MM_OS_WRITE_EXP_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(OS_write), 1, OS_ERROR);
- /* Execute the function being tested */
- Result = MM_DumpMem32ToFile(FileHandle, (char *)"filename", &FileHeader);
+ /* Execute the function being tested */
+ Result = MM_DumpMem32ToFile(FileHandle, (char *)"filename", &FileHeader);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_WRITE_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_write error received: RC = 0x%08X Expected = %u File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_WRITE_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_write error received: RC = 0x%08X Expected = %u File = '%s'");
}
-void MM_FillMem32_Test_Nominal(void) {
- MM_FillMemCmd_t CmdPacket;
- cpuaddr DestAddress = 1;
- int32 Result;
-
- CmdPacket.Payload.NumOfBytes = 4;
- CmdPacket.Payload.FillPattern = 3;
-
- /* Execute the function being tested */
- Result = MM_FillMem32(DestAddress, &CmdPacket);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
- "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed ==
- CmdPacket.Payload.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == "
- "CmdPacket.Payload.NumOfBytes");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void MM_FillMem32_Test_Nominal(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ cpuaddr DestAddress = 1;
+ int32 Result;
+
+ CmdPacket.Payload.NumOfBytes = 4;
+ CmdPacket.Payload.FillPattern = 3;
+
+ /* Execute the function being tested */
+ Result = MM_FillMem32(DestAddress, &CmdPacket);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
+ "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == CmdPacket.Payload.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == "
+ "CmdPacket.Payload.NumOfBytes");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void MM_FillMem32_Test_CPUHogging(void) {
- int32 Result;
- MM_FillMemCmd_t CmdPacket;
- cpuaddr DestAddress = 1;
-
- CmdPacket.Payload.NumOfBytes = 4 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
- CmdPacket.Payload.FillPattern = 3;
-
- /* Execute the function being tested */
- Result = MM_FillMem32(DestAddress, &CmdPacket);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
- "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed ==
- CmdPacket.Payload.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == "
- "CmdPacket.Payload.NumOfBytes");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void MM_FillMem32_Test_CPUHogging(void)
+{
+ int32 Result;
+ MM_FillMemCmd_t CmdPacket;
+ cpuaddr DestAddress = 1;
+
+ CmdPacket.Payload.NumOfBytes = 4 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ CmdPacket.Payload.FillPattern = 3;
+
+ /* Execute the function being tested */
+ Result = MM_FillMem32(DestAddress, &CmdPacket);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM32");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
+ "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == CmdPacket.Payload.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == "
+ "CmdPacket.Payload.NumOfBytes");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void MM_FillMem32_Test_WriteError(void) {
- MM_FillMemCmd_t CmdPacket;
- /* CFE_PSP_MemWrite32 stub returns success with non-zero address */
- cpuaddr DestAddress = 0;
- int32 Result;
+void MM_FillMem32_Test_WriteError(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ /* CFE_PSP_MemWrite32 stub returns success with non-zero address */
+ cpuaddr DestAddress = 0;
+ int32 Result;
- CmdPacket.Payload.NumOfBytes = 4;
- CmdPacket.Payload.FillPattern = 3;
+ CmdPacket.Payload.NumOfBytes = 4;
+ CmdPacket.Payload.FillPattern = 3;
- /* Set to generate error message MM_PSP_WRITE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite32), 1, -1);
+ /* Set to generate error message MM_PSP_WRITE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite32), 1, -1);
- /* Execute the function being tested */
- Result = MM_FillMem32(DestAddress, &CmdPacket);
+ /* Execute the function being tested */
+ Result = MM_FillMem32(DestAddress, &CmdPacket);
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM32");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM32");
}
-void MM_FillMem32_Test_Align(void) {
- MM_FillMemCmd_t CmdPacket;
- cpuaddr DestAddress = 1;
- CmdPacket.Payload.NumOfBytes = 5;
- CmdPacket.Payload.FillPattern = 3;
- int32 Result;
-
- /* Execute the function being tested */
- Result = MM_FillMem32(DestAddress, &CmdPacket);
-
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_FILL_MEM32_ALIGN_WARN_INF_EID, CFE_EVS_EventType_INFORMATION,
- "MM_FillMem32 NumOfBytes not multiple of 4. Reducing from %d to %d.");
+void MM_FillMem32_Test_Align(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ cpuaddr DestAddress = 1;
+ CmdPacket.Payload.NumOfBytes = 5;
+ CmdPacket.Payload.FillPattern = 3;
+ int32 Result;
+
+ /* Execute the function being tested */
+ Result = MM_FillMem32(DestAddress, &CmdPacket);
+
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_FILL_MEM32_ALIGN_WARN_INF_EID,
+ CFE_EVS_EventType_INFORMATION,
+ "MM_FillMem32 NumOfBytes not multiple of 4. Reducing from %d to %d.");
}
/*
* Register the test cases to execute with the unit test tool
*/
-void UtTest_Setup(void) {
- UtTest_Add(MM_LoadMem32FromFile_Test_Nominal, MM_Test_Setup, MM_Test_TearDown,
- "MM_LoadMem32FromFile_Test_Nominal");
- UtTest_Add(MM_LoadMem32FromFile_Test_CPUHogging, MM_Test_Setup,
- MM_Test_TearDown, "MM_LoadMem32FromFile_Test_CPUHogging");
- UtTest_Add(MM_LoadMem32FromFile_Test_ReadError, MM_Test_Setup,
- MM_Test_TearDown, "MM_LoadMem32FromFile_Test_ReadError");
- UtTest_Add(MM_LoadMem32FromFile_Test_WriteError, MM_Test_Setup,
- MM_Test_TearDown, "MM_LoadMem32FromFile_Test_WriteError");
- UtTest_Add(MM_DumpMem32ToFile_Test_Nominal, MM_Test_Setup, MM_Test_TearDown,
- "MM_DumpMem32ToFile_Test_Nominal");
- UtTest_Add(MM_DumpMem32ToFile_Test_CPUHogging, MM_Test_Setup,
- MM_Test_TearDown, "MM_DumpMem32ToFile_Test_CPUHogging");
- UtTest_Add(MM_DumpMem32ToFile_Test_ReadError, MM_Test_Setup, MM_Test_TearDown,
- "MM_DumpMem32ToFile_Test_ReadError");
- UtTest_Add(MM_DumpMem32ToFile_Test_WriteError, MM_Test_Setup,
- MM_Test_TearDown, "MM_DumpMem32ToFile_Test_WriteError");
- UtTest_Add(MM_FillMem32_Test_Nominal, MM_Test_Setup, MM_Test_TearDown,
- "MM_FillMem32_Test_Nominal");
- UtTest_Add(MM_FillMem32_Test_CPUHogging, MM_Test_Setup, MM_Test_TearDown,
- "MM_FillMem32_Test_CPUHogging");
- UtTest_Add(MM_FillMem32_Test_WriteError, MM_Test_Setup, MM_Test_TearDown,
- "MM_FillMem32_Test_WriteError");
- UtTest_Add(MM_FillMem32_Test_Align, MM_Test_Setup, MM_Test_TearDown,
- "MM_FillMem32_Test_Align");
+void UtTest_Setup(void)
+{
+ UtTest_Add(MM_LoadMem32FromFile_Test_Nominal, MM_Test_Setup, MM_Test_TearDown, "MM_LoadMem32FromFile_Test_Nominal");
+ UtTest_Add(MM_LoadMem32FromFile_Test_CPUHogging,
+ MM_Test_Setup,
+ MM_Test_TearDown,
+ "MM_LoadMem32FromFile_Test_CPUHogging");
+ UtTest_Add(MM_LoadMem32FromFile_Test_ReadError,
+ MM_Test_Setup,
+ MM_Test_TearDown,
+ "MM_LoadMem32FromFile_Test_ReadError");
+ UtTest_Add(MM_LoadMem32FromFile_Test_WriteError,
+ MM_Test_Setup,
+ MM_Test_TearDown,
+ "MM_LoadMem32FromFile_Test_WriteError");
+ UtTest_Add(MM_DumpMem32ToFile_Test_Nominal, MM_Test_Setup, MM_Test_TearDown, "MM_DumpMem32ToFile_Test_Nominal");
+ UtTest_Add(MM_DumpMem32ToFile_Test_CPUHogging,
+ MM_Test_Setup,
+ MM_Test_TearDown,
+ "MM_DumpMem32ToFile_Test_CPUHogging");
+ UtTest_Add(MM_DumpMem32ToFile_Test_ReadError, MM_Test_Setup, MM_Test_TearDown, "MM_DumpMem32ToFile_Test_ReadError");
+ UtTest_Add(MM_DumpMem32ToFile_Test_WriteError,
+ MM_Test_Setup,
+ MM_Test_TearDown,
+ "MM_DumpMem32ToFile_Test_WriteError");
+ UtTest_Add(MM_FillMem32_Test_Nominal, MM_Test_Setup, MM_Test_TearDown, "MM_FillMem32_Test_Nominal");
+ UtTest_Add(MM_FillMem32_Test_CPUHogging, MM_Test_Setup, MM_Test_TearDown, "MM_FillMem32_Test_CPUHogging");
+ UtTest_Add(MM_FillMem32_Test_WriteError, MM_Test_Setup, MM_Test_TearDown, "MM_FillMem32_Test_WriteError");
+ UtTest_Add(MM_FillMem32_Test_Align, MM_Test_Setup, MM_Test_TearDown, "MM_FillMem32_Test_Align");
}
diff --git a/unit-test/mm_mem8_tests.c b/unit-test/mm_mem8_tests.c
index 0d5ae15..f4c21d1 100644
--- a/unit-test/mm_mem8_tests.c
+++ b/unit-test/mm_mem8_tests.c
@@ -49,400 +49,393 @@
* Function Definitions
*/
-void Test_MM_LoadMem8FromFile_Nominal(void) {
- CFE_Status_t Result;
- cpuaddr DestAddress = 1;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- FileHeader.NumOfBytes = 2;
-
- /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
- * SegmentSize)) != SegmentSize" */
- UT_SetDeferredRetcode(UT_KEY(OS_write), 1, FileHeader.NumOfBytes);
-
- /* Execute the function being tested */
- Result = MM_LoadMem8FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_LoadMem8FromFile_Nominal(void)
+{
+ CFE_Status_t Result;
+ cpuaddr DestAddress = 1;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ FileHeader.NumOfBytes = 2;
+
+ /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
+ * SegmentSize)) != SegmentSize" */
+ UT_SetDeferredRetcode(UT_KEY(OS_write), 1, FileHeader.NumOfBytes);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMem8FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_LoadMem8FromFile_CPUHogging(void) {
- CFE_Status_t Result;
- cpuaddr DestAddress = 1;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
-
- /* Set to always fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
- * SegmentSize)) != SegmentSize" */
- UT_SetDefaultReturnValue(UT_KEY(OS_write), FileHeader.NumOfBytes);
-
- /* Execute the function being tested */
- Result = MM_LoadMem8FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_LoadMem8FromFile_CPUHogging(void)
+{
+ CFE_Status_t Result;
+ cpuaddr DestAddress = 1;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
+
+ /* Set to always fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
+ * SegmentSize)) != SegmentSize" */
+ UT_SetDefaultReturnValue(UT_KEY(OS_write), FileHeader.NumOfBytes);
+
+ /* Execute the function being tested */
+ Result = MM_LoadMem8FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_LOAD_FROM_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_LoadMem8FromFile_ReadError(void) {
- CFE_Status_t Result;
- cpuaddr DestAddress = 1;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void Test_MM_LoadMem8FromFile_ReadError(void)
+{
+ CFE_Status_t Result;
+ cpuaddr DestAddress = 1;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- FileHeader.NumOfBytes = 2;
+ FileHeader.NumOfBytes = 2;
- /* Set to generate error message MM_OS_READ_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_ERROR);
+ /* Set to generate error message MM_OS_READ_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_ERROR);
- /* Execute the function being tested */
- Result = MM_LoadMem8FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
+ /* Execute the function being tested */
+ Result = MM_LoadMem8FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_read error received: RC = 0x%08X Expected = %u File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_read error received: RC = 0x%08X Expected = %u File = '%s'");
}
-void Test_MM_LoadMem8FromFile_WriteError(void) {
- CFE_Status_t Result;
- /* CFE_PSP_MemWrite8 stub returns success with non-zero address */
- cpuaddr DestAddress = 0;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void Test_MM_LoadMem8FromFile_WriteError(void)
+{
+ CFE_Status_t Result;
+ /* CFE_PSP_MemWrite8 stub returns success with non-zero address */
+ cpuaddr DestAddress = 0;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- memset(&FileHeader, 0, sizeof(FileHeader));
+ memset(&FileHeader, 0, sizeof(FileHeader));
- FileHeader.NumOfBytes = 2;
+ FileHeader.NumOfBytes = 2;
- /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
- * SegmentSize)) != SegmentSize" */
- UT_SetDeferredRetcode(UT_KEY(OS_read), 1, FileHeader.NumOfBytes);
+ /* Set to fail condition "(ReadLength = OS_read(FileHandle, ioBuffer8,
+ * SegmentSize)) != SegmentSize" */
+ UT_SetDeferredRetcode(UT_KEY(OS_read), 1, FileHeader.NumOfBytes);
- /* Set to generate error message MM_PSP_WRITE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite8), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_WRITE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite8), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_LoadMem8FromFile(FileHandle, (char *)"filename", &FileHeader,
- DestAddress);
+ /* Execute the function being tested */
+ Result = MM_LoadMem8FromFile(FileHandle, (char *)"filename", &FileHeader, DestAddress);
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM8");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM8");
}
-void Test_MM_DumpMem8ToFile_Nominal(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- memset(&FileHeader, 0, sizeof(FileHeader));
-
- FileHeader.NumOfBytes = MM_INTERNAL_MAX_DUMP_DATA_SEG;
- /* CFE_PSP_MemRead8 stub returns success with non-zero address */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
-
- /* Execute the function being tested */
- Result = MM_DumpMem8ToFile(FileHandle, (char *)"filename", &FileHeader);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
- CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_DumpMem8ToFile_Nominal(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ memset(&FileHeader, 0, sizeof(FileHeader));
+
+ FileHeader.NumOfBytes = MM_INTERNAL_MAX_DUMP_DATA_SEG;
+ /* CFE_PSP_MemRead8 stub returns success with non-zero address */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMem8ToFile(FileHandle, (char *)"filename", &FileHeader);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
+ CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpMem8ToFile_CPUHogging(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
-
- FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
- /* CFE_PSP_MemRead8 stub returns success with non-zero address */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
-
- /* Execute the function being tested */
- Result = MM_DumpMem8ToFile(FileHandle, (char *)"filename", &FileHeader);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
- CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
- UtAssert_True(
- MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
- UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename",
- CFE_MISSION_MAX_PATH_LEN) == 0,
- "MM_AppData.HkTlm.Payload.FileName, 'filename', "
- "CFE_MISSION_MAX_PATH_LEN) == 0");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_DumpMem8ToFile_CPUHogging(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
+
+ FileHeader.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ /* CFE_PSP_MemRead8 stub returns success with non-zero address */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(1);
+
+ /* Execute the function being tested */
+ Result = MM_DumpMem8ToFile(FileHandle, (char *)"filename", &FileHeader);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_DUMP_TO_FILE");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address),
+ CFE_ES_MEMADDRESS_TO_PTR(FileHeader.SymAddress.Offset));
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == FileHeader.NumOfBytes");
+ UtAssert_True(strncmp(MM_AppData.HkTlm.Payload.FileName, "filename", CFE_MISSION_MAX_PATH_LEN) == 0,
+ "MM_AppData.HkTlm.Payload.FileName, 'filename', "
+ "CFE_MISSION_MAX_PATH_LEN) == 0");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_DumpMem8ToFile_ReadError(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void Test_MM_DumpMem8ToFile_ReadError(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- FileHeader.NumOfBytes = 2;
+ FileHeader.NumOfBytes = 2;
- /* CFE_PSP_MemRead8 stub returns success with non-zero address */
- FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
+ /* CFE_PSP_MemRead8 stub returns success with non-zero address */
+ FileHeader.SymAddress.Offset = CFE_ES_MEMADDRESS_C(0);
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead8), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemRead8), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_DumpMem8ToFile(FileHandle, (char *)"filename", &FileHeader);
+ /* Execute the function being tested */
+ Result = MM_DumpMem8ToFile(FileHandle, (char *)"filename", &FileHeader);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED,
- "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_NOT_IMPLEMENTED, "Result == CFE_PSP_ERROR_NOT_IMPLEMENTED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_READ_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM8");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_READ_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP read memory error: RC=0x%08X, Src=%p, Tgt=%p, Type=MEM8");
}
-void Test_MM_DumpMem8ToFile_WriteError(void) {
- int32 Result;
- osal_id_t FileHandle = MM_UT_OBJID_1;
- MM_LoadDumpFileHeader_t FileHeader;
+void Test_MM_DumpMem8ToFile_WriteError(void)
+{
+ int32 Result;
+ osal_id_t FileHandle = MM_UT_OBJID_1;
+ MM_LoadDumpFileHeader_t FileHeader;
- memset(&FileHeader, 0, sizeof(FileHeader));
+ memset(&FileHeader, 0, sizeof(FileHeader));
- FileHeader.NumOfBytes = 2;
+ FileHeader.NumOfBytes = 2;
- /* Set to generate error message MM_OS_WRITE_EXP_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(OS_write), 1, OS_ERROR);
+ /* Set to generate error message MM_OS_WRITE_EXP_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(OS_write), 1, OS_ERROR);
- /* Execute the function being tested */
- Result = MM_DumpMem8ToFile(FileHandle, (char *)"filename", &FileHeader);
+ /* Execute the function being tested */
+ Result = MM_DumpMem8ToFile(FileHandle, (char *)"filename", &FileHeader);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_OS_WRITE_EXP_ERR_EID, CFE_EVS_EventType_ERROR,
- "OS_write error received: RC = 0x%08X Expected = %u File = '%s'");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_WRITE_EXP_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "OS_write error received: RC = 0x%08X Expected = %u File = '%s'");
}
-void Test_MM_FillMem8_Nominal(void) {
- MM_FillMemCmd_t CmdPacket;
- cpuaddr DestAddress = 1;
- int32 Result;
-
- CmdPacket.Payload.NumOfBytes = 2;
- CmdPacket.Payload.FillPattern = 3;
-
- /* Execute the function being tested */
- Result = MM_FillMem8(DestAddress, &CmdPacket);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
- "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed ==
- CmdPacket.Payload.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == "
- "CmdPacket.Payload.NumOfBytes");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_FillMem8_Nominal(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ cpuaddr DestAddress = 1;
+ int32 Result;
+
+ CmdPacket.Payload.NumOfBytes = 2;
+ CmdPacket.Payload.FillPattern = 3;
+
+ /* Execute the function being tested */
+ Result = MM_FillMem8(DestAddress, &CmdPacket);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
+ "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == CmdPacket.Payload.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == "
+ "CmdPacket.Payload.NumOfBytes");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillMem8_CPUHogging(void) {
- MM_FillMemCmd_t CmdPacket;
- cpuaddr DestAddress = 1;
- int32 Result;
-
- CmdPacket.Payload.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
- CmdPacket.Payload.FillPattern = 3;
-
- /* Execute the function being tested */
- Result = MM_FillMem8(DestAddress, &CmdPacket);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
- "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed ==
- CmdPacket.Payload.NumOfBytes,
- "MM_AppData.HkTlm.Payload.BytesProcessed == "
- "CmdPacket.Payload.NumOfBytes");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+void Test_MM_FillMem8_CPUHogging(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ cpuaddr DestAddress = 1;
+ int32 Result;
+
+ CmdPacket.Payload.NumOfBytes = 2 * MM_INTERNAL_MAX_LOAD_DATA_SEG;
+ CmdPacket.Payload.FillPattern = 3;
+
+ /* Execute the function being tested */
+ Result = MM_FillMem8(DestAddress, &CmdPacket);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_FILL");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_MEM8");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), DestAddress);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern,
+ "MM_AppData.HkTlm.Payload.DataValue == CmdPacket.Payload.FillPattern");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == CmdPacket.Payload.NumOfBytes,
+ "MM_AppData.HkTlm.Payload.BytesProcessed == "
+ "CmdPacket.Payload.NumOfBytes");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_FillMem8_WriteError(void) {
- MM_FillMemCmd_t CmdPacket;
- /* CFE_PSP_MemWrite8 stub returns success with non-zero address */
- cpuaddr DestAddress = 0;
- int32 Result;
+void Test_MM_FillMem8_WriteError(void)
+{
+ MM_FillMemCmd_t CmdPacket;
+ /* CFE_PSP_MemWrite8 stub returns success with non-zero address */
+ cpuaddr DestAddress = 0;
+ int32 Result;
- CmdPacket.Payload.NumOfBytes = 2;
- CmdPacket.Payload.FillPattern = 3;
+ CmdPacket.Payload.NumOfBytes = 2;
+ CmdPacket.Payload.FillPattern = 3;
- /* Set to generate error message MM_PSP_WRITE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite8), 1,
- CFE_PSP_ERROR_NOT_IMPLEMENTED);
+ /* Set to generate error message MM_PSP_WRITE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemWrite8), 1, CFE_PSP_ERROR_NOT_IMPLEMENTED);
- /* Execute the function being tested */
- Result = MM_FillMem8(DestAddress, &CmdPacket);
+ /* Execute the function being tested */
+ Result = MM_FillMem8(DestAddress, &CmdPacket);
- /* Verify results */
+ /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_PSP_WRITE_ERR_EID, CFE_EVS_EventType_ERROR,
- "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM8");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_PSP_WRITE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "PSP write memory error: RC=0x%08X, Address=%p, MemType=MEM8");
}
/*
* Register the test cases to execute with the unit test tool
*/
-void UtTest_Setup(void) {
- ADD_TEST(Test_MM_LoadMem8FromFile_Nominal);
- ADD_TEST(Test_MM_LoadMem8FromFile_CPUHogging);
- ADD_TEST(Test_MM_LoadMem8FromFile_ReadError);
- ADD_TEST(Test_MM_LoadMem8FromFile_WriteError);
- ADD_TEST(Test_MM_DumpMem8ToFile_Nominal);
- ADD_TEST(Test_MM_DumpMem8ToFile_CPUHogging);
- ADD_TEST(Test_MM_DumpMem8ToFile_ReadError);
- ADD_TEST(Test_MM_DumpMem8ToFile_WriteError);
- ADD_TEST(Test_MM_FillMem8_Nominal);
- ADD_TEST(Test_MM_FillMem8_CPUHogging);
- ADD_TEST(Test_MM_FillMem8_WriteError);
+void UtTest_Setup(void)
+{
+ ADD_TEST(Test_MM_LoadMem8FromFile_Nominal);
+ ADD_TEST(Test_MM_LoadMem8FromFile_CPUHogging);
+ ADD_TEST(Test_MM_LoadMem8FromFile_ReadError);
+ ADD_TEST(Test_MM_LoadMem8FromFile_WriteError);
+ ADD_TEST(Test_MM_DumpMem8ToFile_Nominal);
+ ADD_TEST(Test_MM_DumpMem8ToFile_CPUHogging);
+ ADD_TEST(Test_MM_DumpMem8ToFile_ReadError);
+ ADD_TEST(Test_MM_DumpMem8ToFile_WriteError);
+ ADD_TEST(Test_MM_FillMem8_Nominal);
+ ADD_TEST(Test_MM_FillMem8_CPUHogging);
+ ADD_TEST(Test_MM_FillMem8_WriteError);
}
diff --git a/unit-test/mm_utils_tests.c b/unit-test/mm_utils_tests.c
index 09a6971..410a391 100644
--- a/unit-test/mm_utils_tests.c
+++ b/unit-test/mm_utils_tests.c
@@ -51,2692 +51,2756 @@
* Function Definitions
*/
-void Test_MM_ResetHk(void) {
- MM_AppData.HkTlm.Payload.LastAction = 1;
- MM_AppData.HkTlm.Payload.MemType = 2;
- MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(3);
- MM_AppData.HkTlm.Payload.DataValue = 4;
- MM_AppData.HkTlm.Payload.BytesProcessed = 5;
- MM_AppData.HkTlm.Payload.FileName[0] = 6;
+void Test_MM_ResetHk(void)
+{
+ MM_AppData.HkTlm.Payload.LastAction = 1;
+ MM_AppData.HkTlm.Payload.MemType = 2;
+ MM_AppData.HkTlm.Payload.Address = CFE_ES_MEMADDRESS_C(3);
+ MM_AppData.HkTlm.Payload.DataValue = 4;
+ MM_AppData.HkTlm.Payload.BytesProcessed = 5;
+ MM_AppData.HkTlm.Payload.FileName[0] = 6;
- /* Execute the function being tested */
- MM_ResetHk();
+ /* Execute the function being tested */
+ MM_ResetHk();
- /* Verify results */
- UtAssert_True(
- MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_NOACTION,
- "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_NOACTION");
- UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_NOMEMTYPE,
- "MM_AppData.HkTlm.Payload.MemType == MM_MemType_NOMEMTYPE");
- UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), MM_INTERNAL_CLEAR_ADDR);
- UtAssert_True(
- MM_AppData.HkTlm.Payload.DataValue == MM_INTERNAL_CLEAR_PATTERN,
- "MM_AppData.HkTlm.Payload.DataValue == MM_INTERNAL_CLEAR_PATTERN");
- UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 0,
- "MM_AppData.BytesProcessed == 0");
- UtAssert_True(
- MM_AppData.HkTlm.Payload.FileName[0] == MM_INTERNAL_CLEAR_FNAME,
- "MM_AppData.HkTlm.Payload.FileName[0] == MM_INTERNAL_CLEAR_FNAME");
+ /* Verify results */
+ UtAssert_True(MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_NOACTION,
+ "MM_AppData.HkTlm.Payload.LastAction == MM_LastAction_NOACTION");
+ UtAssert_True(MM_AppData.HkTlm.Payload.MemType == MM_MemType_NOMEMTYPE,
+ "MM_AppData.HkTlm.Payload.MemType == MM_MemType_NOMEMTYPE");
+ UtAssert_ADDRESS_EQ(CFE_ES_MEMADDRESS_TO_PTR(MM_AppData.HkTlm.Payload.Address), MM_INTERNAL_CLEAR_ADDR);
+ UtAssert_True(MM_AppData.HkTlm.Payload.DataValue == MM_INTERNAL_CLEAR_PATTERN,
+ "MM_AppData.HkTlm.Payload.DataValue == MM_INTERNAL_CLEAR_PATTERN");
+ UtAssert_True(MM_AppData.HkTlm.Payload.BytesProcessed == 0, "MM_AppData.BytesProcessed == 0");
+ UtAssert_True(MM_AppData.HkTlm.Payload.FileName[0] == MM_INTERNAL_CLEAR_FNAME,
+ "MM_AppData.HkTlm.Payload.FileName[0] == MM_INTERNAL_CLEAR_FNAME");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_SegmentBreak_Nominal(void) {
- /* Execute the function being tested */
- MM_SegmentBreak();
+void Test_MM_SegmentBreak_Nominal(void)
+{
+ /* Execute the function being tested */
+ MM_SegmentBreak();
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyPeekPokeParams_ByteWidthRAM(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_ByteWidthRAM(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Verify results */
- UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
-}
-
-void Test_MM_VerifyPeekPokeParams_WordWidthMEM16(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBits = MM_INTERNAL_WORD_BIT_WIDTH;
-
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
-
- /* Verify results */
- UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+}
+
+void Test_MM_VerifyPeekPokeParams_WordWidthMEM16(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBits = MM_INTERNAL_WORD_BIT_WIDTH;
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+
+ /* Verify results */
+ UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyPeekPokeParams_DWordWidthMEM32(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBits = MM_INTERNAL_DWORD_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_DWordWidthMEM32(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBits = MM_INTERNAL_DWORD_BIT_WIDTH;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+
+ /* Verify results */
+ UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
-
- /* Verify results */
- UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyPeekPokeParams_WordWidthAlignmentError(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBits = MM_INTERNAL_WORD_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_WordWidthAlignmentError(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBits = MM_INTERNAL_WORD_BIT_WIDTH;
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Verify results */
- UtAssert_True(Result == OS_ERROR_ADDRESS_MISALIGNED,
- "Result == OS_ERROR_ADDRESS_MISALIGNED");
+ /* Verify results */
+ UtAssert_True(Result == OS_ERROR_ADDRESS_MISALIGNED, "Result == OS_ERROR_ADDRESS_MISALIGNED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_ALIGN16_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 16 bit aligned: Addr = %p Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_ALIGN16_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 16 bit aligned: Addr = %p Size = %u");
}
-void Test_MM_VerifyPeekPokeParams_DWordWidthAlignmentError(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBits = MM_INTERNAL_DWORD_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_DWordWidthAlignmentError(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBits = MM_INTERNAL_DWORD_BIT_WIDTH;
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Verify results */
- UtAssert_True(Result == OS_ERROR_ADDRESS_MISALIGNED,
- "Result == OS_ERROR_ADDRESS_MISALIGNED");
+ /* Verify results */
+ UtAssert_True(Result == OS_ERROR_ADDRESS_MISALIGNED, "Result == OS_ERROR_ADDRESS_MISALIGNED");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_ALIGN32_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 32 bit aligned: Addr = %p Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_ALIGN32_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 32 bit aligned: Addr = %p Size = %u");
}
-void Test_MM_VerifyPeekPokeParams_InvalidDataSize(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- /* To reach size error: Peeks and Pokes must be 8 bits wide for this memory
- * type */
- size_t SizeInBits = MM_INTERNAL_WORD_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_InvalidDataSize(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ /* To reach size error: Peeks and Pokes must be 8 bits wide for this memory
+ * type */
+ size_t SizeInBits = MM_INTERNAL_WORD_BIT_WIDTH;
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Verify results */
- UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
+ /* Verify results */
+ UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_DATA_SIZE_BITS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bits invalid: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BITS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bits invalid: Data Size = %u");
}
-void Test_MM_VerifyPeekPokeParams_EEPROM(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_EEPROM(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Verify results */
- UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyPeekPokeParams_MEM8(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
-
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
-
- /* Verify results */
- UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
-}
-
-void Test_MM_VerifyPeekPokeParams_RAMValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+void Test_MM_VerifyPeekPokeParams_MEM8(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Verify results */
+ UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = MEM_RAM");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyPeekPokeParams_EEPROMValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_RAMValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = MEM_EEPROM");
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = MEM_RAM");
}
-void Test_MM_VerifyPeekPokeParams_MEM32ValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_EEPROMValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_INVALID_MEM_TYPE);
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = MEM32");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = MEM_EEPROM");
}
-void Test_MM_VerifyPeekPokeParams_MEM16ValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_MEM32ValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_INVALID_MEM_TYPE);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_INVALID_MEM_TYPE);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = MEM16");
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = MEM32");
}
-void Test_MM_VerifyPeekPokeParams_MEM8ValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = MEM8");
+void Test_MM_VerifyPeekPokeParams_MEM16ValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = MEM16");
+}
+
+void Test_MM_VerifyPeekPokeParams_MEM8ValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = MEM8");
}
-void Test_MM_VerifyPeekPokeParams_MEM32InvalidDataSize(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_MEM32InvalidDataSize(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Verify results */
- UtAssert_True(Result == OS_ERR_INVALID_SIZE,
- "Result == faOS_ERR_INVALID_SIZElse");
+ /* Verify results */
+ UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == faOS_ERR_INVALID_SIZElse");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_DATA_SIZE_BITS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bits invalid: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BITS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bits invalid: Data Size = %u");
}
-void Test_MM_VerifyPeekPokeParams_MEM16InvalidDataSize(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_MEM16InvalidDataSize(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Verify results */
- UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
+ /* Verify results */
+ UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_DATA_SIZE_BITS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bits invalid: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BITS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bits invalid: Data Size = %u");
}
-void Test_MM_VerifyPeekPokeParams_MEM8InvalidDataSize(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBits = 99;
+void Test_MM_VerifyPeekPokeParams_MEM8InvalidDataSize(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBits = 99;
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Verify results */
- UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
+ /* Verify results */
+ UtAssert_True(Result == OS_ERR_INVALID_SIZE, "Result == OS_ERR_INVALID_SIZE");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_DATA_SIZE_BITS_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bits invalid: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BITS_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bits invalid: Data Size = %u");
}
-void Test_MM_VerifyPeekPokeParams_InvalidMemType(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = 99;
- size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
+void Test_MM_VerifyPeekPokeParams_InvalidMemType(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = 99;
+ size_t SizeInBits = MM_INTERNAL_BYTE_BIT_WIDTH;
- /* Execute the function being tested */
- Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
+ /* Execute the function being tested */
+ Result = MM_VerifyPeekPokeParams(Address, MemType, SizeInBits);
- /* Verify results */
- UtAssert_True(Result == OS_ERR_INVALID_ARGUMENT,
- "Result == OS_ERR_INVALID_ARGUMENT");
+ /* Verify results */
+ UtAssert_True(Result == OS_ERR_INVALID_ARGUMENT, "Result == OS_ERR_INVALID_ARGUMENT");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid memory type specified: MemType = %d");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0, MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid memory type specified: MemType = %d");
}
/* Loading */
-void Test_MM_VerifyLoadDumpParams_LoadRAMValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = 1;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadRAMDataSizeErrorTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = 0;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadRAMDataSizeErrorTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_RAM + 1;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadEEPROMValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = 1;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadEEPROMDataSizeErrorTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = 0;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadEEPROMDataSizeErrorTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_EEPROM + 1;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadMEM32ValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 4;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadMEM32DataSizeErrorTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 0;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadMEM32DataSizeErrorTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM32 + 4;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadMEM32AlignmentError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 1;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED,
- "Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_ALIGN32_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 32 bit aligned: Addr = %p Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadMEM16ValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 2;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadMEM16DataSizeErrorTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 0;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadMEM16DataSizeErrorTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM16 + 2;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadMEM16AlignmentError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 1;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED,
- "Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_ALIGN16_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 16 bit aligned: Addr = %p Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_LoadMEM8ValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = 1;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
+void Test_MM_VerifyLoadDumpParams_LoadRAMValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = 1;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadRAMDataSizeErrorTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = 0;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadRAMDataSizeErrorTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_RAM + 1;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadEEPROMValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = 1;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadEEPROMDataSizeErrorTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = 0;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadEEPROMDataSizeErrorTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_EEPROM + 1;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadMEM32ValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 4;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadMEM32DataSizeErrorTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 0;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadMEM32DataSizeErrorTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM32 + 4;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadMEM32AlignmentError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 1;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED, "Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_ALIGN32_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 32 bit aligned: Addr = %p Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadMEM16ValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 2;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadMEM16DataSizeErrorTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 0;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadMEM16DataSizeErrorTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM16 + 2;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadMEM16AlignmentError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 1;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED, "Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_ALIGN16_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 16 bit aligned: Addr = %p Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_LoadMEM8ValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = 1;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
}
-void Test_MM_VerifyLoadDumpParams_LoadMEM8DataSizeErrorTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = 0;
+void Test_MM_VerifyLoadDumpParams_LoadMEM8DataSizeErrorTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = 0;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
}
-void Test_MM_VerifyLoadDumpParams_LoadMEM8DataSizeErrorTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM8 + 1;
+void Test_MM_VerifyLoadDumpParams_LoadMEM8DataSizeErrorTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM8 + 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
}
-void Test_MM_VerifyLoadDumpParams_LoadInvalidMemTypeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = 99;
- size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM8 + 1;
+void Test_MM_VerifyLoadDumpParams_LoadInvalidMemTypeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = 99;
+ size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM8 + 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_LOAD);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid memory type specified: MemType = %d");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0, MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid memory type specified: MemType = %d");
}
-void Test_MM_VerifyLoadDumpParams_LoadInvalidVerifyTypeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM8;
+void Test_MM_VerifyLoadDumpParams_LoadInvalidVerifyTypeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = MM_INTERNAL_MAX_LOAD_FILE_DATA_MEM8;
- /* Execute the function being tested */
- Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, -1);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, -1);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
/* Dumping */
-void Test_MM_VerifyLoadDumpParams_DumpRAM(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = 1;
+void Test_MM_VerifyLoadDumpParams_DumpRAM(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadDumpParams_DumpEEPROM(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = 1;
+void Test_MM_VerifyLoadDumpParams_DumpEEPROM(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadDumpParams_DumpMEM32(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 4;
+void Test_MM_VerifyLoadDumpParams_DumpMEM32(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 4;
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemValidateRange), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemValidateRange), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadDumpParams_DumpMEM16(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 2;
+void Test_MM_VerifyLoadDumpParams_DumpMEM16(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 2;
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemValidateRange), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemValidateRange), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadDumpParams_DumpMEM8(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = 1;
+void Test_MM_VerifyLoadDumpParams_DumpMEM8(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = 1;
- UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemValidateRange), CFE_PSP_SUCCESS);
+ UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_MemValidateRange), CFE_PSP_SUCCESS);
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadDumpParams_DumpRAMRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = 1;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
+void Test_MM_VerifyLoadDumpParams_DumpRAMRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = 1;
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpRAMInvalidSizeTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = 0;
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
}
-void Test_MM_VerifyLoadDumpParams_DumpRAMInvalidSizeTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_FILE_DATA_RAM + 1;
+void Test_MM_VerifyLoadDumpParams_DumpRAMInvalidSizeTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = 0;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
}
-void Test_MM_VerifyLoadDumpParams_DumpEEPROMRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = 1;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
+void Test_MM_VerifyLoadDumpParams_DumpRAMInvalidSizeTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_FILE_DATA_RAM + 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
-void Test_MM_VerifyLoadDumpParams_DumpEEPROMInvalidSizeTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = 0;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpEEPROMInvalidSizeTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_FILE_DATA_EEPROM + 1;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpMEM32RangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 4;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
-void Test_MM_VerifyLoadDumpParams_DumpMEM32InvalidSizeTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 0;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpMEM32InvalidSizeTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM32 + 4;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpMEM32AlignmentError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 3;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
-
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR_ADDRESS_MISALIGNED);
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_ALIGN32_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 32 bit aligned: Addr = %p Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpMEM16RangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 2;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpMEM16InvalidSizeTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 0;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpMEM16InvalidSizeTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM16 + 2;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpMEM16AlignmentError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 3;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED,
- "Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED");
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_ALIGN16_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 16 bit aligned: Addr = %p Size = %u");
-}
+void Test_MM_VerifyLoadDumpParams_DumpEEPROMRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = 1;
-void Test_MM_VerifyLoadDumpParams_DumpMEM8RangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = 1;
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpEEPROMInvalidSizeTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = 0;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpEEPROMInvalidSizeTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_FILE_DATA_EEPROM + 1;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpMEM32RangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 4;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpMEM32InvalidSizeTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 0;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpMEM32InvalidSizeTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM32 + 4;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpMEM32AlignmentError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 3;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR_ADDRESS_MISALIGNED);
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_ALIGN32_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 32 bit aligned: Addr = %p Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpMEM16RangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 2;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpMEM16InvalidSizeTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 0;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpMEM16InvalidSizeTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM16 + 2;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpMEM16AlignmentError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 3;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED, "Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_ALIGN16_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 16 bit aligned: Addr = %p Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpMEM8RangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
}
-void Test_MM_VerifyLoadDumpParams_DumpMEM8InvalidSizeTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = 0;
+void Test_MM_VerifyLoadDumpParams_DumpMEM8InvalidSizeTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = 0;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
}
-void Test_MM_VerifyLoadDumpParams_DumpMEM8InvalidSizeTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM8 + 1;
+void Test_MM_VerifyLoadDumpParams_DumpMEM8InvalidSizeTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_FILE_DATA_MEM8 + 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
}
-void Test_MM_VerifyLoadDumpParams_DumpInvalidMemoryType(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = 99;
- size_t SizeInBytes = 1;
+void Test_MM_VerifyLoadDumpParams_DumpInvalidMemoryType(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = 99;
+ size_t SizeInBytes = 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_DUMP);
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid memory type specified: MemType = %d");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0, MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid memory type specified: MemType = %d");
}
/* Dump in event */
-void Test_MM_VerifyLoadDumpParams_DumpEventRAM(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = 1;
+void Test_MM_VerifyLoadDumpParams_DumpEventRAM(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadDumpParams_DumpEventEEPROM(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = 1;
+void Test_MM_VerifyLoadDumpParams_DumpEventEEPROM(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadDumpParams_DumpEventMEM32(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 4;
+void Test_MM_VerifyLoadDumpParams_DumpEventMEM32(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 4;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadDumpParams_DumpEventMEM16(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 2;
+void Test_MM_VerifyLoadDumpParams_DumpEventMEM16(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 2;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadDumpParams_DumpEventMEM8(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = 1;
+void Test_MM_VerifyLoadDumpParams_DumpEventMEM8(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadDumpParams_DumpEventInvalidDataSizeTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = 0;
+void Test_MM_VerifyLoadDumpParams_DumpEventInvalidDataSizeTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = 0;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
}
-void Test_MM_VerifyLoadDumpParams_DumpEventInvalidDataSizeTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_INEVENT_BYTES + 1;
+void Test_MM_VerifyLoadDumpParams_DumpEventInvalidDataSizeTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = MM_INTERNAL_MAX_DUMP_INEVENT_BYTES + 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
}
-void Test_MM_VerifyLoadDumpParams_DumpEventRAMRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = 1;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
+void Test_MM_VerifyLoadDumpParams_DumpEventRAMRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpEventEEPROMRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = 1;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
}
-void Test_MM_VerifyLoadDumpParams_DumpEventMEM32RangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 4;
+void Test_MM_VerifyLoadDumpParams_DumpEventEEPROMRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = 1;
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpEventMEM32AlignmentError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 3;
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
-
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR_ADDRESS_MISALIGNED);
-
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_ALIGN32_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 32 bit aligned: Addr = %p Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_DumpEventMEM16RangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 2;
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpEventMEM32RangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 4;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpEventMEM32AlignmentError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 3;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR_ADDRESS_MISALIGNED);
+
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_ALIGN32_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 32 bit aligned: Addr = %p Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_DumpEventMEM16RangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 2;
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
}
-void Test_MM_VerifyLoadDumpParams_DumpEventMEM16AlignmentError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 3;
+void Test_MM_VerifyLoadDumpParams_DumpEventMEM16AlignmentError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 3;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR_ADDRESS_MISALIGNED);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR_ADDRESS_MISALIGNED);
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_ALIGN16_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 16 bit aligned: Addr = %p Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_ALIGN16_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 16 bit aligned: Addr = %p Size = %u");
}
-void Test_MM_VerifyLoadDumpParams_DumpEventMEM8RangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = 1;
+void Test_MM_VerifyLoadDumpParams_DumpEventMEM8RangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = 1;
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
}
-void Test_MM_VerifyLoadDumpParams_DumpEventInvalidMemType(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = 99;
- size_t SizeInBytes = 1;
+void Test_MM_VerifyLoadDumpParams_DumpEventInvalidMemType(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = 99;
+ size_t SizeInBytes = 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_EVENT);
- /* Verify results */
- UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, CFE_PSP_ERROR);
- /* no command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* no command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid memory type specified: MemType = %d");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0, MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid memory type specified: MemType = %d");
}
/* Fill */
-void Test_MM_VerifyLoadDumpParams_FillRAMValidateRangeError(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = 1;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
-
-void Test_MM_VerifyLoadDumpParams_FillRAMDataSizeErrorTooSmall(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = 0;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
+void Test_MM_VerifyLoadDumpParams_FillRAMValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = 1;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
-void Test_MM_VerifyLoadDumpParams_FillRAMDataSizeErrorTooLarge(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_RAM;
- size_t SizeInBytes = MM_INTERNAL_MAX_FILL_DATA_RAM + 1;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillRAMDataSizeErrorTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = 0;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillRAMDataSizeErrorTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_RAM;
+ size_t SizeInBytes = MM_INTERNAL_MAX_FILL_DATA_RAM + 1;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillEEPROMValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = 1;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillEEPROMDataSizeErrorTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = 0;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillEEPROMDataSizeErrorTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
+ size_t SizeInBytes = MM_INTERNAL_MAX_FILL_DATA_EEPROM + 1;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillMEM32ValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 4;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillMEM32DataSizeErrorTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 0;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillMEM32DataSizeErrorTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = MM_INTERNAL_MAX_FILL_DATA_MEM32 + 4;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillMEM32AlignmentError(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM32;
+ size_t SizeInBytes = 1;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED, "Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_ALIGN32_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 32 bit aligned: Addr = %p Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillMEM16ValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 2;
+
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillMEM16DataSizeErrorTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 0;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillMEM16DataSizeErrorTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 0;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = MM_INTERNAL_MAX_FILL_DATA_MEM16 + 2;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillMEM16AlignmentError(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM16;
+ size_t SizeInBytes = 1;
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED, "Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED");
+
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
+
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_ALIGN16_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data and address not 16 bit aligned: Addr = %p Size = %u");
+}
+
+void Test_MM_VerifyLoadDumpParams_FillMEM8ValidateRangeError(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = 1;
-void Test_MM_VerifyLoadDumpParams_FillEEPROMValidateRangeError(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = 1;
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
+
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
-void Test_MM_VerifyLoadDumpParams_FillEEPROMDataSizeErrorTooSmall(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = 0;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_FillEEPROMDataSizeErrorTooLarge(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_EEPROM;
- size_t SizeInBytes = MM_INTERNAL_MAX_FILL_DATA_EEPROM + 1;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_FillMEM32ValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 4;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
-
-void Test_MM_VerifyLoadDumpParams_FillMEM32DataSizeErrorTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 0;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_FillMEM32DataSizeErrorTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = MM_INTERNAL_MAX_FILL_DATA_MEM32 + 4;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_FillMEM32AlignmentError(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_MEM32;
- size_t SizeInBytes = 1;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED,
- "Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_ALIGN32_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 32 bit aligned: Addr = %p Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_FillMEM16ValidateRangeError(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 2;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
-}
-
-void Test_MM_VerifyLoadDumpParams_FillMEM16DataSizeErrorTooSmall(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 0;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_FillMEM16DataSizeErrorTooLarge(void) {
- int32 Result;
- uint32 Address = 0;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = MM_INTERNAL_MAX_FILL_DATA_MEM16 + 2;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_FillMEM16AlignmentError(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_MEM16;
- size_t SizeInBytes = 1;
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED,
- "Result == CFE_PSP_ERROR_ADDRESS_MISALIGNED");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_ALIGN16_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data and address not 16 bit aligned: Addr = %p Size = %u");
-}
-
-void Test_MM_VerifyLoadDumpParams_FillMEM8ValidateRangeError(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = 1;
-
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
-
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
-
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
-
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
-
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
}
-void Test_MM_VerifyLoadDumpParams_FillMEM8DataSizeErrorTooSmall(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = 0;
+void Test_MM_VerifyLoadDumpParams_FillMEM8DataSizeErrorTooSmall(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = 0;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
}
-void Test_MM_VerifyLoadDumpParams_FillMEM8DataSizeErrorTooLarge(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = MM_MemType_MEM8;
- size_t SizeInBytes = MM_INTERNAL_MAX_FILL_DATA_MEM8 + 1;
+void Test_MM_VerifyLoadDumpParams_FillMEM8DataSizeErrorTooLarge(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = MM_MemType_MEM8;
+ size_t SizeInBytes = MM_INTERNAL_MAX_FILL_DATA_MEM8 + 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
}
-void Test_MM_VerifyLoadDumpParams_FillInvalidMemTypeError(void) {
- int32 Result;
- uint32 Address = 1;
- MM_MemType_Enum_t MemType = 99;
- size_t SizeInBytes = 1;
+void Test_MM_VerifyLoadDumpParams_FillInvalidMemTypeError(void)
+{
+ int32 Result;
+ uint32 Address = 1;
+ MM_MemType_Enum_t MemType = 99;
+ size_t SizeInBytes = 1;
- /* Execute the function being tested */
- Result =
- MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MemType, SizeInBytes, MM_VERIFY_FILL);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR,
- "Invalid memory type specified: MemType = %d");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0, MM_MEMTYPE_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid memory type specified: MemType = %d");
}
/* WID */
-void Test_MM_VerifyLoadDumpParams_WIDNominal(void) {
- uint32 Address = 0;
- size_t SizeInBytes = 1;
- int32 Result;
+void Test_MM_VerifyLoadDumpParams_WIDNominal(void)
+{
+ uint32 Address = 0;
+ size_t SizeInBytes = 1;
+ int32 Result;
- /* Execute the function being tested */
- Result = MM_VerifyLoadDumpParams(Address, MM_MemType_RAM, SizeInBytes,
- MM_VERIFY_WID);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MM_MemType_RAM, SizeInBytes, MM_VERIFY_WID);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_SUCCESS, "Result == CFE_PSP_SUCCESS");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0);
}
-void Test_MM_VerifyLoadDumpParams_WIDMemValidateError(void) {
- uint32 Address = 0;
- size_t SizeInBytes = 1;
- int32 Result;
+void Test_MM_VerifyLoadDumpParams_WIDMemValidateError(void)
+{
+ uint32 Address = 0;
+ size_t SizeInBytes = 1;
+ int32 Result;
- /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
- UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1,
- CFE_PSP_INVALID_MEM_TYPE);
+ /* Set to generate error message MM_OS_MEMVALIDATE_ERR_EID */
+ UT_SetDeferredRetcode(UT_KEY(CFE_PSP_MemValidateRange), 1, CFE_PSP_INVALID_MEM_TYPE);
- /* Execute the function being tested */
- Result = MM_VerifyLoadDumpParams(Address, MM_MemType_RAM, SizeInBytes,
- MM_VERIFY_WID);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MM_MemType_RAM, SizeInBytes, MM_VERIFY_WID);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE,
- "Result == CFE_PSP_INVALID_MEM_TYPE");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_INVALID_MEM_TYPE, "Result == CFE_PSP_INVALID_MEM_TYPE");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(0, MM_OS_MEMVALIDATE_ERR_EID, CFE_EVS_EventType_ERROR,
- "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
- "Addr = %p Size = %u MemType = %s");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_OS_MEMVALIDATE_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "CFE_PSP_MemValidateRange error received: RC = 0x%08X "
+ "Addr = %p Size = %u MemType = %s");
}
-void Test_MM_VerifyLoadDumpParams_WIDDataSizeErrorTooSmall(void) {
- uint32 Address = 0;
- size_t SizeInBytes = 0;
- int32 Result;
+void Test_MM_VerifyLoadDumpParams_WIDDataSizeErrorTooSmall(void)
+{
+ uint32 Address = 0;
+ size_t SizeInBytes = 0;
+ int32 Result;
- /* Execute the function being tested */
- Result = MM_VerifyLoadDumpParams(Address, MM_MemType_RAM, SizeInBytes,
- MM_VERIFY_WID);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MM_MemType_RAM, SizeInBytes, MM_VERIFY_WID);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
}
-void Test_MM_VerifyLoadDumpParams_WIDDataSizeErrorTooLarge(void) {
- uint32 Address = 0;
- size_t SizeInBytes = MM_INTERFACE_MAX_UNINTERRUPTIBLE_DATA + 1;
- int32 Result;
+void Test_MM_VerifyLoadDumpParams_WIDDataSizeErrorTooLarge(void)
+{
+ uint32 Address = 0;
+ size_t SizeInBytes = MM_INTERFACE_MAX_UNINTERRUPTIBLE_DATA + 1;
+ int32 Result;
- /* Execute the function being tested */
- Result = MM_VerifyLoadDumpParams(Address, MM_MemType_RAM, SizeInBytes,
- MM_VERIFY_WID);
+ /* Execute the function being tested */
+ Result = MM_VerifyLoadDumpParams(Address, MM_MemType_RAM, SizeInBytes, MM_VERIFY_WID);
- /* Verify results */
- UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == CFE_PSP_ERROR, "Result == CFE_PSP_ERROR");
- /* No command-handling function should be updating the cmd or err counter
- * itself */
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CmdCounter, 0);
- UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.ErrCounter, 0);
+ /* No command-handling function should be updating the cmd or err counter
+ * itself */
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandCounter, 0);
+ UtAssert_INT32_EQ(MM_AppData.HkTlm.Payload.CommandErrorCounter, 0);
- UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
- MM_Test_Verify_Event(
- 0, MM_DATA_SIZE_BYTES_ERR_EID, CFE_EVS_EventType_ERROR,
- "Data size in bytes invalid or exceeds limits: Data Size = %u");
+ UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 1);
+ MM_Test_Verify_Event(0,
+ MM_DATA_SIZE_BYTES_ERR_EID,
+ CFE_EVS_EventType_ERROR,
+ "Data size in bytes invalid or exceeds limits: Data Size = %u");
}
-void Test_MM_Verify32Aligned(void) {
- bool Result;
- cpuaddr Addr;
- size_t Size;
+void Test_MM_Verify32Aligned(void)
+{
+ bool Result;
+ cpuaddr Addr;
+ size_t Size;
- Addr = 0; /* address is aligned */
- Size = 4; /* size is aligned */
+ Addr = 0; /* address is aligned */
+ Size = 4; /* size is aligned */
- /* Execute the function being tested */
- Result = MM_Verify32Aligned(Addr, Size);
+ /* Execute the function being tested */
+ Result = MM_Verify32Aligned(Addr, Size);
- /* Verify results */
- UtAssert_True(Result == true, "Result == true");
+ /* Verify results */
+ UtAssert_True(Result == true, "Result == true");
- Addr = 0; /* address is aligned */
- Size = 1; /* size is not aligned */
+ Addr = 0; /* address is aligned */
+ Size = 1; /* size is not aligned */
- /* Execute the function being tested */
- Result = MM_Verify32Aligned(Addr, Size);
+ /* Execute the function being tested */
+ Result = MM_Verify32Aligned(Addr, Size);
- /* Verify results */
- UtAssert_True(Result == false, "Result == false");
+ /* Verify results */
+ UtAssert_True(Result == false, "Result == false");
- Addr = 1; /* address is not aligned */
- Size = 0; /* size is aligned */
+ Addr = 1; /* address is not aligned */
+ Size = 0; /* size is aligned */
- /* Execute the function being tested */
- Result = MM_Verify32Aligned(Addr, Size);
+ /* Execute the function being tested */
+ Result = MM_Verify32Aligned(Addr, Size);
- /* Verify results */
- UtAssert_True(Result == false, "Result == false");
+ /* Verify results */
+ UtAssert_True(Result == false, "Result == false");
}
-void Test_MM_Verify16Aligned(void) {
- bool Result;
- cpuaddr Addr;
- size_t Size;
+void Test_MM_Verify16Aligned(void)
+{
+ bool Result;
+ cpuaddr Addr;
+ size_t Size;
- Addr = 0; /* address is aligned */
- Size = 4; /* size is aligned */
+ Addr = 0; /* address is aligned */
+ Size = 4; /* size is aligned */
- /* Execute the function being tested */
- Result = MM_Verify16Aligned(Addr, Size);
+ /* Execute the function being tested */
+ Result = MM_Verify16Aligned(Addr, Size);
- /* Verify results */
- UtAssert_True(Result == true, "Result == true");
+ /* Verify results */
+ UtAssert_True(Result == true, "Result == true");
- Addr = 0; /* address is aligned */
- Size = 1; /* size is not aligned */
+ Addr = 0; /* address is aligned */
+ Size = 1; /* size is not aligned */
- /* Execute the function being tested */
- Result = MM_Verify16Aligned(Addr, Size);
+ /* Execute the function being tested */
+ Result = MM_Verify16Aligned(Addr, Size);
- /* Verify results */
- UtAssert_True(Result == false, "Result == false");
+ /* Verify results */
+ UtAssert_True(Result == false, "Result == false");
- Addr = 1; /* address is not aligned */
- Size = 0; /* size is aligned */
+ Addr = 1; /* address is not aligned */
+ Size = 0; /* size is aligned */
- /* Execute the function being tested */
- Result = MM_Verify16Aligned(Addr, Size);
+ /* Execute the function being tested */
+ Result = MM_Verify16Aligned(Addr, Size);
- /* Verify results */
- UtAssert_True(Result == false, "Result == false");
+ /* Verify results */
+ UtAssert_True(Result == false, "Result == false");
}
-void Test_MM_ResolveSymAddr_Nominal(void) {
- MM_SymAddr_t SymAddr;
- cpuaddr OldResolvedAddr;
- cpuaddr ResolvedAddr;
- int32 Result;
+void Test_MM_ResolveSymAddr_Nominal(void)
+{
+ MM_SymAddr_t SymAddr;
+ cpuaddr OldResolvedAddr;
+ cpuaddr ResolvedAddr;
+ int32 Result;
- memset(&SymAddr, 0, sizeof(MM_SymAddr_t));
- strncpy(SymAddr.SymName, "symname", sizeof(SymAddr.SymName));
- SymAddr.Offset = CFE_ES_MEMADDRESS_C(22);
- OldResolvedAddr = 20;
- ResolvedAddr = OldResolvedAddr;
+ memset(&SymAddr, 0, sizeof(MM_SymAddr_t));
+ strncpy(SymAddr.SymName, "symname", sizeof(SymAddr.SymName));
+ SymAddr.Offset = CFE_ES_MEMADDRESS_C(22);
+ OldResolvedAddr = 20;
+ ResolvedAddr = OldResolvedAddr;
- UT_SetDataBuffer(UT_KEY(OS_SymbolLookup), &ResolvedAddr, sizeof(ResolvedAddr),
- false);
- UT_SetDefaultReturnValue(UT_KEY(OS_SymbolLookup), OS_SUCCESS);
+ UT_SetDataBuffer(UT_KEY(OS_SymbolLookup), &ResolvedAddr, sizeof(ResolvedAddr), false);
+ UT_SetDefaultReturnValue(UT_KEY(OS_SymbolLookup), OS_SUCCESS);
- /* Execute the function being tested */
- Result = MM_ResolveSymAddr(&SymAddr, &ResolvedAddr);
+ /* Execute the function being tested */
+ Result = MM_ResolveSymAddr(&SymAddr, &ResolvedAddr);
- /* Verify results */
- UtAssert_INT32_EQ(Result, OS_SUCCESS);
- OldResolvedAddr += (cpuaddr)CFE_ES_MEMADDRESS_TO_PTR(SymAddr.Offset);
- UtAssert_ADDRESS_EQ(ResolvedAddr, OldResolvedAddr);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, OS_SUCCESS);
+ OldResolvedAddr += (cpuaddr)CFE_ES_MEMADDRESS_TO_PTR(SymAddr.Offset);
+ UtAssert_ADDRESS_EQ(ResolvedAddr, OldResolvedAddr);
}
-void Test_MM_ResolveSymAddr_NullString(void) {
- MM_SymAddr_t SymAddr;
- cpuaddr ResolvedAddr;
- int32 Result;
+void Test_MM_ResolveSymAddr_NullString(void)
+{
+ MM_SymAddr_t SymAddr;
+ cpuaddr ResolvedAddr;
+ int32 Result;
- memset(&SymAddr, 0, sizeof(MM_SymAddr_t));
- SymAddr.Offset = CFE_ES_MEMADDRESS_C(99);
- ResolvedAddr = 0;
+ memset(&SymAddr, 0, sizeof(MM_SymAddr_t));
+ SymAddr.Offset = CFE_ES_MEMADDRESS_C(99);
+ ResolvedAddr = 0;
- /* Execute the function being tested */
- Result = MM_ResolveSymAddr(&SymAddr, &ResolvedAddr);
+ /* Execute the function being tested */
+ Result = MM_ResolveSymAddr(&SymAddr, &ResolvedAddr);
- /* Verify results */
- UtAssert_INT32_EQ(Result, OS_ERROR_NAME_LENGTH);
- UtAssert_ADDRESS_EQ(ResolvedAddr, CFE_ES_MEMADDRESS_TO_PTR(SymAddr.Offset));
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, OS_SUCCESS);
+ UtAssert_ADDRESS_EQ(ResolvedAddr, CFE_ES_MEMADDRESS_TO_PTR(SymAddr.Offset));
}
-void Test_MM_ResolveSymAddr_SymLookupErr(void) {
- MM_SymAddr_t SymAddr;
- cpuaddr ResolvedAddr;
- int32 Result;
+void Test_MM_ResolveSymAddr_SymLookupErr(void)
+{
+ MM_SymAddr_t SymAddr;
+ cpuaddr ResolvedAddr;
+ int32 Result;
+
+ UT_SetDefaultReturnValue(UT_KEY(OS_SymbolLookup), OS_ERROR);
- UT_SetDefaultReturnValue(UT_KEY(OS_SymbolLookup), OS_ERROR);
+ memset(&SymAddr, 0xEE, sizeof(SymAddr));
- /* Execute the function being tested */
- Result = MM_ResolveSymAddr(&SymAddr, &ResolvedAddr);
+ /* Execute the function being tested */
+ Result = MM_ResolveSymAddr(&SymAddr, &ResolvedAddr);
- /* Verify results */
- UtAssert_INT32_EQ(Result, OS_ERROR);
+ /* Verify results */
+ UtAssert_INT32_EQ(Result, OS_ERROR);
}
-void Test_MM_ComputeCRCFromFile(void) {
- osal_id_t FileHandle;
- uint32 CrcPtr;
- uint32 TypeCRC;
- int32 Result;
+void Test_MM_ComputeCRCFromFile(void)
+{
+ osal_id_t FileHandle;
+ uint32 CrcPtr;
+ uint32 TypeCRC;
+ int32 Result;
- FileHandle = MM_UT_OBJID_1;
- CrcPtr = 0;
- TypeCRC = 0;
+ FileHandle = MM_UT_OBJID_1;
+ CrcPtr = 0;
+ TypeCRC = 0;
- UT_SetDataBuffer(UT_KEY(OS_read), &FileHandle, sizeof(FileHandle), false);
- UT_SetDeferredRetcode(UT_KEY(OS_read), 1, 1);
- UT_SetDeferredRetcode(UT_KEY(OS_read), 1, 0);
+ UT_SetDataBuffer(UT_KEY(OS_read), &FileHandle, sizeof(FileHandle), false);
+ UT_SetDeferredRetcode(UT_KEY(OS_read), 1, 1);
+ UT_SetDeferredRetcode(UT_KEY(OS_read), 1, 0);
- UT_SetDefaultReturnValue(UT_KEY(CFE_ES_CalculateCRC), 1);
+ UT_SetDefaultReturnValue(UT_KEY(CFE_ES_CalculateCRC), 1);
- /* Execute the function being tested */
- Result = MM_ComputeCRCFromFile(FileHandle, &CrcPtr, TypeCRC);
+ /* Execute the function being tested */
+ Result = MM_ComputeCRCFromFile(FileHandle, &CrcPtr, TypeCRC);
- /* Verify results */
- UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
- UtAssert_True(CrcPtr == 1, "CrcPtr == 1");
+ /* Verify results */
+ UtAssert_True(Result == OS_SUCCESS, "Result == OS_SUCCESS");
+ UtAssert_True(CrcPtr == 1, "CrcPtr == 1");
- CrcPtr = 0;
+ CrcPtr = 0;
- UT_SetDataBuffer(UT_KEY(OS_read), &FileHandle, sizeof(FileHandle), false);
- UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_ERROR);
+ UT_SetDataBuffer(UT_KEY(OS_read), &FileHandle, sizeof(FileHandle), false);
+ UT_SetDeferredRetcode(UT_KEY(OS_read), 1, OS_ERROR);
- UT_SetDefaultReturnValue(UT_KEY(CFE_ES_CalculateCRC), 1);
+ UT_SetDefaultReturnValue(UT_KEY(CFE_ES_CalculateCRC), 1);
- /* Execute the function being tested */
- Result = MM_ComputeCRCFromFile(FileHandle, &CrcPtr, TypeCRC);
+ /* Execute the function being tested */
+ Result = MM_ComputeCRCFromFile(FileHandle, &CrcPtr, TypeCRC);
- /* Verify results */
- UtAssert_True(Result == OS_ERROR, "Result == OS_ERROR");
+ /* Verify results */
+ UtAssert_True(Result == OS_ERROR, "Result == OS_ERROR");
}
/*
* Register the test cases to execute with the unit test tool
*/
-void UtTest_Setup(void) {
- ADD_TEST(Test_MM_ResetHk);
- ADD_TEST(Test_MM_SegmentBreak_Nominal);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_ByteWidthRAM);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_WordWidthMEM16);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_DWordWidthMEM32);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_WordWidthAlignmentError);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_DWordWidthAlignmentError);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_InvalidDataSize);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_EEPROM);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM8);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_RAMValidateRangeError);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_EEPROMValidateRangeError);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM32ValidateRangeError);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM16ValidateRangeError);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM8ValidateRangeError);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM32InvalidDataSize);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM16InvalidDataSize);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM8InvalidDataSize);
- ADD_TEST(Test_MM_VerifyPeekPokeParams_InvalidMemType);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadRAMValidateRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadRAMDataSizeErrorTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadRAMDataSizeErrorTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadEEPROMValidateRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadEEPROMDataSizeErrorTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadEEPROMDataSizeErrorTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM32ValidateRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM32DataSizeErrorTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM32DataSizeErrorTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM32AlignmentError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM16ValidateRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM16DataSizeErrorTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM16DataSizeErrorTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM16AlignmentError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM8ValidateRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM8DataSizeErrorTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM8DataSizeErrorTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadInvalidMemTypeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadInvalidVerifyTypeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpRAM);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEEPROM);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM32);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM16);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM8);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpRAMRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpRAMInvalidSizeTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpRAMInvalidSizeTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEEPROMRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEEPROMInvalidSizeTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEEPROMInvalidSizeTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM32RangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM32InvalidSizeTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM32InvalidSizeTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM32AlignmentError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM16RangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM16InvalidSizeTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM16InvalidSizeTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM16AlignmentError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM8RangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM8InvalidSizeTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM8InvalidSizeTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpInvalidMemoryType);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventRAM);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventEEPROM);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM32);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM16);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM8);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventInvalidDataSizeTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventInvalidDataSizeTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventRAMRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventEEPROMRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM32RangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM32AlignmentError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM16RangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM16AlignmentError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM8RangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventInvalidMemType);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillRAMValidateRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillRAMDataSizeErrorTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillRAMDataSizeErrorTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillEEPROMValidateRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillEEPROMDataSizeErrorTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillEEPROMDataSizeErrorTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM32ValidateRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM32DataSizeErrorTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM32DataSizeErrorTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM32AlignmentError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM16ValidateRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM16DataSizeErrorTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM16DataSizeErrorTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM16AlignmentError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM8ValidateRangeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM8DataSizeErrorTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM8DataSizeErrorTooLarge);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_FillInvalidMemTypeError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_WIDNominal);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_WIDMemValidateError);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_WIDDataSizeErrorTooSmall);
- ADD_TEST(Test_MM_VerifyLoadDumpParams_WIDDataSizeErrorTooLarge);
- ADD_TEST(Test_MM_Verify32Aligned);
- ADD_TEST(Test_MM_Verify16Aligned);
- ADD_TEST(Test_MM_ResolveSymAddr_Nominal);
- ADD_TEST(Test_MM_ResolveSymAddr_NullString);
- ADD_TEST(Test_MM_ResolveSymAddr_SymLookupErr);
- ADD_TEST(Test_MM_ComputeCRCFromFile);
+void UtTest_Setup(void)
+{
+ ADD_TEST(Test_MM_ResetHk);
+ ADD_TEST(Test_MM_SegmentBreak_Nominal);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_ByteWidthRAM);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_WordWidthMEM16);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_DWordWidthMEM32);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_WordWidthAlignmentError);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_DWordWidthAlignmentError);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_InvalidDataSize);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_EEPROM);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM8);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_RAMValidateRangeError);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_EEPROMValidateRangeError);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM32ValidateRangeError);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM16ValidateRangeError);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM8ValidateRangeError);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM32InvalidDataSize);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM16InvalidDataSize);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_MEM8InvalidDataSize);
+ ADD_TEST(Test_MM_VerifyPeekPokeParams_InvalidMemType);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadRAMValidateRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadRAMDataSizeErrorTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadRAMDataSizeErrorTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadEEPROMValidateRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadEEPROMDataSizeErrorTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadEEPROMDataSizeErrorTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM32ValidateRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM32DataSizeErrorTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM32DataSizeErrorTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM32AlignmentError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM16ValidateRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM16DataSizeErrorTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM16DataSizeErrorTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM16AlignmentError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM8ValidateRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM8DataSizeErrorTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadMEM8DataSizeErrorTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadInvalidMemTypeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_LoadInvalidVerifyTypeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpRAM);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEEPROM);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM32);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM16);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM8);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpRAMRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpRAMInvalidSizeTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpRAMInvalidSizeTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEEPROMRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEEPROMInvalidSizeTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEEPROMInvalidSizeTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM32RangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM32InvalidSizeTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM32InvalidSizeTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM32AlignmentError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM16RangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM16InvalidSizeTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM16InvalidSizeTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM16AlignmentError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM8RangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM8InvalidSizeTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpMEM8InvalidSizeTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpInvalidMemoryType);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventRAM);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventEEPROM);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM32);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM16);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM8);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventInvalidDataSizeTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventInvalidDataSizeTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventRAMRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventEEPROMRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM32RangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM32AlignmentError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM16RangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM16AlignmentError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventMEM8RangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_DumpEventInvalidMemType);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillRAMValidateRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillRAMDataSizeErrorTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillRAMDataSizeErrorTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillEEPROMValidateRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillEEPROMDataSizeErrorTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillEEPROMDataSizeErrorTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM32ValidateRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM32DataSizeErrorTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM32DataSizeErrorTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM32AlignmentError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM16ValidateRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM16DataSizeErrorTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM16DataSizeErrorTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM16AlignmentError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM8ValidateRangeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM8DataSizeErrorTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillMEM8DataSizeErrorTooLarge);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_FillInvalidMemTypeError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_WIDNominal);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_WIDMemValidateError);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_WIDDataSizeErrorTooSmall);
+ ADD_TEST(Test_MM_VerifyLoadDumpParams_WIDDataSizeErrorTooLarge);
+ ADD_TEST(Test_MM_Verify32Aligned);
+ ADD_TEST(Test_MM_Verify16Aligned);
+ ADD_TEST(Test_MM_ResolveSymAddr_Nominal);
+ ADD_TEST(Test_MM_ResolveSymAddr_NullString);
+ ADD_TEST(Test_MM_ResolveSymAddr_SymLookupErr);
+ ADD_TEST(Test_MM_ComputeCRCFromFile);
}
diff --git a/unit-test/stubs/mm_app_stubs.c b/unit-test/stubs/mm_app_stubs.c
index 735d1b4..624eef2 100644
--- a/unit-test/stubs/mm_app_stubs.c
+++ b/unit-test/stubs/mm_app_stubs.c
@@ -30,12 +30,13 @@
* Generated stub function for MM_AppInit()
* ----------------------------------------------------
*/
-CFE_Status_t MM_AppInit(void) {
- UT_GenStub_SetupReturnBuffer(MM_AppInit, CFE_Status_t);
+CFE_Status_t MM_AppInit(void)
+{
+ UT_GenStub_SetupReturnBuffer(MM_AppInit, CFE_Status_t);
- UT_GenStub_Execute(MM_AppInit, Basic, NULL);
+ UT_GenStub_Execute(MM_AppInit, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_AppInit, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_AppInit, CFE_Status_t);
}
/*
@@ -43,4 +44,7 @@ CFE_Status_t MM_AppInit(void) {
* Generated stub function for MM_AppMain()
* ----------------------------------------------------
*/
-void MM_AppMain(void) { UT_GenStub_Execute(MM_AppMain, Basic, NULL); }
+void MM_AppMain(void)
+{
+ UT_GenStub_Execute(MM_AppMain, Basic, NULL);
+}
diff --git a/unit-test/stubs/mm_cmds_stubs.c b/unit-test/stubs/mm_cmds_stubs.c
index 0a276ef..b31bce8 100644
--- a/unit-test/stubs/mm_cmds_stubs.c
+++ b/unit-test/stubs/mm_cmds_stubs.c
@@ -30,14 +30,15 @@
* Generated stub function for MM_DumpInEventCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_DumpInEventCmd(const MM_DumpInEventCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_DumpInEventCmd, CFE_Status_t);
+CFE_Status_t MM_DumpInEventCmd(const MM_DumpInEventCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_DumpInEventCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_DumpInEventCmd, const MM_DumpInEventCmd_t *, Msg);
+ UT_GenStub_AddParam(MM_DumpInEventCmd, const MM_DumpInEventCmd_t *, Msg);
- UT_GenStub_Execute(MM_DumpInEventCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_DumpInEventCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_DumpInEventCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_DumpInEventCmd, CFE_Status_t);
}
/*
@@ -45,14 +46,15 @@ CFE_Status_t MM_DumpInEventCmd(const MM_DumpInEventCmd_t *Msg) {
* Generated stub function for MM_DumpMemToFileCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_DumpMemToFileCmd(const MM_DumpMemToFileCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_DumpMemToFileCmd, CFE_Status_t);
+CFE_Status_t MM_DumpMemToFileCmd(const MM_DumpMemToFileCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_DumpMemToFileCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_DumpMemToFileCmd, const MM_DumpMemToFileCmd_t *, Msg);
+ UT_GenStub_AddParam(MM_DumpMemToFileCmd, const MM_DumpMemToFileCmd_t *, Msg);
- UT_GenStub_Execute(MM_DumpMemToFileCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_DumpMemToFileCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_DumpMemToFileCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_DumpMemToFileCmd, CFE_Status_t);
}
/*
@@ -60,15 +62,15 @@ CFE_Status_t MM_DumpMemToFileCmd(const MM_DumpMemToFileCmd_t *Msg) {
* Generated stub function for MM_EepromWriteDisCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_EepromWriteDisCmd(const MM_EepromWriteDisCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_EepromWriteDisCmd, CFE_Status_t);
+CFE_Status_t MM_EepromWriteDisCmd(const MM_EepromWriteDisCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_EepromWriteDisCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_EepromWriteDisCmd, const MM_EepromWriteDisCmd_t *,
- Msg);
+ UT_GenStub_AddParam(MM_EepromWriteDisCmd, const MM_EepromWriteDisCmd_t *, Msg);
- UT_GenStub_Execute(MM_EepromWriteDisCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_EepromWriteDisCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_EepromWriteDisCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_EepromWriteDisCmd, CFE_Status_t);
}
/*
@@ -76,15 +78,15 @@ CFE_Status_t MM_EepromWriteDisCmd(const MM_EepromWriteDisCmd_t *Msg) {
* Generated stub function for MM_EepromWriteEnaCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_EepromWriteEnaCmd(const MM_EepromWriteEnaCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_EepromWriteEnaCmd, CFE_Status_t);
+CFE_Status_t MM_EepromWriteEnaCmd(const MM_EepromWriteEnaCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_EepromWriteEnaCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_EepromWriteEnaCmd, const MM_EepromWriteEnaCmd_t *,
- Msg);
+ UT_GenStub_AddParam(MM_EepromWriteEnaCmd, const MM_EepromWriteEnaCmd_t *, Msg);
- UT_GenStub_Execute(MM_EepromWriteEnaCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_EepromWriteEnaCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_EepromWriteEnaCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_EepromWriteEnaCmd, CFE_Status_t);
}
/*
@@ -92,14 +94,15 @@ CFE_Status_t MM_EepromWriteEnaCmd(const MM_EepromWriteEnaCmd_t *Msg) {
* Generated stub function for MM_FillMemCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_FillMemCmd(const MM_FillMemCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_FillMemCmd, CFE_Status_t);
+CFE_Status_t MM_FillMemCmd(const MM_FillMemCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_FillMemCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_FillMemCmd, const MM_FillMemCmd_t *, Msg);
+ UT_GenStub_AddParam(MM_FillMemCmd, const MM_FillMemCmd_t *, Msg);
- UT_GenStub_Execute(MM_FillMemCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_FillMemCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_FillMemCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_FillMemCmd, CFE_Status_t);
}
/*
@@ -107,15 +110,15 @@ CFE_Status_t MM_FillMemCmd(const MM_FillMemCmd_t *Msg) {
* Generated stub function for MM_LoadMemFromFileCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_LoadMemFromFileCmd(const MM_LoadMemFromFileCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_LoadMemFromFileCmd, CFE_Status_t);
+CFE_Status_t MM_LoadMemFromFileCmd(const MM_LoadMemFromFileCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_LoadMemFromFileCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_LoadMemFromFileCmd, const MM_LoadMemFromFileCmd_t *,
- Msg);
+ UT_GenStub_AddParam(MM_LoadMemFromFileCmd, const MM_LoadMemFromFileCmd_t *, Msg);
- UT_GenStub_Execute(MM_LoadMemFromFileCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_LoadMemFromFileCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_LoadMemFromFileCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_LoadMemFromFileCmd, CFE_Status_t);
}
/*
@@ -123,14 +126,15 @@ CFE_Status_t MM_LoadMemFromFileCmd(const MM_LoadMemFromFileCmd_t *Msg) {
* Generated stub function for MM_LoadMemWIDCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_LoadMemWIDCmd(const MM_LoadMemWIDCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_LoadMemWIDCmd, CFE_Status_t);
+CFE_Status_t MM_LoadMemWIDCmd(const MM_LoadMemWIDCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_LoadMemWIDCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_LoadMemWIDCmd, const MM_LoadMemWIDCmd_t *, Msg);
+ UT_GenStub_AddParam(MM_LoadMemWIDCmd, const MM_LoadMemWIDCmd_t *, Msg);
- UT_GenStub_Execute(MM_LoadMemWIDCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_LoadMemWIDCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_LoadMemWIDCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_LoadMemWIDCmd, CFE_Status_t);
}
/*
@@ -138,14 +142,15 @@ CFE_Status_t MM_LoadMemWIDCmd(const MM_LoadMemWIDCmd_t *Msg) {
* Generated stub function for MM_LookupSymCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_LookupSymCmd(const MM_LookupSymCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_LookupSymCmd, CFE_Status_t);
+CFE_Status_t MM_LookupSymCmd(const MM_LookupSymCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_LookupSymCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_LookupSymCmd, const MM_LookupSymCmd_t *, Msg);
+ UT_GenStub_AddParam(MM_LookupSymCmd, const MM_LookupSymCmd_t *, Msg);
- UT_GenStub_Execute(MM_LookupSymCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_LookupSymCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_LookupSymCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_LookupSymCmd, CFE_Status_t);
}
/*
@@ -153,14 +158,15 @@ CFE_Status_t MM_LookupSymCmd(const MM_LookupSymCmd_t *Msg) {
* Generated stub function for MM_NoopCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_NoopCmd(const MM_NoopCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_NoopCmd, CFE_Status_t);
+CFE_Status_t MM_NoopCmd(const MM_NoopCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_NoopCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_NoopCmd, const MM_NoopCmd_t *, Msg);
+ UT_GenStub_AddParam(MM_NoopCmd, const MM_NoopCmd_t *, Msg);
- UT_GenStub_Execute(MM_NoopCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_NoopCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_NoopCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_NoopCmd, CFE_Status_t);
}
/*
@@ -168,14 +174,15 @@ CFE_Status_t MM_NoopCmd(const MM_NoopCmd_t *Msg) {
* Generated stub function for MM_PeekCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_PeekCmd(const MM_PeekCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_PeekCmd, CFE_Status_t);
+CFE_Status_t MM_PeekCmd(const MM_PeekCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_PeekCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_PeekCmd, const MM_PeekCmd_t *, Msg);
+ UT_GenStub_AddParam(MM_PeekCmd, const MM_PeekCmd_t *, Msg);
- UT_GenStub_Execute(MM_PeekCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_PeekCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_PeekCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_PeekCmd, CFE_Status_t);
}
/*
@@ -183,14 +190,15 @@ CFE_Status_t MM_PeekCmd(const MM_PeekCmd_t *Msg) {
* Generated stub function for MM_PokeCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_PokeCmd(const MM_PokeCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_PokeCmd, CFE_Status_t);
+CFE_Status_t MM_PokeCmd(const MM_PokeCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_PokeCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_PokeCmd, const MM_PokeCmd_t *, Msg);
+ UT_GenStub_AddParam(MM_PokeCmd, const MM_PokeCmd_t *, Msg);
- UT_GenStub_Execute(MM_PokeCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_PokeCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_PokeCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_PokeCmd, CFE_Status_t);
}
/*
@@ -198,14 +206,15 @@ CFE_Status_t MM_PokeCmd(const MM_PokeCmd_t *Msg) {
* Generated stub function for MM_ResetCountersCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_ResetCountersCmd(const MM_ResetCountersCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_ResetCountersCmd, CFE_Status_t);
+CFE_Status_t MM_ResetCountersCmd(const MM_ResetCountersCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_ResetCountersCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_ResetCountersCmd, const MM_ResetCountersCmd_t *, Msg);
+ UT_GenStub_AddParam(MM_ResetCountersCmd, const MM_ResetCountersCmd_t *, Msg);
- UT_GenStub_Execute(MM_ResetCountersCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_ResetCountersCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_ResetCountersCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_ResetCountersCmd, CFE_Status_t);
}
/*
@@ -213,14 +222,15 @@ CFE_Status_t MM_ResetCountersCmd(const MM_ResetCountersCmd_t *Msg) {
* Generated stub function for MM_SendHkCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_SendHkCmd(const MM_SendHkCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_SendHkCmd, CFE_Status_t);
+CFE_Status_t MM_SendHkCmd(const MM_SendHkCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_SendHkCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_SendHkCmd, const MM_SendHkCmd_t *, Msg);
+ UT_GenStub_AddParam(MM_SendHkCmd, const MM_SendHkCmd_t *, Msg);
- UT_GenStub_Execute(MM_SendHkCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_SendHkCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_SendHkCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_SendHkCmd, CFE_Status_t);
}
/*
@@ -228,12 +238,13 @@ CFE_Status_t MM_SendHkCmd(const MM_SendHkCmd_t *Msg) {
* Generated stub function for MM_SymTblToFileCmd()
* ----------------------------------------------------
*/
-CFE_Status_t MM_SymTblToFileCmd(const MM_SymTblToFileCmd_t *Msg) {
- UT_GenStub_SetupReturnBuffer(MM_SymTblToFileCmd, CFE_Status_t);
+CFE_Status_t MM_SymTblToFileCmd(const MM_SymTblToFileCmd_t *Msg)
+{
+ UT_GenStub_SetupReturnBuffer(MM_SymTblToFileCmd, CFE_Status_t);
- UT_GenStub_AddParam(MM_SymTblToFileCmd, const MM_SymTblToFileCmd_t *, Msg);
+ UT_GenStub_AddParam(MM_SymTblToFileCmd, const MM_SymTblToFileCmd_t *, Msg);
- UT_GenStub_Execute(MM_SymTblToFileCmd, Basic, NULL);
+ UT_GenStub_Execute(MM_SymTblToFileCmd, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_SymTblToFileCmd, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_SymTblToFileCmd, CFE_Status_t);
}
diff --git a/unit-test/stubs/mm_dispatch_stubs.c b/unit-test/stubs/mm_dispatch_stubs.c
index 9e4c248..5ac402d 100644
--- a/unit-test/stubs/mm_dispatch_stubs.c
+++ b/unit-test/stubs/mm_dispatch_stubs.c
@@ -31,10 +31,11 @@
* Generated stub function for MM_ProcessGroundCommand()
* ----------------------------------------------------
*/
-void MM_ProcessGroundCommand(const CFE_SB_Buffer_t *BufPtr) {
- UT_GenStub_AddParam(MM_ProcessGroundCommand, const CFE_SB_Buffer_t *, BufPtr);
+void MM_ProcessGroundCommand(const CFE_SB_Buffer_t *BufPtr)
+{
+ UT_GenStub_AddParam(MM_ProcessGroundCommand, const CFE_SB_Buffer_t *, BufPtr);
- UT_GenStub_Execute(MM_ProcessGroundCommand, Basic, NULL);
+ UT_GenStub_Execute(MM_ProcessGroundCommand, Basic, NULL);
}
/*
@@ -42,10 +43,11 @@ void MM_ProcessGroundCommand(const CFE_SB_Buffer_t *BufPtr) {
* Generated stub function for MM_TaskPipe()
* ----------------------------------------------------
*/
-void MM_TaskPipe(const CFE_SB_Buffer_t *BufPtr) {
- UT_GenStub_AddParam(MM_TaskPipe, const CFE_SB_Buffer_t *, BufPtr);
+void MM_TaskPipe(const CFE_SB_Buffer_t *BufPtr)
+{
+ UT_GenStub_AddParam(MM_TaskPipe, const CFE_SB_Buffer_t *, BufPtr);
- UT_GenStub_Execute(MM_TaskPipe, Basic, NULL);
+ UT_GenStub_Execute(MM_TaskPipe, Basic, NULL);
}
/*
@@ -53,14 +55,14 @@ void MM_TaskPipe(const CFE_SB_Buffer_t *BufPtr) {
* Generated stub function for MM_VerifyCmdLength()
* ----------------------------------------------------
*/
-bool MM_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr,
- size_t ExpectedLength) {
- UT_GenStub_SetupReturnBuffer(MM_VerifyCmdLength, bool);
+bool MM_VerifyCmdLength(const CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength)
+{
+ UT_GenStub_SetupReturnBuffer(MM_VerifyCmdLength, bool);
- UT_GenStub_AddParam(MM_VerifyCmdLength, const CFE_MSG_Message_t *, MsgPtr);
- UT_GenStub_AddParam(MM_VerifyCmdLength, size_t, ExpectedLength);
+ UT_GenStub_AddParam(MM_VerifyCmdLength, const CFE_MSG_Message_t *, MsgPtr);
+ UT_GenStub_AddParam(MM_VerifyCmdLength, size_t, ExpectedLength);
- UT_GenStub_Execute(MM_VerifyCmdLength, Basic, NULL);
+ UT_GenStub_Execute(MM_VerifyCmdLength, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_VerifyCmdLength, bool);
+ return UT_GenStub_GetReturnValue(MM_VerifyCmdLength, bool);
}
diff --git a/unit-test/stubs/mm_dump_stubs.c b/unit-test/stubs/mm_dump_stubs.c
index 8b7a47f..ab3b2b0 100644
--- a/unit-test/stubs/mm_dump_stubs.c
+++ b/unit-test/stubs/mm_dump_stubs.c
@@ -30,18 +30,17 @@
* Generated stub function for MM_DumpMemToFile()
* ----------------------------------------------------
*/
-int32 MM_DumpMemToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader) {
- UT_GenStub_SetupReturnBuffer(MM_DumpMemToFile, int32);
+int32 MM_DumpMemToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader)
+{
+ UT_GenStub_SetupReturnBuffer(MM_DumpMemToFile, int32);
- UT_GenStub_AddParam(MM_DumpMemToFile, osal_id_t, FileHandle);
- UT_GenStub_AddParam(MM_DumpMemToFile, const char *, FileName);
- UT_GenStub_AddParam(MM_DumpMemToFile, const MM_LoadDumpFileHeader_t *,
- FileHeader);
+ UT_GenStub_AddParam(MM_DumpMemToFile, osal_id_t, FileHandle);
+ UT_GenStub_AddParam(MM_DumpMemToFile, const char *, FileName);
+ UT_GenStub_AddParam(MM_DumpMemToFile, const MM_LoadDumpFileHeader_t *, FileHeader);
- UT_GenStub_Execute(MM_DumpMemToFile, Basic, NULL);
+ UT_GenStub_Execute(MM_DumpMemToFile, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_DumpMemToFile, int32);
+ return UT_GenStub_GetReturnValue(MM_DumpMemToFile, int32);
}
/*
@@ -49,19 +48,17 @@ int32 MM_DumpMemToFile(osal_id_t FileHandle, const char *FileName,
* Generated stub function for MM_FillDumpInEventBuffer()
* ----------------------------------------------------
*/
-int32 MM_FillDumpInEventBuffer(cpuaddr SrcAddress,
- const MM_DumpInEventCmd_t *CmdPtr,
- void *DumpBuffer) {
- UT_GenStub_SetupReturnBuffer(MM_FillDumpInEventBuffer, int32);
+int32 MM_FillDumpInEventBuffer(cpuaddr SrcAddress, const MM_DumpInEventCmd_t *CmdPtr, void *DumpBuffer)
+{
+ UT_GenStub_SetupReturnBuffer(MM_FillDumpInEventBuffer, int32);
- UT_GenStub_AddParam(MM_FillDumpInEventBuffer, cpuaddr, SrcAddress);
- UT_GenStub_AddParam(MM_FillDumpInEventBuffer, const MM_DumpInEventCmd_t *,
- CmdPtr);
- UT_GenStub_AddParam(MM_FillDumpInEventBuffer, void *, DumpBuffer);
+ UT_GenStub_AddParam(MM_FillDumpInEventBuffer, cpuaddr, SrcAddress);
+ UT_GenStub_AddParam(MM_FillDumpInEventBuffer, const MM_DumpInEventCmd_t *, CmdPtr);
+ UT_GenStub_AddParam(MM_FillDumpInEventBuffer, void *, DumpBuffer);
- UT_GenStub_Execute(MM_FillDumpInEventBuffer, Basic, NULL);
+ UT_GenStub_Execute(MM_FillDumpInEventBuffer, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_FillDumpInEventBuffer, int32);
+ return UT_GenStub_GetReturnValue(MM_FillDumpInEventBuffer, int32);
}
/*
@@ -69,15 +66,16 @@ int32 MM_FillDumpInEventBuffer(cpuaddr SrcAddress,
* Generated stub function for MM_PeekMem()
* ----------------------------------------------------
*/
-int32 MM_PeekMem(const MM_PeekCmd_t *CmdPtr, cpuaddr SrcAddress) {
- UT_GenStub_SetupReturnBuffer(MM_PeekMem, int32);
+int32 MM_PeekMem(const MM_PeekCmd_t *CmdPtr, cpuaddr SrcAddress)
+{
+ UT_GenStub_SetupReturnBuffer(MM_PeekMem, int32);
- UT_GenStub_AddParam(MM_PeekMem, const MM_PeekCmd_t *, CmdPtr);
- UT_GenStub_AddParam(MM_PeekMem, cpuaddr, SrcAddress);
+ UT_GenStub_AddParam(MM_PeekMem, const MM_PeekCmd_t *, CmdPtr);
+ UT_GenStub_AddParam(MM_PeekMem, cpuaddr, SrcAddress);
- UT_GenStub_Execute(MM_PeekMem, Basic, NULL);
+ UT_GenStub_Execute(MM_PeekMem, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_PeekMem, int32);
+ return UT_GenStub_GetReturnValue(MM_PeekMem, int32);
}
/*
@@ -85,18 +83,19 @@ int32 MM_PeekMem(const MM_PeekCmd_t *CmdPtr, cpuaddr SrcAddress) {
* Generated stub function for MM_WriteFileHeaders()
* ----------------------------------------------------
*/
-int32 MM_WriteFileHeaders(const char *FileName, osal_id_t FileHandle,
- CFE_FS_Header_t *CFEHeader,
- const MM_LoadDumpFileHeader_t *MMHeader) {
- UT_GenStub_SetupReturnBuffer(MM_WriteFileHeaders, int32);
+int32 MM_WriteFileHeaders(const char *FileName,
+ osal_id_t FileHandle,
+ CFE_FS_Header_t *CFEHeader,
+ const MM_LoadDumpFileHeader_t *MMHeader)
+{
+ UT_GenStub_SetupReturnBuffer(MM_WriteFileHeaders, int32);
- UT_GenStub_AddParam(MM_WriteFileHeaders, const char *, FileName);
- UT_GenStub_AddParam(MM_WriteFileHeaders, osal_id_t, FileHandle);
- UT_GenStub_AddParam(MM_WriteFileHeaders, CFE_FS_Header_t *, CFEHeader);
- UT_GenStub_AddParam(MM_WriteFileHeaders, const MM_LoadDumpFileHeader_t *,
- MMHeader);
+ UT_GenStub_AddParam(MM_WriteFileHeaders, const char *, FileName);
+ UT_GenStub_AddParam(MM_WriteFileHeaders, osal_id_t, FileHandle);
+ UT_GenStub_AddParam(MM_WriteFileHeaders, CFE_FS_Header_t *, CFEHeader);
+ UT_GenStub_AddParam(MM_WriteFileHeaders, const MM_LoadDumpFileHeader_t *, MMHeader);
- UT_GenStub_Execute(MM_WriteFileHeaders, Basic, NULL);
+ UT_GenStub_Execute(MM_WriteFileHeaders, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_WriteFileHeaders, int32);
+ return UT_GenStub_GetReturnValue(MM_WriteFileHeaders, int32);
}
diff --git a/unit-test/stubs/mm_load_stubs.c b/unit-test/stubs/mm_load_stubs.c
index cb8ace3..c1947aa 100644
--- a/unit-test/stubs/mm_load_stubs.c
+++ b/unit-test/stubs/mm_load_stubs.c
@@ -30,11 +30,12 @@
* Generated stub function for MM_FillMem()
* ----------------------------------------------------
*/
-void MM_FillMem(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
- UT_GenStub_AddParam(MM_FillMem, cpuaddr, DestAddress);
- UT_GenStub_AddParam(MM_FillMem, const MM_FillMemCmd_t *, CmdPtr);
+void MM_FillMem(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr)
+{
+ UT_GenStub_AddParam(MM_FillMem, cpuaddr, DestAddress);
+ UT_GenStub_AddParam(MM_FillMem, const MM_FillMemCmd_t *, CmdPtr);
- UT_GenStub_Execute(MM_FillMem, Basic, NULL);
+ UT_GenStub_Execute(MM_FillMem, Basic, NULL);
}
/*
@@ -42,20 +43,21 @@ void MM_FillMem(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
* Generated stub function for MM_LoadMemFromFile()
* ----------------------------------------------------
*/
-int32 MM_LoadMemFromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMemFromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress) {
- UT_GenStub_SetupReturnBuffer(MM_LoadMemFromFile, int32);
+ cpuaddr DestAddress)
+{
+ UT_GenStub_SetupReturnBuffer(MM_LoadMemFromFile, int32);
- UT_GenStub_AddParam(MM_LoadMemFromFile, osal_id_t, FileHandle);
- UT_GenStub_AddParam(MM_LoadMemFromFile, const char *, FileName);
- UT_GenStub_AddParam(MM_LoadMemFromFile, const MM_LoadDumpFileHeader_t *,
- FileHeader);
- UT_GenStub_AddParam(MM_LoadMemFromFile, cpuaddr, DestAddress);
+ UT_GenStub_AddParam(MM_LoadMemFromFile, osal_id_t, FileHandle);
+ UT_GenStub_AddParam(MM_LoadMemFromFile, const char *, FileName);
+ UT_GenStub_AddParam(MM_LoadMemFromFile, const MM_LoadDumpFileHeader_t *, FileHeader);
+ UT_GenStub_AddParam(MM_LoadMemFromFile, cpuaddr, DestAddress);
- UT_GenStub_Execute(MM_LoadMemFromFile, Basic, NULL);
+ UT_GenStub_Execute(MM_LoadMemFromFile, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_LoadMemFromFile, int32);
+ return UT_GenStub_GetReturnValue(MM_LoadMemFromFile, int32);
}
/*
@@ -63,15 +65,16 @@ int32 MM_LoadMemFromFile(osal_id_t FileHandle, const char *FileName,
* Generated stub function for MM_LoadMemWID()
* ----------------------------------------------------
*/
-bool MM_LoadMemWID(const MM_LoadMemWIDCmd_t *CmdPtr, cpuaddr DestAddress) {
- UT_GenStub_SetupReturnBuffer(MM_LoadMemWID, bool);
+bool MM_LoadMemWID(const MM_LoadMemWIDCmd_t *CmdPtr, cpuaddr DestAddress)
+{
+ UT_GenStub_SetupReturnBuffer(MM_LoadMemWID, bool);
- UT_GenStub_AddParam(MM_LoadMemWID, const MM_LoadMemWIDCmd_t *, CmdPtr);
- UT_GenStub_AddParam(MM_LoadMemWID, cpuaddr, DestAddress);
+ UT_GenStub_AddParam(MM_LoadMemWID, const MM_LoadMemWIDCmd_t *, CmdPtr);
+ UT_GenStub_AddParam(MM_LoadMemWID, cpuaddr, DestAddress);
- UT_GenStub_Execute(MM_LoadMemWID, Basic, NULL);
+ UT_GenStub_Execute(MM_LoadMemWID, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_LoadMemWID, bool);
+ return UT_GenStub_GetReturnValue(MM_LoadMemWID, bool);
}
/*
@@ -79,15 +82,16 @@ bool MM_LoadMemWID(const MM_LoadMemWIDCmd_t *CmdPtr, cpuaddr DestAddress) {
* Generated stub function for MM_PokeEeprom()
* ----------------------------------------------------
*/
-CFE_Status_t MM_PokeEeprom(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress) {
- UT_GenStub_SetupReturnBuffer(MM_PokeEeprom, CFE_Status_t);
+CFE_Status_t MM_PokeEeprom(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress)
+{
+ UT_GenStub_SetupReturnBuffer(MM_PokeEeprom, CFE_Status_t);
- UT_GenStub_AddParam(MM_PokeEeprom, const MM_PokeCmd_t *, CmdPtr);
- UT_GenStub_AddParam(MM_PokeEeprom, cpuaddr, DestAddress);
+ UT_GenStub_AddParam(MM_PokeEeprom, const MM_PokeCmd_t *, CmdPtr);
+ UT_GenStub_AddParam(MM_PokeEeprom, cpuaddr, DestAddress);
- UT_GenStub_Execute(MM_PokeEeprom, Basic, NULL);
+ UT_GenStub_Execute(MM_PokeEeprom, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_PokeEeprom, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_PokeEeprom, CFE_Status_t);
}
/*
@@ -95,15 +99,16 @@ CFE_Status_t MM_PokeEeprom(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress) {
* Generated stub function for MM_PokeMem()
* ----------------------------------------------------
*/
-CFE_Status_t MM_PokeMem(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress) {
- UT_GenStub_SetupReturnBuffer(MM_PokeMem, CFE_Status_t);
+CFE_Status_t MM_PokeMem(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress)
+{
+ UT_GenStub_SetupReturnBuffer(MM_PokeMem, CFE_Status_t);
- UT_GenStub_AddParam(MM_PokeMem, const MM_PokeCmd_t *, CmdPtr);
- UT_GenStub_AddParam(MM_PokeMem, cpuaddr, DestAddress);
+ UT_GenStub_AddParam(MM_PokeMem, const MM_PokeCmd_t *, CmdPtr);
+ UT_GenStub_AddParam(MM_PokeMem, cpuaddr, DestAddress);
- UT_GenStub_Execute(MM_PokeMem, Basic, NULL);
+ UT_GenStub_Execute(MM_PokeMem, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_PokeMem, CFE_Status_t);
+ return UT_GenStub_GetReturnValue(MM_PokeMem, CFE_Status_t);
}
/*
@@ -111,19 +116,21 @@ CFE_Status_t MM_PokeMem(const MM_PokeCmd_t *CmdPtr, cpuaddr DestAddress) {
* Generated stub function for MM_ReadFileHeaders()
* ----------------------------------------------------
*/
-int32 MM_ReadFileHeaders(const char *FileName, osal_id_t FileHandle,
- CFE_FS_Header_t *CFEHeader,
- MM_LoadDumpFileHeader_t *MMHeader) {
- UT_GenStub_SetupReturnBuffer(MM_ReadFileHeaders, int32);
+int32 MM_ReadFileHeaders(const char *FileName,
+ osal_id_t FileHandle,
+ CFE_FS_Header_t *CFEHeader,
+ MM_LoadDumpFileHeader_t *MMHeader)
+{
+ UT_GenStub_SetupReturnBuffer(MM_ReadFileHeaders, int32);
- UT_GenStub_AddParam(MM_ReadFileHeaders, const char *, FileName);
- UT_GenStub_AddParam(MM_ReadFileHeaders, osal_id_t, FileHandle);
- UT_GenStub_AddParam(MM_ReadFileHeaders, CFE_FS_Header_t *, CFEHeader);
- UT_GenStub_AddParam(MM_ReadFileHeaders, MM_LoadDumpFileHeader_t *, MMHeader);
+ UT_GenStub_AddParam(MM_ReadFileHeaders, const char *, FileName);
+ UT_GenStub_AddParam(MM_ReadFileHeaders, osal_id_t, FileHandle);
+ UT_GenStub_AddParam(MM_ReadFileHeaders, CFE_FS_Header_t *, CFEHeader);
+ UT_GenStub_AddParam(MM_ReadFileHeaders, MM_LoadDumpFileHeader_t *, MMHeader);
- UT_GenStub_Execute(MM_ReadFileHeaders, Basic, NULL);
+ UT_GenStub_Execute(MM_ReadFileHeaders, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_ReadFileHeaders, int32);
+ return UT_GenStub_GetReturnValue(MM_ReadFileHeaders, int32);
}
/*
@@ -131,15 +138,14 @@ int32 MM_ReadFileHeaders(const char *FileName, osal_id_t FileHandle,
* Generated stub function for MM_VerifyLoadFileSize()
* ----------------------------------------------------
*/
-int32 MM_VerifyLoadFileSize(const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader) {
- UT_GenStub_SetupReturnBuffer(MM_VerifyLoadFileSize, int32);
+int32 MM_VerifyLoadFileSize(const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader)
+{
+ UT_GenStub_SetupReturnBuffer(MM_VerifyLoadFileSize, int32);
- UT_GenStub_AddParam(MM_VerifyLoadFileSize, const char *, FileName);
- UT_GenStub_AddParam(MM_VerifyLoadFileSize, const MM_LoadDumpFileHeader_t *,
- FileHeader);
+ UT_GenStub_AddParam(MM_VerifyLoadFileSize, const char *, FileName);
+ UT_GenStub_AddParam(MM_VerifyLoadFileSize, const MM_LoadDumpFileHeader_t *, FileHeader);
- UT_GenStub_Execute(MM_VerifyLoadFileSize, Basic, NULL);
+ UT_GenStub_Execute(MM_VerifyLoadFileSize, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_VerifyLoadFileSize, int32);
+ return UT_GenStub_GetReturnValue(MM_VerifyLoadFileSize, int32);
}
diff --git a/unit-test/stubs/mm_mem16_stubs.c b/unit-test/stubs/mm_mem16_stubs.c
index 420befe..4527f96 100644
--- a/unit-test/stubs/mm_mem16_stubs.c
+++ b/unit-test/stubs/mm_mem16_stubs.c
@@ -30,18 +30,17 @@
* Generated stub function for MM_DumpMem16ToFile()
* ----------------------------------------------------
*/
-int32 MM_DumpMem16ToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader) {
- UT_GenStub_SetupReturnBuffer(MM_DumpMem16ToFile, int32);
+int32 MM_DumpMem16ToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader)
+{
+ UT_GenStub_SetupReturnBuffer(MM_DumpMem16ToFile, int32);
- UT_GenStub_AddParam(MM_DumpMem16ToFile, osal_id_t, FileHandle);
- UT_GenStub_AddParam(MM_DumpMem16ToFile, const char *, FileName);
- UT_GenStub_AddParam(MM_DumpMem16ToFile, const MM_LoadDumpFileHeader_t *,
- FileHeader);
+ UT_GenStub_AddParam(MM_DumpMem16ToFile, osal_id_t, FileHandle);
+ UT_GenStub_AddParam(MM_DumpMem16ToFile, const char *, FileName);
+ UT_GenStub_AddParam(MM_DumpMem16ToFile, const MM_LoadDumpFileHeader_t *, FileHeader);
- UT_GenStub_Execute(MM_DumpMem16ToFile, Basic, NULL);
+ UT_GenStub_Execute(MM_DumpMem16ToFile, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_DumpMem16ToFile, int32);
+ return UT_GenStub_GetReturnValue(MM_DumpMem16ToFile, int32);
}
/*
@@ -49,15 +48,16 @@ int32 MM_DumpMem16ToFile(osal_id_t FileHandle, const char *FileName,
* Generated stub function for MM_FillMem16()
* ----------------------------------------------------
*/
-int32 MM_FillMem16(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
- UT_GenStub_SetupReturnBuffer(MM_FillMem16, int32);
+int32 MM_FillMem16(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr)
+{
+ UT_GenStub_SetupReturnBuffer(MM_FillMem16, int32);
- UT_GenStub_AddParam(MM_FillMem16, cpuaddr, DestAddress);
- UT_GenStub_AddParam(MM_FillMem16, const MM_FillMemCmd_t *, CmdPtr);
+ UT_GenStub_AddParam(MM_FillMem16, cpuaddr, DestAddress);
+ UT_GenStub_AddParam(MM_FillMem16, const MM_FillMemCmd_t *, CmdPtr);
- UT_GenStub_Execute(MM_FillMem16, Basic, NULL);
+ UT_GenStub_Execute(MM_FillMem16, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_FillMem16, int32);
+ return UT_GenStub_GetReturnValue(MM_FillMem16, int32);
}
/*
@@ -65,18 +65,19 @@ int32 MM_FillMem16(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
* Generated stub function for MM_LoadMem16FromFile()
* ----------------------------------------------------
*/
-int32 MM_LoadMem16FromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMem16FromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress) {
- UT_GenStub_SetupReturnBuffer(MM_LoadMem16FromFile, int32);
+ cpuaddr DestAddress)
+{
+ UT_GenStub_SetupReturnBuffer(MM_LoadMem16FromFile, int32);
- UT_GenStub_AddParam(MM_LoadMem16FromFile, osal_id_t, FileHandle);
- UT_GenStub_AddParam(MM_LoadMem16FromFile, const char *, FileName);
- UT_GenStub_AddParam(MM_LoadMem16FromFile, const MM_LoadDumpFileHeader_t *,
- FileHeader);
- UT_GenStub_AddParam(MM_LoadMem16FromFile, cpuaddr, DestAddress);
+ UT_GenStub_AddParam(MM_LoadMem16FromFile, osal_id_t, FileHandle);
+ UT_GenStub_AddParam(MM_LoadMem16FromFile, const char *, FileName);
+ UT_GenStub_AddParam(MM_LoadMem16FromFile, const MM_LoadDumpFileHeader_t *, FileHeader);
+ UT_GenStub_AddParam(MM_LoadMem16FromFile, cpuaddr, DestAddress);
- UT_GenStub_Execute(MM_LoadMem16FromFile, Basic, NULL);
+ UT_GenStub_Execute(MM_LoadMem16FromFile, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_LoadMem16FromFile, int32);
+ return UT_GenStub_GetReturnValue(MM_LoadMem16FromFile, int32);
}
diff --git a/unit-test/stubs/mm_mem32_stubs.c b/unit-test/stubs/mm_mem32_stubs.c
index fc1ec8d..bbe589f 100644
--- a/unit-test/stubs/mm_mem32_stubs.c
+++ b/unit-test/stubs/mm_mem32_stubs.c
@@ -30,18 +30,17 @@
* Generated stub function for MM_DumpMem32ToFile()
* ----------------------------------------------------
*/
-int32 MM_DumpMem32ToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader) {
- UT_GenStub_SetupReturnBuffer(MM_DumpMem32ToFile, int32);
+int32 MM_DumpMem32ToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader)
+{
+ UT_GenStub_SetupReturnBuffer(MM_DumpMem32ToFile, int32);
- UT_GenStub_AddParam(MM_DumpMem32ToFile, osal_id_t, FileHandle);
- UT_GenStub_AddParam(MM_DumpMem32ToFile, const char *, FileName);
- UT_GenStub_AddParam(MM_DumpMem32ToFile, const MM_LoadDumpFileHeader_t *,
- FileHeader);
+ UT_GenStub_AddParam(MM_DumpMem32ToFile, osal_id_t, FileHandle);
+ UT_GenStub_AddParam(MM_DumpMem32ToFile, const char *, FileName);
+ UT_GenStub_AddParam(MM_DumpMem32ToFile, const MM_LoadDumpFileHeader_t *, FileHeader);
- UT_GenStub_Execute(MM_DumpMem32ToFile, Basic, NULL);
+ UT_GenStub_Execute(MM_DumpMem32ToFile, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_DumpMem32ToFile, int32);
+ return UT_GenStub_GetReturnValue(MM_DumpMem32ToFile, int32);
}
/*
@@ -49,15 +48,16 @@ int32 MM_DumpMem32ToFile(osal_id_t FileHandle, const char *FileName,
* Generated stub function for MM_FillMem32()
* ----------------------------------------------------
*/
-int32 MM_FillMem32(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
- UT_GenStub_SetupReturnBuffer(MM_FillMem32, int32);
+int32 MM_FillMem32(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr)
+{
+ UT_GenStub_SetupReturnBuffer(MM_FillMem32, int32);
- UT_GenStub_AddParam(MM_FillMem32, cpuaddr, DestAddress);
- UT_GenStub_AddParam(MM_FillMem32, const MM_FillMemCmd_t *, CmdPtr);
+ UT_GenStub_AddParam(MM_FillMem32, cpuaddr, DestAddress);
+ UT_GenStub_AddParam(MM_FillMem32, const MM_FillMemCmd_t *, CmdPtr);
- UT_GenStub_Execute(MM_FillMem32, Basic, NULL);
+ UT_GenStub_Execute(MM_FillMem32, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_FillMem32, int32);
+ return UT_GenStub_GetReturnValue(MM_FillMem32, int32);
}
/*
@@ -65,18 +65,19 @@ int32 MM_FillMem32(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
* Generated stub function for MM_LoadMem32FromFile()
* ----------------------------------------------------
*/
-int32 MM_LoadMem32FromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMem32FromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress) {
- UT_GenStub_SetupReturnBuffer(MM_LoadMem32FromFile, int32);
+ cpuaddr DestAddress)
+{
+ UT_GenStub_SetupReturnBuffer(MM_LoadMem32FromFile, int32);
- UT_GenStub_AddParam(MM_LoadMem32FromFile, osal_id_t, FileHandle);
- UT_GenStub_AddParam(MM_LoadMem32FromFile, const char *, FileName);
- UT_GenStub_AddParam(MM_LoadMem32FromFile, const MM_LoadDumpFileHeader_t *,
- FileHeader);
- UT_GenStub_AddParam(MM_LoadMem32FromFile, cpuaddr, DestAddress);
+ UT_GenStub_AddParam(MM_LoadMem32FromFile, osal_id_t, FileHandle);
+ UT_GenStub_AddParam(MM_LoadMem32FromFile, const char *, FileName);
+ UT_GenStub_AddParam(MM_LoadMem32FromFile, const MM_LoadDumpFileHeader_t *, FileHeader);
+ UT_GenStub_AddParam(MM_LoadMem32FromFile, cpuaddr, DestAddress);
- UT_GenStub_Execute(MM_LoadMem32FromFile, Basic, NULL);
+ UT_GenStub_Execute(MM_LoadMem32FromFile, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_LoadMem32FromFile, int32);
+ return UT_GenStub_GetReturnValue(MM_LoadMem32FromFile, int32);
}
diff --git a/unit-test/stubs/mm_mem8_stubs.c b/unit-test/stubs/mm_mem8_stubs.c
index b7385ad..c587955 100644
--- a/unit-test/stubs/mm_mem8_stubs.c
+++ b/unit-test/stubs/mm_mem8_stubs.c
@@ -30,18 +30,17 @@
* Generated stub function for MM_DumpMem8ToFile()
* ----------------------------------------------------
*/
-int32 MM_DumpMem8ToFile(osal_id_t FileHandle, const char *FileName,
- const MM_LoadDumpFileHeader_t *FileHeader) {
- UT_GenStub_SetupReturnBuffer(MM_DumpMem8ToFile, int32);
+int32 MM_DumpMem8ToFile(osal_id_t FileHandle, const char *FileName, const MM_LoadDumpFileHeader_t *FileHeader)
+{
+ UT_GenStub_SetupReturnBuffer(MM_DumpMem8ToFile, int32);
- UT_GenStub_AddParam(MM_DumpMem8ToFile, osal_id_t, FileHandle);
- UT_GenStub_AddParam(MM_DumpMem8ToFile, const char *, FileName);
- UT_GenStub_AddParam(MM_DumpMem8ToFile, const MM_LoadDumpFileHeader_t *,
- FileHeader);
+ UT_GenStub_AddParam(MM_DumpMem8ToFile, osal_id_t, FileHandle);
+ UT_GenStub_AddParam(MM_DumpMem8ToFile, const char *, FileName);
+ UT_GenStub_AddParam(MM_DumpMem8ToFile, const MM_LoadDumpFileHeader_t *, FileHeader);
- UT_GenStub_Execute(MM_DumpMem8ToFile, Basic, NULL);
+ UT_GenStub_Execute(MM_DumpMem8ToFile, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_DumpMem8ToFile, int32);
+ return UT_GenStub_GetReturnValue(MM_DumpMem8ToFile, int32);
}
/*
@@ -49,15 +48,16 @@ int32 MM_DumpMem8ToFile(osal_id_t FileHandle, const char *FileName,
* Generated stub function for MM_FillMem8()
* ----------------------------------------------------
*/
-int32 MM_FillMem8(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
- UT_GenStub_SetupReturnBuffer(MM_FillMem8, int32);
+int32 MM_FillMem8(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr)
+{
+ UT_GenStub_SetupReturnBuffer(MM_FillMem8, int32);
- UT_GenStub_AddParam(MM_FillMem8, cpuaddr, DestAddress);
- UT_GenStub_AddParam(MM_FillMem8, const MM_FillMemCmd_t *, CmdPtr);
+ UT_GenStub_AddParam(MM_FillMem8, cpuaddr, DestAddress);
+ UT_GenStub_AddParam(MM_FillMem8, const MM_FillMemCmd_t *, CmdPtr);
- UT_GenStub_Execute(MM_FillMem8, Basic, NULL);
+ UT_GenStub_Execute(MM_FillMem8, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_FillMem8, int32);
+ return UT_GenStub_GetReturnValue(MM_FillMem8, int32);
}
/*
@@ -65,18 +65,19 @@ int32 MM_FillMem8(cpuaddr DestAddress, const MM_FillMemCmd_t *CmdPtr) {
* Generated stub function for MM_LoadMem8FromFile()
* ----------------------------------------------------
*/
-int32 MM_LoadMem8FromFile(osal_id_t FileHandle, const char *FileName,
+int32 MM_LoadMem8FromFile(osal_id_t FileHandle,
+ const char *FileName,
const MM_LoadDumpFileHeader_t *FileHeader,
- cpuaddr DestAddress) {
- UT_GenStub_SetupReturnBuffer(MM_LoadMem8FromFile, int32);
+ cpuaddr DestAddress)
+{
+ UT_GenStub_SetupReturnBuffer(MM_LoadMem8FromFile, int32);
- UT_GenStub_AddParam(MM_LoadMem8FromFile, osal_id_t, FileHandle);
- UT_GenStub_AddParam(MM_LoadMem8FromFile, const char *, FileName);
- UT_GenStub_AddParam(MM_LoadMem8FromFile, const MM_LoadDumpFileHeader_t *,
- FileHeader);
- UT_GenStub_AddParam(MM_LoadMem8FromFile, cpuaddr, DestAddress);
+ UT_GenStub_AddParam(MM_LoadMem8FromFile, osal_id_t, FileHandle);
+ UT_GenStub_AddParam(MM_LoadMem8FromFile, const char *, FileName);
+ UT_GenStub_AddParam(MM_LoadMem8FromFile, const MM_LoadDumpFileHeader_t *, FileHeader);
+ UT_GenStub_AddParam(MM_LoadMem8FromFile, cpuaddr, DestAddress);
- UT_GenStub_Execute(MM_LoadMem8FromFile, Basic, NULL);
+ UT_GenStub_Execute(MM_LoadMem8FromFile, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_LoadMem8FromFile, int32);
+ return UT_GenStub_GetReturnValue(MM_LoadMem8FromFile, int32);
}
diff --git a/unit-test/stubs/mm_utils_stubs.c b/unit-test/stubs/mm_utils_stubs.c
index 6fd1486..29c769c 100644
--- a/unit-test/stubs/mm_utils_stubs.c
+++ b/unit-test/stubs/mm_utils_stubs.c
@@ -30,17 +30,17 @@
* Generated stub function for MM_ComputeCRCFromFile()
* ----------------------------------------------------
*/
-int32 MM_ComputeCRCFromFile(osal_id_t FileHandle, uint32 *CrcPtr,
- uint32 TypeCRC) {
- UT_GenStub_SetupReturnBuffer(MM_ComputeCRCFromFile, int32);
+int32 MM_ComputeCRCFromFile(osal_id_t FileHandle, uint32 *CrcPtr, uint32 TypeCRC)
+{
+ UT_GenStub_SetupReturnBuffer(MM_ComputeCRCFromFile, int32);
- UT_GenStub_AddParam(MM_ComputeCRCFromFile, osal_id_t, FileHandle);
- UT_GenStub_AddParam(MM_ComputeCRCFromFile, uint32 *, CrcPtr);
- UT_GenStub_AddParam(MM_ComputeCRCFromFile, uint32, TypeCRC);
+ UT_GenStub_AddParam(MM_ComputeCRCFromFile, osal_id_t, FileHandle);
+ UT_GenStub_AddParam(MM_ComputeCRCFromFile, uint32 *, CrcPtr);
+ UT_GenStub_AddParam(MM_ComputeCRCFromFile, uint32, TypeCRC);
- UT_GenStub_Execute(MM_ComputeCRCFromFile, Basic, NULL);
+ UT_GenStub_Execute(MM_ComputeCRCFromFile, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_ComputeCRCFromFile, int32);
+ return UT_GenStub_GetReturnValue(MM_ComputeCRCFromFile, int32);
}
/*
@@ -48,22 +48,26 @@ int32 MM_ComputeCRCFromFile(osal_id_t FileHandle, uint32 *CrcPtr,
* Generated stub function for MM_ResetHk()
* ----------------------------------------------------
*/
-void MM_ResetHk(void) { UT_GenStub_Execute(MM_ResetHk, Basic, NULL); }
+void MM_ResetHk(void)
+{
+ UT_GenStub_Execute(MM_ResetHk, Basic, NULL);
+}
/*
* ----------------------------------------------------
* Generated stub function for MM_ResolveSymAddr()
* ----------------------------------------------------
*/
-int32 MM_ResolveSymAddr(MM_SymAddr_t *SymAddr, cpuaddr *ResolvedAddr) {
- UT_GenStub_SetupReturnBuffer(MM_ResolveSymAddr, int32);
+int32 MM_ResolveSymAddr(MM_SymAddr_t *SymAddr, cpuaddr *ResolvedAddr)
+{
+ UT_GenStub_SetupReturnBuffer(MM_ResolveSymAddr, int32);
- UT_GenStub_AddParam(MM_ResolveSymAddr, MM_SymAddr_t *, SymAddr);
- UT_GenStub_AddParam(MM_ResolveSymAddr, cpuaddr *, ResolvedAddr);
+ UT_GenStub_AddParam(MM_ResolveSymAddr, MM_SymAddr_t *, SymAddr);
+ UT_GenStub_AddParam(MM_ResolveSymAddr, cpuaddr *, ResolvedAddr);
- UT_GenStub_Execute(MM_ResolveSymAddr, Basic, NULL);
+ UT_GenStub_Execute(MM_ResolveSymAddr, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_ResolveSymAddr, int32);
+ return UT_GenStub_GetReturnValue(MM_ResolveSymAddr, int32);
}
/*
@@ -71,22 +75,26 @@ int32 MM_ResolveSymAddr(MM_SymAddr_t *SymAddr, cpuaddr *ResolvedAddr) {
* Generated stub function for MM_SegmentBreak()
* ----------------------------------------------------
*/
-void MM_SegmentBreak(void) { UT_GenStub_Execute(MM_SegmentBreak, Basic, NULL); }
+void MM_SegmentBreak(void)
+{
+ UT_GenStub_Execute(MM_SegmentBreak, Basic, NULL);
+}
/*
* ----------------------------------------------------
* Generated stub function for MM_Verify16Aligned()
* ----------------------------------------------------
*/
-bool MM_Verify16Aligned(cpuaddr Address, size_t Size) {
- UT_GenStub_SetupReturnBuffer(MM_Verify16Aligned, bool);
+bool MM_Verify16Aligned(cpuaddr Address, size_t Size)
+{
+ UT_GenStub_SetupReturnBuffer(MM_Verify16Aligned, bool);
- UT_GenStub_AddParam(MM_Verify16Aligned, cpuaddr, Address);
- UT_GenStub_AddParam(MM_Verify16Aligned, size_t, Size);
+ UT_GenStub_AddParam(MM_Verify16Aligned, cpuaddr, Address);
+ UT_GenStub_AddParam(MM_Verify16Aligned, size_t, Size);
- UT_GenStub_Execute(MM_Verify16Aligned, Basic, NULL);
+ UT_GenStub_Execute(MM_Verify16Aligned, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_Verify16Aligned, bool);
+ return UT_GenStub_GetReturnValue(MM_Verify16Aligned, bool);
}
/*
@@ -94,15 +102,16 @@ bool MM_Verify16Aligned(cpuaddr Address, size_t Size) {
* Generated stub function for MM_Verify32Aligned()
* ----------------------------------------------------
*/
-bool MM_Verify32Aligned(cpuaddr Address, size_t Size) {
- UT_GenStub_SetupReturnBuffer(MM_Verify32Aligned, bool);
+bool MM_Verify32Aligned(cpuaddr Address, size_t Size)
+{
+ UT_GenStub_SetupReturnBuffer(MM_Verify32Aligned, bool);
- UT_GenStub_AddParam(MM_Verify32Aligned, cpuaddr, Address);
- UT_GenStub_AddParam(MM_Verify32Aligned, size_t, Size);
+ UT_GenStub_AddParam(MM_Verify32Aligned, cpuaddr, Address);
+ UT_GenStub_AddParam(MM_Verify32Aligned, size_t, Size);
- UT_GenStub_Execute(MM_Verify32Aligned, Basic, NULL);
+ UT_GenStub_Execute(MM_Verify32Aligned, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_Verify32Aligned, bool);
+ return UT_GenStub_GetReturnValue(MM_Verify32Aligned, bool);
}
/*
@@ -110,18 +119,18 @@ bool MM_Verify32Aligned(cpuaddr Address, size_t Size) {
* Generated stub function for MM_VerifyLoadDumpParams()
* ----------------------------------------------------
*/
-int32 MM_VerifyLoadDumpParams(cpuaddr Address, MM_MemType_Enum_t MemType,
- size_t SizeInBytes, uint8 VerifyType) {
- UT_GenStub_SetupReturnBuffer(MM_VerifyLoadDumpParams, int32);
+int32 MM_VerifyLoadDumpParams(cpuaddr Address, MM_MemType_Enum_t MemType, size_t SizeInBytes, uint8 VerifyType)
+{
+ UT_GenStub_SetupReturnBuffer(MM_VerifyLoadDumpParams, int32);
- UT_GenStub_AddParam(MM_VerifyLoadDumpParams, cpuaddr, Address);
- UT_GenStub_AddParam(MM_VerifyLoadDumpParams, MM_MemType_Enum_t, MemType);
- UT_GenStub_AddParam(MM_VerifyLoadDumpParams, size_t, SizeInBytes);
- UT_GenStub_AddParam(MM_VerifyLoadDumpParams, uint8, VerifyType);
+ UT_GenStub_AddParam(MM_VerifyLoadDumpParams, cpuaddr, Address);
+ UT_GenStub_AddParam(MM_VerifyLoadDumpParams, MM_MemType_Enum_t, MemType);
+ UT_GenStub_AddParam(MM_VerifyLoadDumpParams, size_t, SizeInBytes);
+ UT_GenStub_AddParam(MM_VerifyLoadDumpParams, uint8, VerifyType);
- UT_GenStub_Execute(MM_VerifyLoadDumpParams, Basic, NULL);
+ UT_GenStub_Execute(MM_VerifyLoadDumpParams, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_VerifyLoadDumpParams, int32);
+ return UT_GenStub_GetReturnValue(MM_VerifyLoadDumpParams, int32);
}
/*
@@ -129,15 +138,15 @@ int32 MM_VerifyLoadDumpParams(cpuaddr Address, MM_MemType_Enum_t MemType,
* Generated stub function for MM_VerifyPeekPokeParams()
* ----------------------------------------------------
*/
-int32 MM_VerifyPeekPokeParams(cpuaddr Address, MM_MemType_Enum_t MemType,
- size_t SizeInBits) {
- UT_GenStub_SetupReturnBuffer(MM_VerifyPeekPokeParams, int32);
+int32 MM_VerifyPeekPokeParams(cpuaddr Address, MM_MemType_Enum_t MemType, size_t SizeInBits)
+{
+ UT_GenStub_SetupReturnBuffer(MM_VerifyPeekPokeParams, int32);
- UT_GenStub_AddParam(MM_VerifyPeekPokeParams, cpuaddr, Address);
- UT_GenStub_AddParam(MM_VerifyPeekPokeParams, MM_MemType_Enum_t, MemType);
- UT_GenStub_AddParam(MM_VerifyPeekPokeParams, size_t, SizeInBits);
+ UT_GenStub_AddParam(MM_VerifyPeekPokeParams, cpuaddr, Address);
+ UT_GenStub_AddParam(MM_VerifyPeekPokeParams, MM_MemType_Enum_t, MemType);
+ UT_GenStub_AddParam(MM_VerifyPeekPokeParams, size_t, SizeInBits);
- UT_GenStub_Execute(MM_VerifyPeekPokeParams, Basic, NULL);
+ UT_GenStub_Execute(MM_VerifyPeekPokeParams, Basic, NULL);
- return UT_GenStub_GetReturnValue(MM_VerifyPeekPokeParams, int32);
+ return UT_GenStub_GetReturnValue(MM_VerifyPeekPokeParams, int32);
}
diff --git a/unit-test/utilities/mm_test_utils.c b/unit-test/utilities/mm_test_utils.c
index 84062a1..95648ad 100644
--- a/unit-test/utilities/mm_test_utils.c
+++ b/unit-test/utilities/mm_test_utils.c
@@ -41,131 +41,130 @@
/* Global Data */
/* =========== */
-CFE_EVS_SendEvent_context_t context_CFE_EVS_SendEvent[3];
+CFE_EVS_SendEvent_context_t context_CFE_EVS_SendEvent[3];
CFE_ES_WriteToSysLog_context_t context_CFE_ES_WriteToSysLog;
/* ======== */
/* Handlers */
/* ======== */
-void UT_Handler_CFE_EVS_SendEvent(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context, va_list va) {
- uint16 CallCount;
- uint16 idx;
-
- CallCount = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent));
-
- if (CallCount > (sizeof(context_CFE_EVS_SendEvent) /
- sizeof(context_CFE_EVS_SendEvent[0]))) {
- UtAssert_Failed("CFE_EVS_SendEvent UT depth %u exceeded: %u, increase "
- "UT_MAX_SENDEVENT_DEPTH",
- UT_MAX_SENDEVENT_DEPTH, CallCount);
- } else {
- idx = CallCount - 1;
- context_CFE_EVS_SendEvent[idx].EventID =
- UT_Hook_GetArgValueByName(Context, "EventID", uint16);
- context_CFE_EVS_SendEvent[idx].EventType =
- UT_Hook_GetArgValueByName(Context, "EventType", uint16);
-
- strncpy(context_CFE_EVS_SendEvent[idx].Spec,
- UT_Hook_GetArgValueByName(Context, "Spec", const char *),
- CFE_MISSION_EVS_MAX_MESSAGE_LENGTH);
- context_CFE_EVS_SendEvent[idx]
- .Spec[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH - 1] = '\0';
- }
+void UT_Handler_CFE_EVS_SendEvent(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context, va_list va)
+{
+ uint16 CallCount;
+ uint16 idx;
+
+ CallCount = UT_GetStubCount(UT_KEY(CFE_EVS_SendEvent));
+
+ if (CallCount > (sizeof(context_CFE_EVS_SendEvent) / sizeof(context_CFE_EVS_SendEvent[0])))
+ {
+ UtAssert_Failed("CFE_EVS_SendEvent UT depth %u exceeded: %u, increase "
+ "UT_MAX_SENDEVENT_DEPTH",
+ UT_MAX_SENDEVENT_DEPTH,
+ CallCount);
+ }
+ else
+ {
+ idx = CallCount - 1;
+ context_CFE_EVS_SendEvent[idx].EventID = UT_Hook_GetArgValueByName(Context, "EventID", uint16);
+ context_CFE_EVS_SendEvent[idx].EventType = UT_Hook_GetArgValueByName(Context, "EventType", uint16);
+
+ strncpy(context_CFE_EVS_SendEvent[idx].Spec,
+ UT_Hook_GetArgValueByName(Context, "Spec", const char *),
+ CFE_MISSION_EVS_MAX_MESSAGE_LENGTH);
+ context_CFE_EVS_SendEvent[idx].Spec[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH - 1] = '\0';
+ }
}
-void UT_Handler_CFE_ES_WriteToSysLog(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context,
- va_list va) {
- strncpy(context_CFE_ES_WriteToSysLog.Spec,
- UT_Hook_GetArgValueByName(Context, "SpecStringPtr", const char *),
- CFE_MISSION_EVS_MAX_MESSAGE_LENGTH - 1);
- context_CFE_ES_WriteToSysLog.Spec[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH - 1] =
- '\0';
+void UT_Handler_CFE_ES_WriteToSysLog(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context, va_list va)
+{
+ strncpy(context_CFE_ES_WriteToSysLog.Spec,
+ UT_Hook_GetArgValueByName(Context, "SpecStringPtr", const char *),
+ CFE_MISSION_EVS_MAX_MESSAGE_LENGTH - 1);
+ context_CFE_ES_WriteToSysLog.Spec[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH - 1] = '\0';
}
-void UT_Handler_MM_ResolveSymAddr(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context) {
- cpuaddr *ResolvedAddress;
+void UT_Handler_MM_ResolveSymAddr(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context)
+{
+ cpuaddr *ResolvedAddress;
- ResolvedAddress =
- UT_Hook_GetArgValueByName(Context, "ResolvedAddr", cpuaddr *);
- *ResolvedAddress = *((cpuaddr *)UserObj);
- ;
+ ResolvedAddress = UT_Hook_GetArgValueByName(Context, "ResolvedAddr", cpuaddr *);
+ *ResolvedAddress = *((cpuaddr *)UserObj);
+ ;
}
-void UT_Handler_MM_WriteFileHeaders(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context) {
- MM_LoadDumpFileHeader_t *MMFileHeaderPtr;
+void UT_Handler_MM_WriteFileHeaders(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context)
+{
+ MM_LoadDumpFileHeader_t *MMFileHeaderPtr;
- MMFileHeaderPtr =
- UT_Hook_GetArgValueByName(Context, "MMHeader", MM_LoadDumpFileHeader_t *);
- *MMFileHeaderPtr = *((MM_LoadDumpFileHeader_t *)UserObj);
+ MMFileHeaderPtr = UT_Hook_GetArgValueByName(Context, "MMHeader", MM_LoadDumpFileHeader_t *);
+ *MMFileHeaderPtr = *((MM_LoadDumpFileHeader_t *)UserObj);
}
-void UT_Handler_MM_ReadFileHeaders(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context) {
- MM_LoadDumpFileHeader_t *MMFileHeaderPtr;
+void UT_Handler_MM_ReadFileHeaders(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context)
+{
+ MM_LoadDumpFileHeader_t *MMFileHeaderPtr;
- MMFileHeaderPtr =
- UT_Hook_GetArgValueByName(Context, "MMHeader", MM_LoadDumpFileHeader_t *);
- *MMFileHeaderPtr = *((MM_LoadDumpFileHeader_t *)UserObj);
+ MMFileHeaderPtr = UT_Hook_GetArgValueByName(Context, "MMHeader", MM_LoadDumpFileHeader_t *);
+ *MMFileHeaderPtr = *((MM_LoadDumpFileHeader_t *)UserObj);
}
-void UT_Handler_MM_ComputeCRCFromFile(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context) {
- uint32 *CrcPtr;
+void UT_Handler_MM_ComputeCRCFromFile(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context)
+{
+ uint32 *CrcPtr;
- CrcPtr = UT_Hook_GetArgValueByName(Context, "CrcPtr", uint32 *);
- *CrcPtr = *((uint32 *)UserObj);
+ CrcPtr = UT_Hook_GetArgValueByName(Context, "CrcPtr", uint32 *);
+ *CrcPtr = *((uint32 *)UserObj);
}
-void UT_Handler_CFE_SB_MessageStringGet(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context) {
- char *FileName;
-
- FileName = UT_Hook_GetArgValueByName(Context, "DestStringPtr", char *);
-
- if (sizeof(FileName) > OS_MAX_FILE_NAME) {
- printf("Argument 1 (DestStringPtr) of CFE_SB_MessageStringGet exceeded the "
- "limit of %d\n",
- OS_MAX_FILE_NAME);
- } else {
- strncpy(FileName, UserObj, OS_MAX_FILE_NAME);
- }
+void UT_Handler_CFE_SB_MessageStringGet(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context)
+{
+ char *FileName;
+
+ FileName = UT_Hook_GetArgValueByName(Context, "DestStringPtr", char *);
+
+ if (sizeof(FileName) > OS_MAX_FILE_NAME)
+ {
+ printf("Argument 1 (DestStringPtr) of CFE_SB_MessageStringGet exceeded the "
+ "limit of %d\n",
+ OS_MAX_FILE_NAME);
+ }
+ else
+ {
+ strncpy(FileName, UserObj, OS_MAX_FILE_NAME);
+ }
}
/* ==================== */
/* Function Definitions */
/* ==================== */
-void MM_Test_Verify_Event(uint8 IssuedOrder, uint16 EventId, uint16 EventType,
- const char *EventText) {
- UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[IssuedOrder].EventID, EventId);
- UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[IssuedOrder].EventType,
- EventType);
-
- UtAssert_StrnCmp(EventText, context_CFE_EVS_SendEvent[IssuedOrder].Spec,
- CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
- "Event string expected: '%s'\nEvent string received: '%s'",
- EventText, context_CFE_EVS_SendEvent[IssuedOrder].Spec);
+void MM_Test_Verify_Event(uint8 IssuedOrder, uint16 EventId, uint16 EventType, const char *EventText)
+{
+ UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[IssuedOrder].EventID, EventId);
+ UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[IssuedOrder].EventType, EventType);
+
+ UtAssert_StrnCmp(EventText,
+ context_CFE_EVS_SendEvent[IssuedOrder].Spec,
+ CFE_MISSION_EVS_MAX_MESSAGE_LENGTH,
+ "Event string expected: '%s'\nEvent string received: '%s'",
+ EventText,
+ context_CFE_EVS_SendEvent[IssuedOrder].Spec);
}
-void MM_Test_Setup(void) {
- /* initialize test environment to default state for every test */
- UT_ResetState(0);
+void MM_Test_Setup(void)
+{
+ /* initialize test environment to default state for every test */
+ UT_ResetState(0);
- memset(&MM_AppData, 0, sizeof(MM_AppData));
- memset(context_CFE_EVS_SendEvent, 0, sizeof(context_CFE_EVS_SendEvent));
- memset(&context_CFE_ES_WriteToSysLog, 0,
- sizeof(context_CFE_ES_WriteToSysLog));
+ memset(&MM_AppData, 0, sizeof(MM_AppData));
+ memset(context_CFE_EVS_SendEvent, 0, sizeof(context_CFE_EVS_SendEvent));
+ memset(&context_CFE_ES_WriteToSysLog, 0, sizeof(context_CFE_ES_WriteToSysLog));
- /* Register custom handlers */
- UT_SetVaHandlerFunction(UT_KEY(CFE_EVS_SendEvent),
- UT_Handler_CFE_EVS_SendEvent, NULL);
- UT_SetVaHandlerFunction(UT_KEY(CFE_ES_WriteToSysLog),
- UT_Handler_CFE_ES_WriteToSysLog, NULL);
+ /* Register custom handlers */
+ UT_SetVaHandlerFunction(UT_KEY(CFE_EVS_SendEvent), UT_Handler_CFE_EVS_SendEvent, NULL);
+ UT_SetVaHandlerFunction(UT_KEY(CFE_ES_WriteToSysLog), UT_Handler_CFE_ES_WriteToSysLog, NULL);
}
-void MM_Test_TearDown(void) { /* cleanup test environment */ }
+void MM_Test_TearDown(void)
+{ /* cleanup test environment */
+}
diff --git a/unit-test/utilities/mm_test_utils.h b/unit-test/utilities/mm_test_utils.h
index 0858834..4c62429 100644
--- a/unit-test/utilities/mm_test_utils.h
+++ b/unit-test/utilities/mm_test_utils.h
@@ -34,58 +34,51 @@
/* Macros */
/* ====== */
-#define ADD_TEST(test) UtTest_Add(test, MM_Test_Setup, MM_Test_TearDown, #test)
-#define MM_UT_OBJID_1 OS_ObjectIdFromInteger(1)
-#define MM_UT_MID_1 CFE_SB_ValueToMsgId(1)
+#define ADD_TEST(test) UtTest_Add(test, MM_Test_Setup, MM_Test_TearDown, #test)
+#define MM_UT_OBJID_1 OS_ObjectIdFromInteger(1)
+#define MM_UT_MID_1 CFE_SB_ValueToMsgId(1)
#define UT_MAX_SENDEVENT_DEPTH 4
/* ======== */
/* Typedefs */
/* ======== */
-typedef struct {
- uint16 EventID;
- uint16 EventType;
- char Spec[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH];
+typedef struct
+{
+ uint16 EventID;
+ uint16 EventType;
+ char Spec[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH];
} CFE_EVS_SendEvent_context_t;
-typedef struct {
- char Spec[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH];
+typedef struct
+{
+ char Spec[CFE_MISSION_EVS_MAX_MESSAGE_LENGTH];
} CFE_ES_WriteToSysLog_context_t;
/* =========== */
/* Global Data */
/* =========== */
-extern CFE_EVS_SendEvent_context_t context_CFE_EVS_SendEvent[3];
+extern CFE_EVS_SendEvent_context_t context_CFE_EVS_SendEvent[3];
extern CFE_ES_WriteToSysLog_context_t context_CFE_ES_WriteToSysLog;
/* ======== */
/* Handlers */
/* ======== */
-void UT_Handler_CFE_EVS_SendEvent(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context, va_list va);
-void UT_Handler_CFE_ES_WriteToSysLog(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context,
- va_list va);
-void UT_Handler_MM_ResolveSymAddr(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context);
-void UT_Handler_MM_WriteFileHeaders(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context);
-void UT_Handler_MM_ReadFileHeaders(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context);
-void UT_Handler_MM_ComputeCRCFromFile(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context);
-void UT_Handler_CFE_SB_MessageStringGet(void *UserObj, UT_EntryKey_t FuncKey,
- const UT_StubContext_t *Context);
+void UT_Handler_CFE_EVS_SendEvent(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context, va_list va);
+void UT_Handler_CFE_ES_WriteToSysLog(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context, va_list va);
+void UT_Handler_MM_ResolveSymAddr(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context);
+void UT_Handler_MM_WriteFileHeaders(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context);
+void UT_Handler_MM_ReadFileHeaders(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context);
+void UT_Handler_MM_ComputeCRCFromFile(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context);
+void UT_Handler_CFE_SB_MessageStringGet(void *UserObj, UT_EntryKey_t FuncKey, const UT_StubContext_t *Context);
/* =================== */
/* Function Prototypes */
/* =================== */
-void MM_Test_Verify_Event(uint8 IssuedOrder, uint16 EventId, uint16 EventType,
- const char *EventText);
+void MM_Test_Verify_Event(uint8 IssuedOrder, uint16 EventId, uint16 EventType, const char *EventText);
void MM_Test_Setup(void);
void MM_Test_TearDown(void);