]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | struct status_entry_counts { | |
3 | size_t wrong_status_flags_count; | |
4 | size_t wrong_sorted_path; | |
5 | size_t entry_count; | |
6 | const unsigned int* expected_statuses; | |
7 | const char** expected_paths; | |
8 | size_t expected_entry_count; | |
9 | }; | |
10 | ||
11 | /* entries for a plain copy of tests/resources/status */ | |
12 | ||
13 | static const char *entry_paths0[] = { | |
14 | "file_deleted", | |
15 | "ignored_file", | |
16 | "modified_file", | |
17 | "new_file", | |
18 | "staged_changes", | |
19 | "staged_changes_file_deleted", | |
20 | "staged_changes_modified_file", | |
21 | "staged_delete_file_deleted", | |
22 | "staged_delete_modified_file", | |
23 | "staged_new_file", | |
24 | "staged_new_file_deleted_file", | |
25 | "staged_new_file_modified_file", | |
26 | ||
27 | "subdir/deleted_file", | |
28 | "subdir/modified_file", | |
29 | "subdir/new_file", | |
30 | }; | |
31 | ||
32 | static const unsigned int entry_statuses0[] = { | |
33 | GIT_STATUS_WT_DELETED, | |
34 | GIT_STATUS_IGNORED, | |
35 | GIT_STATUS_WT_MODIFIED, | |
36 | GIT_STATUS_WT_NEW, | |
37 | GIT_STATUS_INDEX_MODIFIED, | |
38 | GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_DELETED, | |
39 | GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_MODIFIED, | |
40 | GIT_STATUS_INDEX_DELETED, | |
41 | GIT_STATUS_INDEX_DELETED | GIT_STATUS_WT_NEW, | |
42 | GIT_STATUS_INDEX_NEW, | |
43 | GIT_STATUS_INDEX_NEW | GIT_STATUS_WT_DELETED, | |
44 | GIT_STATUS_INDEX_NEW | GIT_STATUS_WT_MODIFIED, | |
45 | ||
46 | GIT_STATUS_WT_DELETED, | |
47 | GIT_STATUS_WT_MODIFIED, | |
48 | GIT_STATUS_WT_NEW, | |
49 | }; | |
50 | ||
51 | static const size_t entry_count0 = 15; | |
52 | ||
53 | /* entries for a copy of tests/resources/status with all content | |
54 | * deleted from the working directory | |
55 | */ | |
56 | ||
57 | static const char *entry_paths2[] = { | |
58 | "current_file", | |
59 | "file_deleted", | |
60 | "modified_file", | |
61 | "staged_changes", | |
62 | "staged_changes_file_deleted", | |
63 | "staged_changes_modified_file", | |
64 | "staged_delete_file_deleted", | |
65 | "staged_delete_modified_file", | |
66 | "staged_new_file", | |
67 | "staged_new_file_deleted_file", | |
68 | "staged_new_file_modified_file", | |
69 | "subdir.txt", | |
70 | "subdir/current_file", | |
71 | "subdir/deleted_file", | |
72 | "subdir/modified_file", | |
73 | }; | |
74 | ||
75 | static const unsigned int entry_statuses2[] = { | |
76 | GIT_STATUS_WT_DELETED, | |
77 | GIT_STATUS_WT_DELETED, | |
78 | GIT_STATUS_WT_DELETED, | |
79 | GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_MODIFIED, | |
80 | GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_MODIFIED, | |
81 | GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_MODIFIED, | |
82 | GIT_STATUS_INDEX_DELETED, | |
83 | GIT_STATUS_INDEX_DELETED, | |
84 | GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_NEW, | |
85 | GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_NEW, | |
86 | GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_NEW, | |
87 | GIT_STATUS_WT_DELETED, | |
88 | GIT_STATUS_WT_DELETED, | |
89 | GIT_STATUS_WT_DELETED, | |
90 | GIT_STATUS_WT_DELETED, | |
91 | }; | |
92 | ||
93 | static const size_t entry_count2 = 15; | |
94 | ||
95 | /* entries for a copy of tests/resources/status with some mods */ | |
96 | ||
97 | static const char *entry_paths3[] = { | |
98 | ".HEADER", | |
99 | "42-is-not-prime.sigh", | |
100 | "README.md", | |
101 | "current_file", | |
102 | "current_file/", | |
103 | "file_deleted", | |
104 | "ignored_file", | |
105 | "modified_file", | |
106 | "new_file", | |
107 | "staged_changes", | |
108 | "staged_changes_file_deleted", | |
109 | "staged_changes_modified_file", | |
110 | "staged_delete_file_deleted", | |
111 | "staged_delete_modified_file", | |
112 | "staged_new_file", | |
113 | "staged_new_file_deleted_file", | |
114 | "staged_new_file_modified_file", | |
115 | "subdir", | |
116 | "subdir/current_file", | |
117 | "subdir/deleted_file", | |
118 | "subdir/modified_file", | |
119 | }; | |
120 | ||
121 | static const unsigned int entry_statuses3[] = { | |
122 | GIT_STATUS_WT_NEW, | |
123 | GIT_STATUS_WT_NEW, | |
124 | GIT_STATUS_WT_NEW, | |
125 | GIT_STATUS_WT_DELETED, | |
126 | GIT_STATUS_WT_NEW, | |
127 | GIT_STATUS_WT_DELETED, | |
128 | GIT_STATUS_IGNORED, | |
129 | GIT_STATUS_WT_MODIFIED, | |
130 | GIT_STATUS_WT_NEW, | |
131 | GIT_STATUS_INDEX_MODIFIED, | |
132 | GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_MODIFIED, | |
133 | GIT_STATUS_WT_MODIFIED | GIT_STATUS_INDEX_MODIFIED, | |
134 | GIT_STATUS_INDEX_DELETED, | |
135 | GIT_STATUS_WT_NEW | GIT_STATUS_INDEX_DELETED, | |
136 | GIT_STATUS_INDEX_NEW, | |
137 | GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_NEW, | |
138 | GIT_STATUS_WT_MODIFIED | GIT_STATUS_INDEX_NEW, | |
139 | GIT_STATUS_WT_NEW, | |
140 | GIT_STATUS_WT_DELETED, | |
141 | GIT_STATUS_WT_DELETED, | |
142 | GIT_STATUS_WT_DELETED, | |
143 | }; | |
144 | ||
145 | static const size_t entry_count3 = 21; | |
146 | ||
147 | ||
148 | /* entries for a copy of tests/resources/status with some mods | |
149 | * and different options to the status call | |
150 | */ | |
151 | ||
152 | static const char *entry_paths4[] = { | |
153 | ".new_file", | |
154 | "current_file", | |
155 | "current_file/current_file", | |
156 | "current_file/modified_file", | |
157 | "current_file/new_file", | |
158 | "file_deleted", | |
159 | "modified_file", | |
160 | "new_file", | |
161 | "staged_changes", | |
162 | "staged_changes_file_deleted", | |
163 | "staged_changes_modified_file", | |
164 | "staged_delete_file_deleted", | |
165 | "staged_delete_modified_file", | |
166 | "staged_new_file", | |
167 | "staged_new_file_deleted_file", | |
168 | "staged_new_file_modified_file", | |
169 | "subdir", | |
170 | "subdir/current_file", | |
171 | "subdir/deleted_file", | |
172 | "subdir/modified_file", | |
173 | "zzz_new_dir/new_file", | |
174 | "zzz_new_file" | |
175 | }; | |
176 | ||
177 | static const unsigned int entry_statuses4[] = { | |
178 | GIT_STATUS_WT_NEW, | |
179 | GIT_STATUS_WT_DELETED, | |
180 | GIT_STATUS_WT_NEW, | |
181 | GIT_STATUS_WT_NEW, | |
182 | GIT_STATUS_WT_NEW, | |
183 | GIT_STATUS_WT_DELETED, | |
184 | GIT_STATUS_WT_MODIFIED, | |
185 | GIT_STATUS_WT_NEW, | |
186 | GIT_STATUS_INDEX_MODIFIED, | |
187 | GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_MODIFIED, | |
188 | GIT_STATUS_WT_MODIFIED | GIT_STATUS_INDEX_MODIFIED, | |
189 | GIT_STATUS_INDEX_DELETED, | |
190 | GIT_STATUS_WT_NEW | GIT_STATUS_INDEX_DELETED, | |
191 | GIT_STATUS_INDEX_NEW, | |
192 | GIT_STATUS_WT_DELETED | GIT_STATUS_INDEX_NEW, | |
193 | GIT_STATUS_WT_MODIFIED | GIT_STATUS_INDEX_NEW, | |
194 | GIT_STATUS_WT_NEW, | |
195 | GIT_STATUS_WT_DELETED, | |
196 | GIT_STATUS_WT_DELETED, | |
197 | GIT_STATUS_WT_DELETED, | |
198 | GIT_STATUS_WT_NEW, | |
199 | GIT_STATUS_WT_NEW, | |
200 | }; | |
201 | ||
202 | static const size_t entry_count4 = 22; |