I am running UT test case for syslog-ng in cmocka, upgraded Glib library to 2.71. I am not able to call wrapper function. I tried linking option --Wl, wrap=g_string_append_c, wrap=g_string_append in make file.
Here are my wrapper functions:
String* __wrap_g_string_append(GString *string, const gchar *val)
{
printf(" wrap_g_string_append is called\n");
return NULL;
}
GString* __wrap_g_string_append_c(GString *string, gchar c)
{
printf(" wrap_g_string_append_c is called\n");
return NULL;
}
sample main function call which is part of syslog-ng:
int main()
{
g_string_append(key, obj_key);
g_string_append_c(key, '.');
}
Here I am able to call __wrap_g_string_append function, but not able to call __wrap_g_string_append_c function, not sure what is the issue here, its calling library function g_string_append_c instead of wrapper function __wrap_g_string_append_c(). I have tried many options mentioned in cmocka forum, nothing has worked for me.
Could someone please help me in resolving the issue, anything I am missing here?