1
0
mirror of https://gitlab.com/klmp200/fish.git synced 2025-07-11 20:29:23 +00:00

TESTED+0Leak+Sli HAPPY

This commit is contained in:
Ame
2017-05-29 19:42:02 +02:00
parent 671ac28106
commit d85f4db5cc
5 changed files with 80 additions and 80 deletions

View File

@ -1,3 +1,28 @@
#include "gtest/gtest.h"
#include "../fish_shell/fish_types.h"
#include "../fish_shell/fish_settings.h"
#include "../fish_shell/fish_settings.h"
TEST(free_settings_Test, freeSettings){
Settings *s1 = getSettings();
Settings *s2 = getSettings();
freeSettings(s1);
ASSERT_STRNE(s1->PS1, s2->PS1);
freeSettings(s2);
}
TEST(extract_variable_Test, extractVariable){
ASSERT_TRUE(extractVariable((char*) "P4T3", (char*) "PS1") == NULL);
ASSERT_STREQ(extractVariable((char*) "../fish_shell_tests/fishrc", (char*) "PS1"), "sli->");
ASSERT_TRUE(extractVariable((char*) "../fish_shell_tests/fishrc", (char*) "P1ZZ4") == NULL);
}
TEST(get_settings_Test, getSettings){
Settings* s = getSettings();
ASSERT_FALSE(s ==NULL);
ASSERT_FALSE(s->passwd == NULL);
freeSettings(s);
}