aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Basic/VirtualFileSystemTest.cpp
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2017-03-14 17:46:26 +0000
committerJuergen Ributzka <juergen@apple.com>2017-03-14 17:46:26 +0000
commit53fda3996cb5c56c82306746eac2f3ba71c1319d (patch)
tree8d1e695decb57ade342a3d22a7188ec6ea16111c /clang/unittests/Basic/VirtualFileSystemTest.cpp
parent47cc7e684f08c13a7875669f9aac6b7fa6cfcc87 (diff)
downloadllvm-53fda3996cb5c56c82306746eac2f3ba71c1319d.zip
llvm-53fda3996cb5c56c82306746eac2f3ba71c1319d.tar.gz
llvm-53fda3996cb5c56c82306746eac2f3ba71c1319d.tar.bz2
Add more debugging code for the SystemZ bot.
llvm-svn: 297759
Diffstat (limited to 'clang/unittests/Basic/VirtualFileSystemTest.cpp')
-rw-r--r--clang/unittests/Basic/VirtualFileSystemTest.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/clang/unittests/Basic/VirtualFileSystemTest.cpp b/clang/unittests/Basic/VirtualFileSystemTest.cpp
index 92e3663..0856b17 100644
--- a/clang/unittests/Basic/VirtualFileSystemTest.cpp
+++ b/clang/unittests/Basic/VirtualFileSystemTest.cpp
@@ -363,16 +363,22 @@ TEST(VirtualFileSystemTest, BrokenSymlinkRealFSIteration) {
for (vfs::directory_iterator I = FS->dir_begin(Twine(TestDirectory), EC), E;
I != E; I.increment(EC)) {
// Skip broken symlinks.
- if (EC == std::errc::no_such_file_or_directory) {
- EC = std::error_code();
+ auto EC2 = std::make_error_code(std::errc::no_such_file_or_directory);
+ if (EC == EC2) {
+ EC.clear();
continue;
}
// For bot debugging.
if (EC) {
- outs() << "std::errc::no_such_file_or_directory: "
- << (int)std::errc::no_such_file_or_directory << "\n";
- outs() << "EC: " << EC.value() << "\n";
- outs() << "EC message: " << EC.message() << "\n";
+ outs() << "Error code found:\n"
+ << "EC value: " << EC.value() << "\n"
+ << "EC category: " << EC.category().name()
+ << "EC message: " << EC.message() << "\n";
+
+ outs() << "Error code tested for:\n"
+ << "EC value: " << EC2.value() << "\n"
+ << "EC category: " << EC2.category().name()
+ << "EC message: " << EC2.message() << "\n";
}
ASSERT_FALSE(EC);
EXPECT_TRUE(I->getName() == _b);
@@ -441,16 +447,22 @@ TEST(VirtualFileSystemTest, BrokenSymlinkRealFSRecursiveIteration) {
for (vfs::recursive_directory_iterator I(*FS, Twine(TestDirectory), EC), E;
I != E; I.increment(EC)) {
// Skip broken symlinks.
- if (EC == std::errc::no_such_file_or_directory) {
- EC = std::error_code();
+ auto EC2 = std::make_error_code(std::errc::no_such_file_or_directory);
+ if (EC == EC2) {
+ EC.clear();
continue;
}
// For bot debugging.
if (EC) {
- outs() << "std::errc::no_such_file_or_directory: "
- << (int)std::errc::no_such_file_or_directory << "\n";
- outs() << "EC: " << EC.value() << "\n";
- outs() << "EC message: " << EC.message() << "\n";
+ outs() << "Error code found:\n"
+ << "EC value: " << EC.value() << "\n"
+ << "EC category: " << EC.category().name()
+ << "EC message: " << EC.message() << "\n";
+
+ outs() << "Error code tested for:\n"
+ << "EC value: " << EC2.value() << "\n"
+ << "EC category: " << EC2.category().name()
+ << "EC message: " << EC2.message() << "\n";
}
ASSERT_FALSE(EC);
Contents.push_back(I->getName());