test_assert(!session->found);
session->found = TRUE;
- pid_t pid;
+ pid_t pid = -1;
test_assert(str_to_pid(args[0], &pid) == 0);
test_assert(pid == session->pid);
test_assert_strcmp(args[1], session->key.username);
static int lua_dict_set_timestamp(lua_State *L)
{
struct lua_dict_txn *txn;
- lua_Number tv_sec, tv_nsec;
+ lua_Number tv_sec = 0, tv_nsec = 0;
DLUA_REQUIRE_ARGS(L, 2);
/* check string key */ \
ret = dlua_table_get_##name##_by_str(script->L, idx, \
str_key, &value); \
- test_assert(ret == 1); \
- test_assert(value == expected_value); \
+ test_assert(ret == 1 && value == expected_value); \
\
/* check int key */ \
ret = dlua_table_get_##name##_by_int(script->L, idx, \
int_key, &value); \
- test_assert(ret == 1); \
- test_assert(value == expected_value); \
+ test_assert(ret == 1 && value == expected_value); \
} \
static void check_table_get_##name##_err(struct dlua_script *script, \
int idx, int expected_ret, \
const char *str_key,
lua_Integer int_key)
{
- const char *value;
+ const char *value = NULL;
int ret;
/* check string key */
settings_var_expand(struct settings_apply_ctx *ctx, unsigned int key_idx,
const char **value, const char **error_r)
{
- struct settings_file file;
+ struct settings_file file = { NULL, NULL };
const char *orig_value = *value;
bool changed;
bool want_expand = FALSE;
test_begin("str_to_uintmax_hex in range");
while (i < sizeof(uintmax_t)*CHAR_BIT) {
- uintmax_t value_back;
+ uintmax_t value_back = UINTMAX_MAX;
const char *endp;
value = (value << 1) + 1;