1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Fix prefs_get_str related leaks in unit tests

Related to https://github.com/profanity-im/profanity/issues/1019
This commit is contained in:
Michael Vetter 2019-06-19 17:15:47 +02:00
parent 184f01c4ac
commit 6c9631d7ea
3 changed files with 15 additions and 0 deletions

View File

@ -59,6 +59,7 @@ void cmd_otr_log_on_enables_logging(void **state)
assert_true(result);
assert_string_equal("on", pref_otr_log);
prefs_free_string(pref_otr_log);
}
void cmd_otr_log_on_shows_warning_when_chlog_disabled(void **state)
@ -87,6 +88,7 @@ void cmd_otr_log_off_disables_logging(void **state)
assert_true(result);
assert_string_equal("off", pref_otr_log);
prefs_free_string(pref_otr_log);
}
void cmd_otr_redact_redacts_logging(void **state)
@ -102,6 +104,7 @@ void cmd_otr_redact_redacts_logging(void **state)
assert_true(result);
assert_string_equal("redact", pref_otr_log);
prefs_free_string(pref_otr_log);
}
void cmd_otr_log_redact_shows_warning_when_chlog_disabled(void **state)

View File

@ -67,6 +67,7 @@ void cmd_presence_console_sets_all(void **state)
assert_non_null(setting);
assert_string_equal("all", setting);
assert_true(result);
prefs_free_string(setting);
}
void cmd_presence_console_sets_online(void **state)
@ -81,6 +82,7 @@ void cmd_presence_console_sets_online(void **state)
assert_non_null(setting);
assert_string_equal("online", setting);
assert_true(result);
prefs_free_string(setting);
}
void cmd_presence_console_sets_none(void **state)
@ -95,6 +97,7 @@ void cmd_presence_console_sets_none(void **state)
assert_non_null(setting);
assert_string_equal("none", setting);
assert_true(result);
prefs_free_string(setting);
}
void cmd_presence_chat_sets_all(void **state)
@ -109,6 +112,7 @@ void cmd_presence_chat_sets_all(void **state)
assert_non_null(setting);
assert_string_equal("all", setting);
assert_true(result);
prefs_free_string(setting);
}
void cmd_presence_chat_sets_online(void **state)
@ -123,6 +127,7 @@ void cmd_presence_chat_sets_online(void **state)
assert_non_null(setting);
assert_string_equal("online", setting);
assert_true(result);
prefs_free_string(setting);
}
void cmd_presence_chat_sets_none(void **state)
@ -137,6 +142,7 @@ void cmd_presence_chat_sets_none(void **state)
assert_non_null(setting);
assert_string_equal("none", setting);
assert_true(result);
prefs_free_string(setting);
}
void cmd_presence_room_sets_all(void **state)
@ -151,6 +157,7 @@ void cmd_presence_room_sets_all(void **state)
assert_non_null(setting);
assert_string_equal("all", setting);
assert_true(result);
prefs_free_string(setting);
}
void cmd_presence_room_sets_online(void **state)
@ -165,6 +172,7 @@ void cmd_presence_room_sets_online(void **state)
assert_non_null(setting);
assert_string_equal("online", setting);
assert_true(result);
prefs_free_string(setting);
}
void cmd_presence_room_sets_none(void **state)
@ -179,4 +187,5 @@ void cmd_presence_room_sets_none(void **state)
assert_non_null(setting);
assert_string_equal("none", setting);
assert_true(result);
prefs_free_string(setting);
}

View File

@ -14,6 +14,7 @@ void statuses_console_defaults_to_all(void **state)
assert_non_null(setting);
assert_string_equal("all", setting);
prefs_free_string(setting);
}
void statuses_chat_defaults_to_all(void **state)
@ -22,6 +23,7 @@ void statuses_chat_defaults_to_all(void **state)
assert_non_null(setting);
assert_string_equal("all", setting);
prefs_free_string(setting);
}
void statuses_muc_defaults_to_all(void **state)
@ -30,4 +32,5 @@ void statuses_muc_defaults_to_all(void **state)
assert_non_null(setting);
assert_string_equal("all", setting);
prefs_free_string(setting);
}