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

sample_lib Integration candidate: 2021-04-27 #61

Merged
merged 3 commits into from
Apr 29, 2021
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ sample_lib implements SAMPLE_Function, as an example for how to build and link a

## Version History

### Development Build: v1.2.0-rc1+dev34

- Replace direct ref to ArgPtr with `UT_Hook_GetArgValueByName` macro. Reading the pointer directly is not advised.
- See <https://github.com/nasa/sample_lib/pull/61> and <https://github.com/nasa/cFS/pull/250>

### Development Build: v1.2.0-rc1+dev30

- Replace <> with " for local includes
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/sample_lib_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

/* Development Build Macro Definitions */

#define SAMPLE_LIB_BUILD_NUMBER 30 /*!< Development Build: Number of commits since baseline */
#define SAMPLE_LIB_BUILD_NUMBER 34 /*!< Development Build: Number of commits since baseline */
#define SAMPLE_LIB_BUILD_BASELINE \
"v1.2.0-rc1" /*!< Development Build: git tag that is the base for the current development */

Expand Down
5 changes: 3 additions & 2 deletions unit-test/coveragetest/coveragetest_sample_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,16 @@ typedef struct
static int32 UT_printf_hook(void *UserObj, int32 StubRetcode, uint32 CallCount, const UT_StubContext_t *Context,
va_list va)
{
SAMPLE_LIB_Function_TestState_t *State = UserObj;
SAMPLE_LIB_Function_TestState_t *State = UserObj;
const char * string = UT_Hook_GetArgValueByName(Context, "string", const char *);

/*
* The OS_printf() stub passes format string as the argument
* This confirms the whole string; normally this level of test
* detail would not be needed, but this serves as an example
* of how it can be done.
*/
if (Context->ArgCount > 0 && strcmp(Context->ArgPtr[0], "SAMPLE_LIB_Function called, buffer=\'%s\'\n") == 0)
if (Context->ArgCount > 0 && strcmp(string, "SAMPLE_LIB_Function called, buffer=\'%s\'\n") == 0)
{
State->format_string_valid = true;

Expand Down