Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 79403eb

Browse files
committed
[FileCollector] Update unit test to match coding style.
I changed the FileCollector coding style but didn't update the corresponding unit test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366973 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 51e124d commit 79403eb

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

unittests/Support/FileCollectorTest.cpp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ namespace {
2727
class TestingFileCollector : public FileCollector {
2828
public:
2929
using FileCollector::FileCollector;
30-
using FileCollector::m_root;
31-
using FileCollector::m_seen;
32-
using FileCollector::m_symlink_map;
33-
using FileCollector::m_vfs_writer;
30+
using FileCollector::Root;
31+
using FileCollector::Seen;
32+
using FileCollector::SymlinkMap;
33+
using FileCollector::VFSWriter;
3434

35-
bool HasSeen(StringRef fs) {
36-
return m_seen.find(fs) != m_seen.end();
35+
bool hasSeen(StringRef fs) {
36+
return Seen.find(fs) != Seen.end();
3737
}
3838
};
3939

@@ -99,28 +99,28 @@ struct ScopedFile {
9999
};
100100
} // end anonymous namespace
101101

102-
TEST(FileCollectorTest, AddFile) {
102+
TEST(FileCollectorTest, addFile) {
103103
ScopedDir root("add_file_root", true);
104104
std::string root_fs = root.Path.str();
105-
TestingFileCollector file_collector(root_fs, root_fs);
105+
TestingFileCollector FileCollector(root_fs, root_fs);
106106

107-
file_collector.AddFile("/path/to/a");
108-
file_collector.AddFile("/path/to/b");
109-
file_collector.AddFile("/path/to/c");
107+
FileCollector.addFile("/path/to/a");
108+
FileCollector.addFile("/path/to/b");
109+
FileCollector.addFile("/path/to/c");
110110

111111
// Make sure the root is correct.
112-
EXPECT_EQ(file_collector.m_root, root_fs);
112+
EXPECT_EQ(FileCollector.Root, root_fs);
113113

114114
// Make sure we've seen all the added files.
115-
EXPECT_TRUE(file_collector.HasSeen("/path/to/a"));
116-
EXPECT_TRUE(file_collector.HasSeen("/path/to/b"));
117-
EXPECT_TRUE(file_collector.HasSeen("/path/to/c"));
115+
EXPECT_TRUE(FileCollector.hasSeen("/path/to/a"));
116+
EXPECT_TRUE(FileCollector.hasSeen("/path/to/b"));
117+
EXPECT_TRUE(FileCollector.hasSeen("/path/to/c"));
118118

119119
// Make sure we've only seen the added files.
120-
EXPECT_FALSE(file_collector.HasSeen("/path/to/d"));
120+
EXPECT_FALSE(FileCollector.hasSeen("/path/to/d"));
121121
}
122122

123-
TEST(FileCollectorTest, CopyFiles) {
123+
TEST(FileCollectorTest, copyFiles) {
124124
ScopedDir file_root("file_root", true);
125125
ScopedFile a(file_root + "/aaa");
126126
ScopedFile b(file_root + "/bbb");
@@ -129,22 +129,22 @@ TEST(FileCollectorTest, CopyFiles) {
129129
// Create file collector and add files.
130130
ScopedDir root("copy_files_root", true);
131131
std::string root_fs = root.Path.str();
132-
TestingFileCollector file_collector(root_fs, root_fs);
133-
file_collector.AddFile(a.Path);
134-
file_collector.AddFile(b.Path);
135-
file_collector.AddFile(c.Path);
132+
TestingFileCollector FileCollector(root_fs, root_fs);
133+
FileCollector.addFile(a.Path);
134+
FileCollector.addFile(b.Path);
135+
FileCollector.addFile(c.Path);
136136

137137
// Make sure we can copy the files.
138-
std::error_code ec = file_collector.CopyFiles(true);
138+
std::error_code ec = FileCollector.copyFiles(true);
139139
EXPECT_FALSE(ec);
140140

141141
// Now add a bogus file and make sure we error out.
142-
file_collector.AddFile("/some/bogus/file");
143-
ec = file_collector.CopyFiles(true);
142+
FileCollector.addFile("/some/bogus/file");
143+
ec = FileCollector.copyFiles(true);
144144
EXPECT_TRUE(ec);
145145

146146
// However, if stop_on_error is true the copy should still succeed.
147-
ec = file_collector.CopyFiles(false);
147+
ec = FileCollector.copyFiles(false);
148148
EXPECT_FALSE(ec);
149149
}
150150

@@ -171,17 +171,17 @@ TEST(FileCollectorTest, Symlinks) {
171171
// Root where files are copied to.
172172
ScopedDir reproducer_root("reproducer_root", true);
173173
std::string root_fs = reproducer_root.Path.str();
174-
TestingFileCollector file_collector(root_fs, root_fs);
174+
TestingFileCollector FileCollector(root_fs, root_fs);
175175

176176
// Add all the files to the collector.
177-
file_collector.AddFile(a.Path);
178-
file_collector.AddFile(b.Path);
179-
file_collector.AddFile(c.Path);
180-
file_collector.AddFile(d.Path);
181-
file_collector.AddFile(e.Path);
182-
file_collector.AddFile(file_root + "/bar/ddd");
183-
184-
auto mapping = file_collector.m_vfs_writer.getMappings();
177+
FileCollector.addFile(a.Path);
178+
FileCollector.addFile(b.Path);
179+
FileCollector.addFile(c.Path);
180+
FileCollector.addFile(d.Path);
181+
FileCollector.addFile(e.Path);
182+
FileCollector.addFile(file_root + "/bar/ddd");
183+
184+
auto mapping = FileCollector.VFSWriter.getMappings();
185185

186186
{
187187
// Make sure the common case works.

0 commit comments

Comments
 (0)