diff options
author | Russell Belfer <rb@github.com> | 2013-09-24 21:20:16 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-09-24 21:20:16 +0400 |
commit | d005885f0a7184629290dfcebed025b061551b40 (patch) | |
tree | 5e35d6fbb171d9d319ffe1499c6bf0cf3dbeea51 /tests-clar/core | |
parent | 634f10f69090b325a50c8bca6cb303397576305e (diff) |
Fix up filebuf tests a bit
Diffstat (limited to 'tests-clar/core')
-rw-r--r-- | tests-clar/core/filebuf.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests-clar/core/filebuf.c b/tests-clar/core/filebuf.c index 4451c01c7..bf2167057 100644 --- a/tests-clar/core/filebuf.c +++ b/tests-clar/core/filebuf.c @@ -24,18 +24,16 @@ void test_core_filebuf__0(void) void test_core_filebuf__1(void) { git_filebuf file = GIT_FILEBUF_INIT; - int fd; char test[] = "test"; - fd = p_creat(test, 0666); //-V536 - cl_must_pass(fd); - cl_must_pass(p_write(fd, "libgit2 rocks\n", 14)); - cl_must_pass(p_close(fd)); + cl_git_mkfile(test, "libgit2 rocks\n"); cl_git_pass(git_filebuf_open(&file, test, GIT_FILEBUF_APPEND)); cl_git_pass(git_filebuf_printf(&file, "%s\n", "libgit2 rocks")); cl_git_pass(git_filebuf_commit(&file, 0666)); + cl_assert_equal_file("libgit2 rocks\nlibgit2 rocks\n", 0, test); + cl_must_pass(p_unlink(test)); } @@ -53,6 +51,8 @@ void test_core_filebuf__2(void) cl_git_pass(git_filebuf_write(&file, buf, sizeof(buf))); cl_git_pass(git_filebuf_commit(&file, 0666)); + cl_assert_equal_file((char *)buf, sizeof(buf), test); + cl_must_pass(p_unlink(test)); } |