Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #67, Moves interface definition files to inc #68

Merged
merged 1 commit into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
project(CFS_FM C)

include_directories(fsw/src)
include_directories(fsw/mission_inc)
include_directories(fsw/platform_inc)

# Uncomment the below include if decompress functionality is
# enabled in FM
# include_directories(${fs_lib_MISSION_DIR}/fsw/public_inc)
Expand All @@ -19,6 +15,9 @@ set(APP_SRC_FILES
# Create the app module
add_cfe_app(fm ${APP_SRC_FILES})

# This permits direct access to public headers in the fsw/inc directory
target_include_directories(fm PUBLIC fsw/inc)

set(APP_TABLE_FILES
fsw/tables/fm_monitor.c
)
Expand Down
2 changes: 1 addition & 1 deletion docs/dox_src/cfs_fm.dox
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
The File Manager Application defines one table that specifies the file systems
contained in your system.

The table contains #FM_TABLE_ENTRY_COUNT entries defined by #FM_TableEntry_t.
The table contains #FM_TABLE_ENTRY_COUNT entries defined by #FM_MonitorTableEntry_t.
**/

/**
Expand Down
File renamed without changes.
44 changes: 23 additions & 21 deletions fsw/src/fm_defs.h → fsw/inc/fm_extern_typedefs.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/************************************************************************
* NASA Docket No. GSC-18,918-1, and identified as “Core Flight
* Software System (cFS) File Manager Application Version 2.6.1
* NASA Docket No. GSC-18,447-1, and identified as “CFS CFDP (CF)
* Application version 3.0.0
*
* Copyright (c) 2021 United States Government as represented by the
* Copyright (c) 2019 United States Government as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All Rights Reserved.
*
Expand All @@ -19,47 +19,49 @@

/**
* @file
* Value definitions
*
* Declarations and prototypes for fm_extern_typedefs module
*/
#ifndef FM_DEFS_H
#define FM_DEFS_H

#ifndef FM_EXTERN_TYPEDEFS_H
#define FM_EXTERN_TYPEDEFS_H

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* FM argument to not calculate CRC during Get File Info command */
/* FM filename status definitions */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#define FM_IGNORE_CRC 0
#define FM_NAME_IS_INVALID 0
#define FM_NAME_IS_NOT_IN_USE 1
#define FM_NAME_IS_FILE_OPEN 2
#define FM_NAME_IS_FILE_CLOSED 3
#define FM_NAME_IS_DIRECTORY 4

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* FM directory entry definitions */
/* FM free space table entry state definitions */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#define FM_THIS_DIRECTORY "."
#define FM_PARENT_DIRECTORY ".."
#define FM_TABLE_ENTRY_DISABLED 0
#define FM_TABLE_ENTRY_ENABLED 1

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* FM filename status definitions */
/* FM directory entry definitions */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#define FM_NAME_IS_INVALID 0
#define FM_NAME_IS_NOT_IN_USE 1
#define FM_NAME_IS_FILE_OPEN 2
#define FM_NAME_IS_FILE_CLOSED 3
#define FM_NAME_IS_DIRECTORY 4
#define FM_THIS_DIRECTORY "."
#define FM_PARENT_DIRECTORY ".."

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* FM free space table entry state definitions */
/* FM argument to not calculate CRC during Get File Info command */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#define FM_TABLE_ENTRY_DISABLED 0
#define FM_TABLE_ENTRY_ENABLED 1
#define FM_IGNORE_CRC 0

#endif
#endif /* FM_EXTERN_TYPEDEFS_H */
2 changes: 1 addition & 1 deletion fsw/src/fm_msg.h → fsw/inc/fm_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "cfe.h"
#include "fm_platform_cfg.h"
#include "fm_defs.h"
#include "fm_extern_typedefs.h"

#ifdef FM_INCLUDE_DECOMPRESS
#include "cfs_fs_lib.h"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions fsw/src/fm_child.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,8 @@ void FM_ChildFileInfoCmd(FM_ChildQueueEntry_t *CmdArgs)

CmdArgs->FileInfoCRC = FM_IGNORE_CRC;
}
else if ((CmdArgs->FileInfoCRC != CFE_MISSION_ES_CRC_8) && (CmdArgs->FileInfoCRC != CFE_MISSION_ES_CRC_16) &&
(CmdArgs->FileInfoCRC != CFE_MISSION_ES_CRC_32))
else if ((CmdArgs->FileInfoCRC != CFE_ES_CrcType_CRC_8) && (CmdArgs->FileInfoCRC != CFE_ES_CrcType_CRC_16) &&
(CmdArgs->FileInfoCRC != CFE_ES_CrcType_CRC_32))
{
/* Can only calculate CRC using known algorithms */
FM_GlobalData.ChildCmdWarnCounter++;
Expand Down
1 change: 0 additions & 1 deletion fsw/tables/fm_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "cfe.h"
#include "cfe_tbl_filedef.h"
#include "fm_platform_cfg.h"
#include "fm_tbl.h"
#include "fm_msg.h"

/*
Expand Down
4 changes: 3 additions & 1 deletion unit-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ add_cfe_coverage_stubs("fm_internal"
# Link with the cfe core stubs and unit test assert libs
target_link_libraries(coverage-fm_internal-stubs ut_core_api_stubs ut_assert)

# Include and expose unit test utilities includes
# Include and expose unit test utilities, fsw/inc, and fsw/src includes
target_include_directories(coverage-fm_internal-stubs PUBLIC utilities)
target_include_directories(coverage-fm_internal-stubs PUBLIC ../fsw/inc)
target_include_directories(coverage-fm_internal-stubs PUBLIC ../fsw/src)

# Generate a dedicated "testrunner" executable for each test file
# Accomplish this by cycling through all the app's source files, there must be
Expand Down
14 changes: 7 additions & 7 deletions unit-test/fm_child_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ void Test_FM_ChildFileInfoCmd_FileInfoStateIsNotFileClosed(void)
FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_GET_FILE_INFO_CC,
.Source1 = "dummy_source1",
.Source2 = "dummy_source2",
.FileInfoCRC = CFE_MISSION_ES_CRC_8,
.FileInfoCRC = CFE_ES_CrcType_CRC_8,
.FileInfoState = FM_NAME_IS_FILE_OPEN};

/* Act */
Expand All @@ -1174,7 +1174,7 @@ void Test_FM_ChildFileInfoCmd_FileInfoCRCEqualMission8(void)
FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_GET_FILE_INFO_CC,
.Source1 = "dummy_source1",
.Source2 = "dummy_source2",
.FileInfoCRC = CFE_MISSION_ES_CRC_8,
.FileInfoCRC = CFE_ES_CrcType_CRC_8,
.FileInfoState = FM_NAME_IS_FILE_CLOSED};

UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), !OS_SUCCESS);
Expand All @@ -1199,7 +1199,7 @@ void Test_FM_ChildFileInfoCmd_FileInfoCRCEqualMission16(void)
FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_GET_FILE_INFO_CC,
.Source1 = "dummy_source1",
.Source2 = "dummy_source2",
.FileInfoCRC = CFE_MISSION_ES_CRC_16,
.FileInfoCRC = CFE_ES_CrcType_CRC_16,
.FileInfoState = FM_NAME_IS_FILE_CLOSED};

UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), !OS_SUCCESS);
Expand All @@ -1224,7 +1224,7 @@ void Test_FM_ChildFileInfoCmd_FileInfoCRCEqualMission32(void)
FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_GET_FILE_INFO_CC,
.Source1 = "dummy_source1",
.Source2 = "dummy_source2",
.FileInfoCRC = CFE_MISSION_ES_CRC_32,
.FileInfoCRC = CFE_ES_CrcType_CRC_32,
.FileInfoState = FM_NAME_IS_FILE_CLOSED};

UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), !OS_SUCCESS);
Expand Down Expand Up @@ -1272,7 +1272,7 @@ void Test_FM_ChildFileInfoCmd_OSOpenCreateTrueBytesReadZero(void)
FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_GET_FILE_INFO_CC,
.Source1 = "dummy_source1",
.Source2 = "dummy_source2",
.FileInfoCRC = CFE_MISSION_ES_CRC_16,
.FileInfoCRC = CFE_ES_CrcType_CRC_16,
.FileInfoState = FM_NAME_IS_FILE_CLOSED};

UT_SetDefaultReturnValue(UT_KEY(OS_read), 0);
Expand All @@ -1297,7 +1297,7 @@ void Test_FM_ChildFileInfoCmd_BytesReadLessThanZero(void)
FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_GET_FILE_INFO_CC,
.Source1 = "dummy_source1",
.Source2 = "dummy_source2",
.FileInfoCRC = CFE_MISSION_ES_CRC_16,
.FileInfoCRC = CFE_ES_CrcType_CRC_16,
.FileInfoState = FM_NAME_IS_FILE_CLOSED};

UT_SetDefaultReturnValue(UT_KEY(OS_read), -1);
Expand All @@ -1324,7 +1324,7 @@ void Test_FM_ChildFileInfoCmd_BytesReadGreaterThanZero(void)
FM_ChildQueueEntry_t queue_entry = {.CommandCode = FM_GET_FILE_INFO_CC,
.Source1 = "dummy_source1",
.Source2 = "dummy_source2",
.FileInfoCRC = CFE_MISSION_ES_CRC_8,
.FileInfoCRC = CFE_ES_CrcType_CRC_8,
.FileInfoState = FM_NAME_IS_FILE_CLOSED};

UT_SetDefaultReturnValue(UT_KEY(OS_read), 1);
Expand Down