summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-05-23 16:27:56 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2020-05-23 16:27:56 +0100
commit3414d4707ceec7d7b3d632ca03cb0bd8f6ced9a0 (patch)
tree72353f71889dc8a78fa692fa4ff910ae1510785e
parent27cb4e0ec193aa5430d1a32fd90b5dc2d86f5fe1 (diff)
downloadlibgit2-3414d4707ceec7d7b3d632ca03cb0bd8f6ced9a0.tar.gz
diff::workdir: actually test the buffersethomson/difftest
The static test data is erroneously initialized with a length of 0 for three of the strings. This means the tests are not actually examining those strings. Provide the length.
-rw-r--r--tests/diff/workdir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/diff/workdir.c b/tests/diff/workdir.c
index 71b2e91a7..f2404958e 100644
--- a/tests/diff/workdir.c
+++ b/tests/diff/workdir.c
@@ -1876,9 +1876,9 @@ void test_diff_workdir__binary_detection(void)
git_buf b = GIT_BUF_INIT;
int i;
git_buf data[10] = {
- { "1234567890", 0, 0 }, /* 0 - all ascii text control */
- { "\xC3\x85\xC3\xBC\xE2\x80\xA0\x48\xC3\xB8\xCF\x80\xCE\xA9", 0, 0 }, /* 1 - UTF-8 multibyte text */
- { "\xEF\xBB\xBF\xC3\x9C\xE2\xA4\x92\xC6\x92\x38\xC2\xA3\xE2\x82\xAC", 0, 0 }, /* 2 - UTF-8 with BOM */
+ { "1234567890", 0, 10 }, /* 0 - all ascii text control */
+ { "\xC3\x85\xC3\xBC\xE2\x80\xA0\x48\xC3\xB8\xCF\x80\xCE\xA9", 0, 14 }, /* 1 - UTF-8 multibyte text */
+ { "\xEF\xBB\xBF\xC3\x9C\xE2\xA4\x92\xC6\x92\x38\xC2\xA3\xE2\x82\xAC", 0, 16 }, /* 2 - UTF-8 with BOM */
{ STR999Z, 0, 1000 }, /* 3 - ASCII with NUL at 1000 */
{ STR3999Z, 0, 4000 }, /* 4 - ASCII with NUL at 4000 */
{ STR4000 STR3999Z "x", 0, 8001 }, /* 5 - ASCII with NUL at 8000 */