diff options
author | Vicent Martà <tanoku@gmail.com> | 2012-01-24 20:35:15 -0800 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2012-01-24 20:35:15 -0800 |
commit | 3fd1520cd4d8b4d6b6493a7d3dc393ffd9abf1db (patch) | |
tree | 51b29f5d8ffeb31ba751ab2a099e4f2a32d4be07 /tests-clar/config/add.c | |
parent | a9fe8ae0ee1ddcc289fad53f1a671f02a3e9a88f (diff) | |
download | libgit2-3fd1520cd4d8b4d6b6493a7d3dc393ffd9abf1db.tar.gz |
Rename the Clay test suite to Clar
Clay is the name of a programming language on the makings, and we want
to avoid confusions. Sorry for the huge diff!
Diffstat (limited to 'tests-clar/config/add.c')
-rw-r--r-- | tests-clar/config/add.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests-clar/config/add.c b/tests-clar/config/add.c new file mode 100644 index 000000000..b58029951 --- /dev/null +++ b/tests-clar/config/add.c @@ -0,0 +1,37 @@ +#include "clar_libgit2.h" + +void test_config_add__initialize(void) +{ + cl_fixture_sandbox("config/config10"); +} + +void test_config_add__cleanup(void) +{ + cl_fixture_cleanup("config10"); +} + +void test_config_add__to_existing_section(void) +{ + git_config *cfg; + int32_t i; + + cl_git_pass(git_config_open_ondisk(&cfg, "config10")); + cl_git_pass(git_config_set_int32(cfg, "empty.tmp", 5)); + cl_git_pass(git_config_get_int32(cfg, "empty.tmp", &i)); + cl_assert(i == 5); + cl_git_pass(git_config_delete(cfg, "empty.tmp")); + git_config_free(cfg); +} + +void test_config_add__to_new_section(void) +{ + git_config *cfg; + int32_t i; + + cl_git_pass(git_config_open_ondisk(&cfg, "config10")); + cl_git_pass(git_config_set_int32(cfg, "section.tmp", 5)); + cl_git_pass(git_config_get_int32(cfg, "section.tmp", &i)); + cl_assert(i == 5); + cl_git_pass(git_config_delete(cfg, "section.tmp")); + git_config_free(cfg); +} |