diff options
Diffstat (limited to 'tests-clar/diff')
-rw-r--r-- | tests-clar/diff/blob.c | 36 | ||||
-rw-r--r-- | tests-clar/diff/diff_helpers.c | 12 | ||||
-rw-r--r-- | tests-clar/diff/diff_helpers.h | 12 | ||||
-rw-r--r-- | tests-clar/diff/index.c | 4 | ||||
-rw-r--r-- | tests-clar/diff/rename.c | 6 | ||||
-rw-r--r-- | tests-clar/diff/tree.c | 30 | ||||
-rw-r--r-- | tests-clar/diff/workdir.c | 70 |
7 files changed, 86 insertions, 84 deletions
diff --git a/tests-clar/diff/blob.c b/tests-clar/diff/blob.c index 0a37e829d..98b90c670 100644 --- a/tests-clar/diff/blob.c +++ b/tests-clar/diff/blob.c @@ -56,7 +56,7 @@ void test_diff_blob__can_compare_text_blobs(void) /* diff on tests/resources/attr/root_test1 */ cl_git_pass(git_diff_blobs( - a, b, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + a, b, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.file_status[GIT_DELTA_MODIFIED]); @@ -71,7 +71,7 @@ void test_diff_blob__can_compare_text_blobs(void) /* diff on tests/resources/attr/root_test2 */ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - b, c, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + b, c, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.file_status[GIT_DELTA_MODIFIED]); @@ -86,7 +86,7 @@ void test_diff_blob__can_compare_text_blobs(void) /* diff on tests/resources/attr/root_test3 */ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - a, c, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + a, c, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.file_status[GIT_DELTA_MODIFIED]); @@ -100,7 +100,7 @@ void test_diff_blob__can_compare_text_blobs(void) memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - c, d, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + c, d, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.file_status[GIT_DELTA_MODIFIED]); @@ -122,7 +122,7 @@ void test_diff_blob__can_compare_against_null_blobs(void) git_blob *e = NULL; cl_git_pass(git_diff_blobs( - d, e, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + d, e, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.file_status[GIT_DELTA_DELETED]); @@ -137,7 +137,7 @@ void test_diff_blob__can_compare_against_null_blobs(void) memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - d, e, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + d, e, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.file_status[GIT_DELTA_ADDED]); @@ -152,7 +152,7 @@ void test_diff_blob__can_compare_against_null_blobs(void) memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - alien, NULL, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + alien, NULL, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.files_binary); @@ -163,7 +163,7 @@ void test_diff_blob__can_compare_against_null_blobs(void) memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - NULL, alien, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + NULL, alien, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.files_binary); @@ -183,21 +183,21 @@ static void assert_identical_blobs_comparison(diff_expects *expected) void test_diff_blob__can_compare_identical_blobs(void) { cl_git_pass(git_diff_blobs( - d, d, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + d, d, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(0, expected.files_binary); assert_identical_blobs_comparison(&expected); memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - NULL, NULL, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + NULL, NULL, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(0, expected.files_binary); assert_identical_blobs_comparison(&expected); memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - alien, alien, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + alien, alien, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert(expected.files_binary > 0); assert_identical_blobs_comparison(&expected); @@ -223,14 +223,14 @@ void test_diff_blob__can_compare_two_binary_blobs(void) cl_git_pass(git_blob_lookup_prefix(&heart, g_repo, &h_oid, 4)); cl_git_pass(git_diff_blobs( - alien, heart, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + alien, heart, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); assert_binary_blobs_comparison(&expected); memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - heart, alien, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + heart, alien, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); assert_binary_blobs_comparison(&expected); @@ -240,14 +240,14 @@ void test_diff_blob__can_compare_two_binary_blobs(void) void test_diff_blob__can_compare_a_binary_blob_and_a_text_blob(void) { cl_git_pass(git_diff_blobs( - alien, d, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + alien, d, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); assert_binary_blobs_comparison(&expected); memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - d, alien, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + d, alien, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); assert_binary_blobs_comparison(&expected); } @@ -288,7 +288,7 @@ void test_diff_blob__comparing_two_text_blobs_honors_interhunkcontext(void) /* Test with default inter-hunk-context (not set) => default is 0 */ cl_git_pass(git_diff_blobs( - old_d, d, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + old_d, d, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(2, expected.hunks); @@ -296,7 +296,7 @@ void test_diff_blob__comparing_two_text_blobs_honors_interhunkcontext(void) opts.interhunk_lines = 0; memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - old_d, d, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + old_d, d, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(2, expected.hunks); @@ -304,7 +304,7 @@ void test_diff_blob__comparing_two_text_blobs_honors_interhunkcontext(void) opts.interhunk_lines = 1; memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( - old_d, d, &opts, &expected, diff_file_fn, diff_hunk_fn, diff_line_fn)); + old_d, d, &opts, &expected, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, expected.hunks); diff --git a/tests-clar/diff/diff_helpers.c b/tests-clar/diff/diff_helpers.c index 992c87d4c..96a921350 100644 --- a/tests-clar/diff/diff_helpers.c +++ b/tests-clar/diff/diff_helpers.c @@ -21,7 +21,7 @@ git_tree *resolve_commit_oid_to_tree( return tree; } -int diff_file_fn( +int diff_file_cb( void *cb_data, const git_diff_delta *delta, float progress) @@ -42,7 +42,7 @@ int diff_file_fn( return 0; } -int diff_hunk_fn( +int diff_hunk_cb( void *cb_data, const git_diff_delta *delta, const git_diff_range *range, @@ -61,7 +61,7 @@ int diff_hunk_fn( return 0; } -int diff_line_fn( +int diff_line_cb( void *cb_data, const git_diff_delta *delta, const git_diff_range *range, @@ -104,9 +104,9 @@ int diff_line_fn( int diff_foreach_via_iterator( git_diff_list *diff, void *data, - git_diff_file_fn file_cb, - git_diff_hunk_fn hunk_cb, - git_diff_data_fn line_cb) + git_diff_file_cb file_cb, + git_diff_hunk_cb hunk_cb, + git_diff_data_cb line_cb) { size_t d, num_d = git_diff_num_deltas(diff); diff --git a/tests-clar/diff/diff_helpers.h b/tests-clar/diff/diff_helpers.h index 6ff493d49..b5c36d64e 100644 --- a/tests-clar/diff/diff_helpers.h +++ b/tests-clar/diff/diff_helpers.h @@ -20,19 +20,19 @@ typedef struct { int line_dels; } diff_expects; -extern int diff_file_fn( +extern int diff_file_cb( void *cb_data, const git_diff_delta *delta, float progress); -extern int diff_hunk_fn( +extern int diff_hunk_cb( void *cb_data, const git_diff_delta *delta, const git_diff_range *range, const char *header, size_t header_len); -extern int diff_line_fn( +extern int diff_line_cb( void *cb_data, const git_diff_delta *delta, const git_diff_range *range, @@ -43,8 +43,8 @@ extern int diff_line_fn( extern int diff_foreach_via_iterator( git_diff_list *diff, void *data, - git_diff_file_fn file_cb, - git_diff_hunk_fn hunk_cb, - git_diff_data_fn line_cb); + git_diff_file_cb file_cb, + git_diff_hunk_cb hunk_cb, + git_diff_data_cb line_cb); extern void diff_print(FILE *fp, git_diff_list *diff); diff --git a/tests-clar/diff/index.c b/tests-clar/diff/index.c index 4b96bfa09..e89260217 100644 --- a/tests-clar/diff/index.c +++ b/tests-clar/diff/index.c @@ -35,7 +35,7 @@ void test_diff_index__0(void) cl_git_pass(git_diff_index_to_tree(&diff, g_repo, a, NULL, &opts)); cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); /* to generate these values: * - cd to tests/resources/status, @@ -63,7 +63,7 @@ void test_diff_index__0(void) cl_git_pass(git_diff_index_to_tree(&diff, g_repo, b, NULL, &opts)); cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); /* to generate these values: * - cd to tests/resources/status, diff --git a/tests-clar/diff/rename.c b/tests-clar/diff/rename.c index 1ea2e3fc9..ee6a1816b 100644 --- a/tests-clar/diff/rename.c +++ b/tests-clar/diff/rename.c @@ -55,7 +55,7 @@ void test_diff_rename__match_oid(void) */ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -69,7 +69,7 @@ void test_diff_rename__match_oid(void) memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -91,7 +91,7 @@ void test_diff_rename__match_oid(void) memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); diff --git a/tests-clar/diff/tree.c b/tests-clar/diff/tree.c index 8e8939976..6eb5826e4 100644 --- a/tests-clar/diff/tree.c +++ b/tests-clar/diff/tree.c @@ -37,7 +37,7 @@ void test_diff_tree__0(void) cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, a, b, &opts)); cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(5, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_ADDED]); @@ -59,7 +59,7 @@ void test_diff_tree__0(void) cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, c, b, &opts)); cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(2, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -94,17 +94,18 @@ void test_diff_tree__options(void) int test_ab_or_cd[] = { 0, 0, 0, 0, 1, 1, 1, 1, 1 }; git_diff_options test_options[] = { /* a vs b tests */ - { GIT_DIFF_NORMAL, 1, 1, NULL, NULL, {0} }, - { GIT_DIFF_NORMAL, 3, 1, NULL, NULL, {0} }, - { GIT_DIFF_REVERSE, 2, 1, NULL, NULL, {0} }, - { GIT_DIFF_FORCE_TEXT, 2, 1, NULL, NULL, {0} }, + { 1, GIT_DIFF_NORMAL, 1, 1, NULL, NULL, {0} }, + { 1, GIT_DIFF_NORMAL, 3, 1, NULL, NULL, {0} }, + { 1, GIT_DIFF_REVERSE, 2, 1, NULL, NULL, {0} }, + { 1, GIT_DIFF_FORCE_TEXT, 2, 1, NULL, NULL, {0} }, /* c vs d tests */ - { GIT_DIFF_NORMAL, 3, 1, NULL, NULL, {0} }, - { GIT_DIFF_IGNORE_WHITESPACE, 3, 1, NULL, NULL, {0} }, - { GIT_DIFF_IGNORE_WHITESPACE_CHANGE, 3, 1, NULL, NULL, {0} }, - { GIT_DIFF_IGNORE_WHITESPACE_EOL, 3, 1, NULL, NULL, {0} }, - { GIT_DIFF_IGNORE_WHITESPACE | GIT_DIFF_REVERSE, 1, 1, NULL, NULL, {0} }, + { 1, GIT_DIFF_NORMAL, 3, 1, NULL, NULL, {0} }, + { 1, GIT_DIFF_IGNORE_WHITESPACE, 3, 1, NULL, NULL, {0} }, + { 1, GIT_DIFF_IGNORE_WHITESPACE_CHANGE, 3, 1, NULL, NULL, {0} }, + { 1, GIT_DIFF_IGNORE_WHITESPACE_EOL, 3, 1, NULL, NULL, {0} }, + { 1, GIT_DIFF_IGNORE_WHITESPACE | GIT_DIFF_REVERSE, 1, 1, NULL, NULL, {0} }, }; + /* to generate these values: * - cd to tests/resources/attr, * - mv .gitted .git @@ -112,6 +113,7 @@ void test_diff_tree__options(void) * - mv .git .gitted */ #define EXPECT_STATUS_ADM(ADDS,DELS,MODS) { 0, ADDS, DELS, MODS, 0, 0, 0, 0, 0 } + diff_expects test_expects[] = { /* a vs b tests */ { 5, 0, EXPECT_STATUS_ADM(3, 0, 2), 4, 0, 0, 51, 2, 46, 3 }, @@ -146,7 +148,7 @@ void test_diff_tree__options(void) cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, c, d, &opts)); cl_git_pass(git_diff_foreach( - diff, &actual, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &actual, diff_file_cb, diff_hunk_cb, diff_line_cb)); expected = &test_expects[i]; cl_assert_equal_i(actual.files, expected->files); @@ -190,7 +192,7 @@ void test_diff_tree__bare(void) cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, a, b, &opts)); cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_ADDED]); @@ -240,7 +242,7 @@ void test_diff_tree__merge(void) memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff1, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff1, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(6, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_ADDED]); diff --git a/tests-clar/diff/workdir.c b/tests-clar/diff/workdir.c index a4dbe37ff..87013135d 100644 --- a/tests-clar/diff/workdir.c +++ b/tests-clar/diff/workdir.c @@ -33,10 +33,10 @@ void test_diff_workdir__to_index(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); /* to generate these values: * - cd to tests/resources/status, @@ -101,10 +101,10 @@ void test_diff_workdir__to_tree(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(14, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -137,10 +137,10 @@ void test_diff_workdir__to_tree(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(15, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_ADDED]); @@ -174,10 +174,10 @@ void test_diff_workdir__to_tree(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(16, exp.files); cl_assert_equal_i(5, exp.file_status[GIT_DELTA_ADDED]); @@ -223,9 +223,9 @@ void test_diff_workdir__to_index_with_pathspec(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, NULL, NULL)); + diff, &exp, diff_file_cb, NULL, NULL)); else - cl_git_pass(git_diff_foreach(diff, &exp, diff_file_fn, NULL, NULL)); + cl_git_pass(git_diff_foreach(diff, &exp, diff_file_cb, NULL, NULL)); cl_assert_equal_i(13, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -246,9 +246,9 @@ void test_diff_workdir__to_index_with_pathspec(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, NULL, NULL)); + diff, &exp, diff_file_cb, NULL, NULL)); else - cl_git_pass(git_diff_foreach(diff, &exp, diff_file_fn, NULL, NULL)); + cl_git_pass(git_diff_foreach(diff, &exp, diff_file_cb, NULL, NULL)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -269,9 +269,9 @@ void test_diff_workdir__to_index_with_pathspec(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, NULL, NULL)); + diff, &exp, diff_file_cb, NULL, NULL)); else - cl_git_pass(git_diff_foreach(diff, &exp, diff_file_fn, NULL, NULL)); + cl_git_pass(git_diff_foreach(diff, &exp, diff_file_cb, NULL, NULL)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -292,9 +292,9 @@ void test_diff_workdir__to_index_with_pathspec(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, NULL, NULL)); + diff, &exp, diff_file_cb, NULL, NULL)); else - cl_git_pass(git_diff_foreach(diff, &exp, diff_file_fn, NULL, NULL)); + cl_git_pass(git_diff_foreach(diff, &exp, diff_file_cb, NULL, NULL)); cl_assert_equal_i(2, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -331,10 +331,10 @@ void test_diff_workdir__filemode_changes(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_MODIFIED]); @@ -354,10 +354,10 @@ void test_diff_workdir__filemode_changes(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); @@ -390,7 +390,7 @@ void test_diff_workdir__filemode_changes_with_filemode_false(void) memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_MODIFIED]); @@ -406,7 +406,7 @@ void test_diff_workdir__filemode_changes_with_filemode_false(void) memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_MODIFIED]); @@ -450,10 +450,10 @@ void test_diff_workdir__head_index_and_workdir_all_differ(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff_i2t, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff_i2t, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff_i2t, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff_i2t, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -471,10 +471,10 @@ void test_diff_workdir__head_index_and_workdir_all_differ(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff_w2i, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff_w2i, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff_w2i, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff_w2i, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -494,10 +494,10 @@ void test_diff_workdir__head_index_and_workdir_all_differ(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff_i2t, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff_i2t, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff_i2t, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff_i2t, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -536,10 +536,10 @@ void test_diff_workdir__eof_newline_changes(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -563,10 +563,10 @@ void test_diff_workdir__eof_newline_changes(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -590,10 +590,10 @@ void test_diff_workdir__eof_newline_changes(void) if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); else cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -792,7 +792,7 @@ void test_diff_workdir__submodules(void) memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, &exp, diff_file_fn, diff_hunk_fn, diff_line_fn)); + diff, &exp, diff_file_cb, diff_hunk_cb, diff_line_cb)); /* the following differs from "git diff 873585" by one "untracked" file * because the diff list includes the "not_submodule/" directory which |