mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Fixed double free'ing in tests
This commit is contained in:
parent
c3ea8f8d0b
commit
788fc48b1d
@ -105,7 +105,7 @@ void cmd_alias_add_shows_message_when_exists(void **state)
|
||||
prefs_add_alias("hc", "/help commands");
|
||||
cmd_autocomplete_add("/hc");
|
||||
|
||||
expect_cons_show("Command or alias /hc already exists.");
|
||||
expect_cons_show("Command or alias '/hc' already exists.");
|
||||
|
||||
gboolean result = cmd_alias(args, *help);
|
||||
assert_true(result);
|
||||
|
@ -20,7 +20,7 @@ void contact_in_group(void **state)
|
||||
assert_true(result);
|
||||
|
||||
p_contact_free(contact);
|
||||
g_slist_free(groups);
|
||||
// g_slist_free(groups);
|
||||
}
|
||||
|
||||
void contact_not_in_group(void **state)
|
||||
@ -35,7 +35,7 @@ void contact_not_in_group(void **state)
|
||||
assert_false(result);
|
||||
|
||||
p_contact_free(contact);
|
||||
g_slist_free(groups);
|
||||
// g_slist_free(groups);
|
||||
}
|
||||
|
||||
void contact_name_when_name_exists(void **state)
|
||||
|
@ -386,9 +386,9 @@ int main(int argc, char* argv[]) {
|
||||
unit_test_setup_teardown(console_doesnt_show_dnd_presence_when_set_online,
|
||||
create_config_file,
|
||||
delete_config_file),
|
||||
// unit_test_setup_teardown(console_shows_dnd_presence_when_set_all,
|
||||
// create_config_file,
|
||||
// delete_config_file),
|
||||
unit_test_setup_teardown(console_shows_dnd_presence_when_set_all,
|
||||
create_config_file,
|
||||
delete_config_file),
|
||||
};
|
||||
|
||||
const UnitTest cmd_alias_tests[] = {
|
||||
@ -399,9 +399,9 @@ int main(int argc, char* argv[]) {
|
||||
unit_test_setup_teardown(cmd_alias_add_adds_alias,
|
||||
create_config_file,
|
||||
delete_config_file),
|
||||
// unit_test_setup_teardown(cmd_alias_add_shows_message_when_exists,
|
||||
// create_config_file,
|
||||
// delete_config_file),
|
||||
unit_test_setup_teardown(cmd_alias_add_shows_message_when_exists,
|
||||
create_config_file,
|
||||
delete_config_file),
|
||||
unit_test_setup_teardown(cmd_alias_remove_removes_alias,
|
||||
create_config_file,
|
||||
delete_config_file),
|
||||
@ -413,7 +413,6 @@ int main(int argc, char* argv[]) {
|
||||
delete_config_file),
|
||||
};
|
||||
|
||||
|
||||
int bak, new;
|
||||
fflush(stdout);
|
||||
bak = dup(1);
|
||||
@ -442,6 +441,7 @@ int main(int argc, char* argv[]) {
|
||||
fflush(stdout);
|
||||
dup2(bak, 1);
|
||||
close(bak);
|
||||
|
||||
if (result > 0) {
|
||||
return 1;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user