Closed kamal-ahmed-emphysys closed 3 months ago
Are you using cmock with ceedling? If so, there is a known issue with the test preprocessor (see https://github.com/ThrowTheSwitch/CMock/issues/328). But I don't know why the inline mocking is enabled, it is disabled by default.
Please check if this is the problem described here: https://github.com/ThrowTheSwitch/Ceedling/issues/706#issuecomment-1380244582
duplicate inline function issues.
I am using Cmock option for mocking inline functions. The option for mocking externs in not set (default). Not sure what is triggering the inline treatment. Plus, even if there was an inline function here, I did not expect the macros and the included file to be removed in the replacement. I am also surprised that the parser does not generate header guards.
I have included the original file and generated replacement. The included file for macro magic and the macros should be irrelevant to the parser.
Original:
/*
ifndef __control_h__
define __control_h__ 1
include "vartypes.h"
include "global_defines.h"
undef VAR
undef STRUCT
define VAR( type, name, init, fname ) type name ;
define STRUCT( type, ref ) struct _##type *ref ;
//!Typedef for structure that contains all variables in the control structure typedef struct _control_t {
include "controlvars.h"
} control_t;
undef VAR
undef STRUCT
extern control_t control_def;
int control_update( void );
void control_init( void );
void control_halt( void );
endif
Replacement generated by Cmock:
include "../CM7/controlvars.h"
include "../CM7/global_defines.h"
include "../CM7/base/vartypes.h"
typedef struct _control_t {
} control_t;
extern control_t control_def;
int
control_update( void );
void
control_init( void );
void
control_halt( void );