diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2015-11-02 15:09:19 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2015-11-02 15:09:19 -0500 |
commit | db1edf91e9ba9e82e6534c445008703766b5a6da (patch) | |
tree | 55607e002f768e021ed91ad7f40de0feb84b7bc4 /tests | |
parent | 76319fa8c6ce2661d04dcd4e6ceb049e294025a1 (diff) | |
parent | 3547b122b57f4aafd173013d7f82e326b9cffb24 (diff) | |
download | libgit2-db1edf91e9ba9e82e6534c445008703766b5a6da.tar.gz |
Merge pull request #3491 from libgit2/cmn/config-checksum
Use checksums to detect config file changes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/config/stress.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/config/stress.c b/tests/config/stress.c index 503f44f03..6e960425c 100644 --- a/tests/config/stress.c +++ b/tests/config/stress.c @@ -107,3 +107,23 @@ void test_config_stress__complex(void) git_config_free(config); } + +void test_config_stress__quick_write(void) +{ + git_config *config_w, *config_r; + const char *path = "./config-quick-write"; + const char *key = "quick.write"; + int32_t i; + + /* Create an external writer for one instance with the other one */ + cl_git_pass(git_config_open_ondisk(&config_w, path)); + cl_git_pass(git_config_open_ondisk(&config_r, path)); + + /* Write and read in the same second (repeat to increase the chance of it happening) */ + for (i = 0; i < 10; i++) { + int32_t val; + cl_git_pass(git_config_set_int32(config_w, key, i)); + cl_git_pass(git_config_get_int32(&val, config_r, key)); + cl_assert_equal_i(i, val); + } +} |