@@ -133,20 +133,21 @@ TEST(SupportFileListTest, RelativePathMatchesWindows) {
133
133
TEST (SupportFileListTest, SymlinkedAbsolutePaths) {
134
134
// Prepare FS
135
135
llvm::IntrusiveRefCntPtr<MockSymlinkFileSystem> fs (new MockSymlinkFileSystem (
136
- FileSpec (" /symlink_dir/foo.h" ), FileSpec (" /real_dir/foo.h" )));
136
+ PosixSpec (" /symlink_dir/foo.h" ), PosixSpec (" /real_dir/foo.h" ),
137
+ FileSpec::Style::posix));
137
138
138
139
// Prepare RealpathPrefixes
139
140
FileSpecList file_spec_list;
140
- file_spec_list.EmplaceBack ( " /symlink_dir" );
141
+ file_spec_list.Append ( PosixSpec ( " /symlink_dir" ) );
141
142
RealpathPrefixes prefixes (file_spec_list, fs);
142
143
143
144
// Prepare support file list
144
145
SupportFileList support_file_list;
145
- support_file_list.EmplaceBack ( FileSpec (" /symlink_dir/foo.h" ));
146
+ support_file_list.Append ( PosixSpec (" /symlink_dir/foo.h" ));
146
147
147
148
// Test
148
149
size_t ret = support_file_list.FindCompatibleIndex (
149
- 0 , FileSpec (" /real_dir/foo.h" ), &prefixes);
150
+ 0 , PosixSpec (" /real_dir/foo.h" ), &prefixes);
150
151
EXPECT_EQ (ret, (size_t )0 );
151
152
}
152
153
@@ -157,20 +158,21 @@ TEST(SupportFileListTest, SymlinkedAbsolutePaths) {
157
158
TEST (SupportFileListTest, RootDirectory) {
158
159
// Prepare FS
159
160
llvm::IntrusiveRefCntPtr<MockSymlinkFileSystem> fs (new MockSymlinkFileSystem (
160
- FileSpec (" /symlink_dir/foo.h" ), FileSpec (" /real_dir/foo.h" )));
161
+ PosixSpec (" /symlink_dir/foo.h" ), PosixSpec (" /real_dir/foo.h" ),
162
+ FileSpec::Style::posix));
161
163
162
164
// Prepare RealpathPrefixes
163
165
FileSpecList file_spec_list;
164
- file_spec_list.EmplaceBack ( " /" );
166
+ file_spec_list.Append ( PosixSpec ( " /" ) );
165
167
RealpathPrefixes prefixes (file_spec_list, fs);
166
168
167
169
// Prepare support file list
168
170
SupportFileList support_file_list;
169
- support_file_list.EmplaceBack ( FileSpec (" /symlink_dir/foo.h" ));
171
+ support_file_list.Append ( PosixSpec (" /symlink_dir/foo.h" ));
170
172
171
173
// Test
172
174
size_t ret = support_file_list.FindCompatibleIndex (
173
- 0 , FileSpec (" /real_dir/foo.h" ), &prefixes);
175
+ 0 , PosixSpec (" /real_dir/foo.h" ), &prefixes);
174
176
EXPECT_EQ (ret, (size_t )0 );
175
177
}
176
178
@@ -181,20 +183,21 @@ TEST(SupportFileListTest, RootDirectory) {
181
183
TEST (SupportFileListTest, SymlinkedRelativePaths) {
182
184
// Prepare FS
183
185
llvm::IntrusiveRefCntPtr<MockSymlinkFileSystem> fs (new MockSymlinkFileSystem (
184
- FileSpec (" symlink_dir/foo.h" ), FileSpec (" real_dir/foo.h" )));
186
+ PosixSpec (" symlink_dir/foo.h" ), PosixSpec (" real_dir/foo.h" ),
187
+ FileSpec::Style::posix));
185
188
186
189
// Prepare RealpathPrefixes
187
190
FileSpecList file_spec_list;
188
- file_spec_list.EmplaceBack ( " symlink_dir" );
191
+ file_spec_list.Append ( PosixSpec ( " symlink_dir" ) );
189
192
RealpathPrefixes prefixes (file_spec_list, fs);
190
193
191
194
// Prepare support file list
192
195
SupportFileList support_file_list;
193
- support_file_list.EmplaceBack ( FileSpec (" symlink_dir/foo.h" ));
196
+ support_file_list.Append ( PosixSpec (" symlink_dir/foo.h" ));
194
197
195
198
// Test
196
199
size_t ret = support_file_list.FindCompatibleIndex (
197
- 0 , FileSpec (" real_dir/foo.h" ), &prefixes);
200
+ 0 , PosixSpec (" real_dir/foo.h" ), &prefixes);
198
201
EXPECT_EQ (ret, (size_t )0 );
199
202
}
200
203
@@ -205,20 +208,21 @@ TEST(SupportFileListTest, SymlinkedRelativePaths) {
205
208
TEST (SupportFileListTest, RealpathOnlyMatchFileName) {
206
209
// Prepare FS
207
210
llvm::IntrusiveRefCntPtr<MockSymlinkFileSystem> fs (new MockSymlinkFileSystem (
208
- FileSpec (" symlink_dir/foo.h" ), FileSpec (" real_dir/foo.h" )));
211
+ PosixSpec (" symlink_dir/foo.h" ), PosixSpec (" real_dir/foo.h" ),
212
+ FileSpec::Style::posix));
209
213
210
214
// Prepare RealpathPrefixes
211
215
FileSpecList file_spec_list;
212
- file_spec_list.EmplaceBack ( " symlink_dir" );
216
+ file_spec_list.Append ( PosixSpec ( " symlink_dir" ) );
213
217
RealpathPrefixes prefixes (file_spec_list, fs);
214
218
215
219
// Prepare support file list
216
220
SupportFileList support_file_list;
217
- support_file_list.EmplaceBack ( FileSpec (" symlink_dir/foo.h" ));
221
+ support_file_list.Append ( PosixSpec (" symlink_dir/foo.h" ));
218
222
219
223
// Test
220
224
size_t ret = support_file_list.FindCompatibleIndex (
221
- 0 , FileSpec (" some_other_dir/foo.h" ), &prefixes);
225
+ 0 , PosixSpec (" some_other_dir/foo.h" ), &prefixes);
222
226
EXPECT_EQ (ret, UINT32_MAX);
223
227
}
224
228
@@ -228,21 +232,22 @@ TEST(SupportFileListTest, RealpathOnlyMatchFileName) {
228
232
TEST (SupportFileListTest, DirectoryMatchStringPrefixButNotWholeDirectoryName) {
229
233
// Prepare FS
230
234
llvm::IntrusiveRefCntPtr<MockSymlinkFileSystem> fs (new MockSymlinkFileSystem (
231
- FileSpec (" symlink_dir/foo.h" ), FileSpec (" real_dir/foo.h" )));
235
+ PosixSpec (" symlink_dir/foo.h" ), PosixSpec (" real_dir/foo.h" ),
236
+ FileSpec::Style::posix));
232
237
233
238
// Prepare RealpathPrefixes
234
239
FileSpecList file_spec_list;
235
- file_spec_list.EmplaceBack ( " symlink" ); // This is a string prefix of the
236
- // symlink but not a path prefix.
240
+ file_spec_list.Append ( PosixSpec ( " symlink" ) ); // This is a string prefix of the
241
+ // symlink but not a path prefix.
237
242
RealpathPrefixes prefixes (file_spec_list, fs);
238
243
239
244
// Prepare support file list
240
245
SupportFileList support_file_list;
241
- support_file_list.EmplaceBack ( FileSpec (" symlink_dir/foo.h" ));
246
+ support_file_list.Append ( PosixSpec (" symlink_dir/foo.h" ));
242
247
243
248
// Test
244
249
size_t ret = support_file_list.FindCompatibleIndex (
245
- 0 , FileSpec (" real_dir/foo.h" ), &prefixes);
250
+ 0 , PosixSpec (" real_dir/foo.h" ), &prefixes);
246
251
EXPECT_EQ (ret, UINT32_MAX);
247
252
}
248
253
@@ -253,20 +258,21 @@ TEST(SupportFileListTest, DirectoryMatchStringPrefixButNotWholeDirectoryName) {
253
258
TEST (SupportFileListTest, PartialBreakpointPath) {
254
259
// Prepare FS
255
260
llvm::IntrusiveRefCntPtr<MockSymlinkFileSystem> fs (new MockSymlinkFileSystem (
256
- FileSpec (" symlink_dir/foo.h" ), FileSpec (" /real_dir/foo.h" )));
261
+ PosixSpec (" symlink_dir/foo.h" ), PosixSpec (" /real_dir/foo.h" ),
262
+ FileSpec::Style::posix));
257
263
258
264
// Prepare RealpathPrefixes
259
265
FileSpecList file_spec_list;
260
- file_spec_list.EmplaceBack ( " symlink_dir" );
266
+ file_spec_list.Append ( PosixSpec ( " symlink_dir" ) );
261
267
RealpathPrefixes prefixes (file_spec_list, fs);
262
268
263
269
// Prepare support file list
264
270
SupportFileList support_file_list;
265
- support_file_list.EmplaceBack ( FileSpec (" symlink_dir/foo.h" ));
271
+ support_file_list.Append ( PosixSpec (" symlink_dir/foo.h" ));
266
272
267
273
// Test
268
274
size_t ret = support_file_list.FindCompatibleIndex (
269
- 0 , FileSpec (" real_dir/foo.h" ), &prefixes);
275
+ 0 , PosixSpec (" real_dir/foo.h" ), &prefixes);
270
276
EXPECT_EQ (ret, (size_t )0 );
271
277
}
272
278
@@ -277,20 +283,21 @@ TEST(SupportFileListTest, PartialBreakpointPath) {
277
283
TEST (SupportFileListTest, DifferentBasename) {
278
284
// Prepare FS
279
285
llvm::IntrusiveRefCntPtr<MockSymlinkFileSystem> fs (new MockSymlinkFileSystem (
280
- FileSpec (" /symlink_dir/foo.h" ), FileSpec (" /real_dir/bar.h" )));
286
+ PosixSpec (" /symlink_dir/foo.h" ), PosixSpec (" /real_dir/bar.h" ),
287
+ FileSpec::Style::posix));
281
288
282
289
// Prepare RealpathPrefixes
283
290
FileSpecList file_spec_list;
284
- file_spec_list.EmplaceBack ( " /symlink_dir" );
291
+ file_spec_list.Append ( PosixSpec ( " /symlink_dir" ) );
285
292
RealpathPrefixes prefixes (file_spec_list, fs);
286
293
287
294
// Prepare support file list
288
295
SupportFileList support_file_list;
289
- support_file_list.EmplaceBack ( FileSpec (" /symlink_dir/foo.h" ));
296
+ support_file_list.Append ( PosixSpec (" /symlink_dir/foo.h" ));
290
297
291
298
// Test
292
299
size_t ret = support_file_list.FindCompatibleIndex (
293
- 0 , FileSpec (" real_dir/bar.h" ), &prefixes);
300
+ 0 , PosixSpec (" real_dir/bar.h" ), &prefixes);
294
301
EXPECT_EQ (ret, UINT32_MAX);
295
302
}
296
303
@@ -300,11 +307,11 @@ TEST(SupportFileListTest, DifferentBasename) {
300
307
TEST (SupportFileListTest, NoPrefixes) {
301
308
// Prepare support file list
302
309
SupportFileList support_file_list;
303
- support_file_list.EmplaceBack ( FileSpec (" /real_dir/bar.h" ));
310
+ support_file_list.Append ( PosixSpec (" /real_dir/bar.h" ));
304
311
305
312
// Test
306
313
size_t ret = support_file_list.FindCompatibleIndex (
307
- 0 , FileSpec (" /real_dir/foo.h" ), nullptr );
314
+ 0 , PosixSpec (" /real_dir/foo.h" ), nullptr );
308
315
EXPECT_EQ (ret, UINT32_MAX);
309
316
}
310
317
@@ -314,10 +321,10 @@ TEST(SupportFileListTest, NoPrefixes) {
314
321
TEST (SupportFileListTest, SameFile) {
315
322
// Prepare support file list
316
323
SupportFileList support_file_list;
317
- support_file_list.EmplaceBack ( FileSpec (" /real_dir/foo.h" ));
324
+ support_file_list.Append ( PosixSpec (" /real_dir/foo.h" ));
318
325
319
326
// Test
320
327
size_t ret = support_file_list.FindCompatibleIndex (
321
- 0 , FileSpec (" /real_dir/foo.h" ), nullptr );
328
+ 0 , PosixSpec (" /real_dir/foo.h" ), nullptr );
322
329
EXPECT_EQ (ret, (size_t )0 );
323
330
}
0 commit comments