Commit fb6f4539d1de1f2c171d6be2e088b5b763f3e5f8

Edward Thomson 2014-02-09T12:36:24

Close files on file diff failure Not closing the files on a diff failure ensures that clar cleanup will fail on win32 because we still have the file open.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/tests/clar_libgit2.c b/tests/clar_libgit2.c
index 50762cd..9a37ee4 100644
--- a/tests/clar_libgit2.c
+++ b/tests/clar_libgit2.c
@@ -468,6 +468,7 @@ void clar__assert_equal_file(
 			p_snprintf(
 				buf, sizeof(buf), "file content mismatch at byte %d",
 				(int)(total_bytes + pos));
+			p_close(fd);
 			clar__fail(file, line, buf, path, 1);
 		}