The test wrapper around log_config_read had different behaviour
than the real function and did not properly initialise members.
The previous fix was less elegant and is no longer needed.
This partially reverts commit
682e540702101156881a5c3219f1b27a8fcb4894.
Change-Id: Ib9210dabe0c6033fe22de073ceaada30e012cdc5
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
*/
static void __configure(void)
{
- struct log_config config = {.begin = NULL, .last = NULL};
+ struct log_config config;
if (log_config_read(&config) < 0)
goto out;
return ret;
}
- struct log_config conf = {.begin = NULL, .last = NULL};
+ struct log_config conf;
ret = log_config_read(&conf);
if (ret < 0)
- goto end;
+ return ret;
const enum sorting_order sort_by = get_order_from_config(&conf);
int main()
{
const char * get;
- struct log_config config = {.begin = NULL, .last = NULL};
+ struct log_config config;
setenv("DLOG_CONFIG_PATH", "./non_existent_file", 1);
assert(log_config_read(&config) == -ENOENT);
int __wrap_log_config_read(struct log_config *config)
{
conf_read_called = true;
+ config->begin = config->last = NULL;
+
if (fail_conf_read)
return -1;
- config->begin = config->last = NULL;
log_config_copy(config, &CONFIG);
return 0;
}