Skip to content

Commit f32b42f

Browse files
authored
Merge pull request #60 from jphickey/fix-59-ut-argptr-macro
Fix #59, replace direct ref to ArgPtr with macro
2 parents 1b9eea3 + df83fe1 commit f32b42f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

unit-test/coveragetest/coveragetest_sample_lib.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,16 @@ typedef struct
6868
static int32 UT_printf_hook(void *UserObj, int32 StubRetcode, uint32 CallCount, const UT_StubContext_t *Context,
6969
va_list va)
7070
{
71-
SAMPLE_LIB_Function_TestState_t *State = UserObj;
71+
SAMPLE_LIB_Function_TestState_t *State = UserObj;
72+
const char * string = UT_Hook_GetArgValueByName(Context, "string", const char *);
7273

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

0 commit comments

Comments
 (0)