summaryrefslogtreecommitdiffstats
path: root/unittests/Basic
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
commite3a2454ea8263759d2ac667d3e086bb15269e10e (patch)
treebf83742221a2ca5d01c4f45572cbe2e45ba45123 /unittests/Basic
parente62853ab5b0fe8611b44de74a12bc87b6ceba5f6 (diff)
Add more debugging code for the SystemZ bot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297759 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Basic')
-rw-r--r--unittests/Basic/VirtualFileSystemTest.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/unittests/Basic/VirtualFileSystemTest.cpp b/unittests/Basic/VirtualFileSystemTest.cpp
index 92e3663f92..0856b17791 100644
--- a/unittests/Basic/VirtualFileSystemTest.cpp
+++ b/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());