r297759 - Add more debugging code for the SystemZ bot.
Juergen Ributzka via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 14 10:46:26 PDT 2017
Author: ributzka
Date: Tue Mar 14 12:46:26 2017
New Revision: 297759
URL: http://llvm.org/viewvc/llvm-project?rev=297759&view=rev
Log:
Add more debugging code for the SystemZ bot.
Modified:
cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp
Modified: cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp?rev=297759&r1=297758&r2=297759&view=diff
==============================================================================
--- cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp (original)
+++ cfe/trunk/unittests/Basic/VirtualFileSystemTest.cpp Tue Mar 14 12:46:26 2017
@@ -363,16 +363,22 @@ TEST(VirtualFileSystemTest, BrokenSymlin
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, BrokenSymlin
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());
More information about the cfe-commits
mailing list