Rename 'exp' so it doesn't conflict with exp()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
diff --git a/tests-clar/diff/tree.c b/tests-clar/diff/tree.c
index c60acd8..9025315 100644
--- a/tests-clar/diff/tree.c
+++ b/tests-clar/diff/tree.c
@@ -5,13 +5,13 @@ static git_repository *g_repo = NULL;
static git_diff_options opts;
static git_diff_list *diff;
static git_tree *a, *b;
-static diff_expects exp;
+static diff_expects expect;
void test_diff_tree__initialize(void)
{
GIT_INIT_STRUCTURE(&opts, GIT_DIFF_OPTIONS_VERSION);
- memset(&exp, 0, sizeof(exp));
+ memset(&expect, 0, sizeof(expect));
diff = NULL;
a = NULL;
@@ -49,41 +49,41 @@ 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, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp));
+ diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect));
- cl_assert_equal_i(5, exp.files);
- cl_assert_equal_i(2, exp.file_status[GIT_DELTA_ADDED]);
- cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]);
- cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]);
+ cl_assert_equal_i(5, expect.files);
+ cl_assert_equal_i(2, expect.file_status[GIT_DELTA_ADDED]);
+ cl_assert_equal_i(1, expect.file_status[GIT_DELTA_DELETED]);
+ cl_assert_equal_i(2, expect.file_status[GIT_DELTA_MODIFIED]);
- cl_assert_equal_i(5, exp.hunks);
+ cl_assert_equal_i(5, expect.hunks);
- cl_assert_equal_i(7 + 24 + 1 + 6 + 6, exp.lines);
- cl_assert_equal_i(1, exp.line_ctxt);
- cl_assert_equal_i(24 + 1 + 5 + 5, exp.line_adds);
- cl_assert_equal_i(7 + 1, exp.line_dels);
+ cl_assert_equal_i(7 + 24 + 1 + 6 + 6, expect.lines);
+ cl_assert_equal_i(1, expect.line_ctxt);
+ cl_assert_equal_i(24 + 1 + 5 + 5, expect.line_adds);
+ cl_assert_equal_i(7 + 1, expect.line_dels);
git_diff_list_free(diff);
diff = NULL;
- memset(&exp, 0, sizeof(exp));
+ memset(&expect, 0, sizeof(expect));
cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, c, b, &opts));
cl_git_pass(git_diff_foreach(
- diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp));
+ diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect));
- cl_assert_equal_i(2, exp.files);
- cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]);
- cl_assert_equal_i(0, exp.file_status[GIT_DELTA_DELETED]);
- cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]);
+ cl_assert_equal_i(2, expect.files);
+ cl_assert_equal_i(0, expect.file_status[GIT_DELTA_ADDED]);
+ cl_assert_equal_i(0, expect.file_status[GIT_DELTA_DELETED]);
+ cl_assert_equal_i(2, expect.file_status[GIT_DELTA_MODIFIED]);
- cl_assert_equal_i(2, exp.hunks);
+ cl_assert_equal_i(2, expect.hunks);
- cl_assert_equal_i(8 + 15, exp.lines);
- cl_assert_equal_i(1, exp.line_ctxt);
- cl_assert_equal_i(1, exp.line_adds);
- cl_assert_equal_i(7 + 14, exp.line_dels);
+ cl_assert_equal_i(8 + 15, expect.lines);
+ cl_assert_equal_i(1, expect.line_ctxt);
+ cl_assert_equal_i(1, expect.line_adds);
+ cl_assert_equal_i(7 + 14, expect.line_dels);
git_tree_free(c);
}
@@ -190,19 +190,19 @@ 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, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp));
+ diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect));
- cl_assert_equal_i(3, exp.files);
- cl_assert_equal_i(2, exp.file_status[GIT_DELTA_ADDED]);
- cl_assert_equal_i(0, exp.file_status[GIT_DELTA_DELETED]);
- cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]);
+ cl_assert_equal_i(3, expect.files);
+ cl_assert_equal_i(2, expect.file_status[GIT_DELTA_ADDED]);
+ cl_assert_equal_i(0, expect.file_status[GIT_DELTA_DELETED]);
+ cl_assert_equal_i(1, expect.file_status[GIT_DELTA_MODIFIED]);
- cl_assert_equal_i(3, exp.hunks);
+ cl_assert_equal_i(3, expect.hunks);
- cl_assert_equal_i(4, exp.lines);
- cl_assert_equal_i(0, exp.line_ctxt);
- cl_assert_equal_i(3, exp.line_adds);
- cl_assert_equal_i(1, exp.line_dels);
+ cl_assert_equal_i(4, expect.lines);
+ cl_assert_equal_i(0, expect.line_ctxt);
+ cl_assert_equal_i(3, expect.line_adds);
+ cl_assert_equal_i(1, expect.line_dels);
}
void test_diff_tree__merge(void)
@@ -231,19 +231,19 @@ void test_diff_tree__merge(void)
git_diff_list_free(diff2);
cl_git_pass(git_diff_foreach(
- diff1, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp));
+ diff1, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect));
- cl_assert_equal_i(6, exp.files);
- cl_assert_equal_i(2, exp.file_status[GIT_DELTA_ADDED]);
- cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]);
- cl_assert_equal_i(3, exp.file_status[GIT_DELTA_MODIFIED]);
+ cl_assert_equal_i(6, expect.files);
+ cl_assert_equal_i(2, expect.file_status[GIT_DELTA_ADDED]);
+ cl_assert_equal_i(1, expect.file_status[GIT_DELTA_DELETED]);
+ cl_assert_equal_i(3, expect.file_status[GIT_DELTA_MODIFIED]);
- cl_assert_equal_i(6, exp.hunks);
+ cl_assert_equal_i(6, expect.hunks);
- cl_assert_equal_i(59, exp.lines);
- cl_assert_equal_i(1, exp.line_ctxt);
- cl_assert_equal_i(36, exp.line_adds);
- cl_assert_equal_i(22, exp.line_dels);
+ cl_assert_equal_i(59, expect.lines);
+ cl_assert_equal_i(1, expect.line_ctxt);
+ cl_assert_equal_i(36, expect.line_adds);
+ cl_assert_equal_i(22, expect.line_dels);
git_diff_list_free(diff1);
}
@@ -334,7 +334,7 @@ void process_tree_to_tree_diffing(
cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, a, b, &opts));
cl_git_pass(git_diff_foreach(
- diff, diff_file_cb, NULL, NULL, &exp));
+ diff, diff_file_cb, NULL, NULL, &expect));
}
void test_diff_tree__symlink_blob_mode_changed_to_regular_file(void)
@@ -367,11 +367,11 @@ void test_diff_tree__symlink_blob_mode_changed_to_regular_file(void)
process_tree_to_tree_diffing("7fccd7", "806999");
- cl_assert_equal_i(3, exp.files);
- cl_assert_equal_i(2, exp.file_status[GIT_DELTA_DELETED]);
- cl_assert_equal_i(0, exp.file_status[GIT_DELTA_MODIFIED]);
- cl_assert_equal_i(1, exp.file_status[GIT_DELTA_ADDED]);
- cl_assert_equal_i(0, exp.file_status[GIT_DELTA_TYPECHANGE]);
+ cl_assert_equal_i(3, expect.files);
+ cl_assert_equal_i(2, expect.file_status[GIT_DELTA_DELETED]);
+ cl_assert_equal_i(0, expect.file_status[GIT_DELTA_MODIFIED]);
+ cl_assert_equal_i(1, expect.file_status[GIT_DELTA_ADDED]);
+ cl_assert_equal_i(0, expect.file_status[GIT_DELTA_TYPECHANGE]);
}
void test_diff_tree__symlink_blob_mode_changed_to_regular_file_as_typechange(void)
@@ -405,11 +405,11 @@ void test_diff_tree__symlink_blob_mode_changed_to_regular_file_as_typechange(voi
opts.flags = GIT_DIFF_INCLUDE_TYPECHANGE;
process_tree_to_tree_diffing("7fccd7", "a8595c");
- cl_assert_equal_i(2, exp.files);
- cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]);
- cl_assert_equal_i(0, exp.file_status[GIT_DELTA_MODIFIED]);
- cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]);
- cl_assert_equal_i(1, exp.file_status[GIT_DELTA_TYPECHANGE]);
+ cl_assert_equal_i(2, expect.files);
+ cl_assert_equal_i(1, expect.file_status[GIT_DELTA_DELETED]);
+ cl_assert_equal_i(0, expect.file_status[GIT_DELTA_MODIFIED]);
+ cl_assert_equal_i(0, expect.file_status[GIT_DELTA_ADDED]);
+ cl_assert_equal_i(1, expect.file_status[GIT_DELTA_TYPECHANGE]);
}
void test_diff_tree__regular_blob_mode_changed_to_executable_file(void)
@@ -423,9 +423,9 @@ void test_diff_tree__regular_blob_mode_changed_to_executable_file(void)
process_tree_to_tree_diffing("806999", "a8595c");
- cl_assert_equal_i(1, exp.files);
- cl_assert_equal_i(0, exp.file_status[GIT_DELTA_DELETED]);
- cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]);
- cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]);
- cl_assert_equal_i(0, exp.file_status[GIT_DELTA_TYPECHANGE]);
+ cl_assert_equal_i(1, expect.files);
+ cl_assert_equal_i(0, expect.file_status[GIT_DELTA_DELETED]);
+ cl_assert_equal_i(1, expect.file_status[GIT_DELTA_MODIFIED]);
+ cl_assert_equal_i(0, expect.file_status[GIT_DELTA_ADDED]);
+ cl_assert_equal_i(0, expect.file_status[GIT_DELTA_TYPECHANGE]);
}