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/clar_helpers.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/clar_helpers.c')
| -rw-r--r-- | tests-clar/clar_helpers.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests-clar/clar_helpers.c b/tests-clar/clar_helpers.c new file mode 100644 index 000000000..eea8bc87d --- /dev/null +++ b/tests-clar/clar_helpers.c @@ -0,0 +1,29 @@ +#include "clar_libgit2.h" +#include "posix.h" + +void clar_on_init(void) +{ + git_threads_init(); +} + +void clar_on_shutdown(void) +{ + git_threads_shutdown(); +} + +void cl_git_mkfile(const char *filename, const char *content) +{ + int fd; + + fd = p_creat(filename, 0666); + cl_assert(fd != 0); + + if (content) { + cl_must_pass(p_write(fd, content, strlen(content))); + } else { + cl_must_pass(p_write(fd, filename, strlen(filename))); + cl_must_pass(p_write(fd, "\n", 1)); + } + + cl_must_pass(p_close(fd)); +} |
