[llvm-commits] [llvm] r122885 - /llvm/trunk/unittests/Support/Path.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Wed Jan 5 08:39:46 PST 2011
Author: mspencer
Date: Wed Jan 5 10:39:46 2011
New Revision: 122885
URL: http://llvm.org/viewvc/llvm-project?rev=122885&view=rev
Log:
UnitTests/Path: Fix typo, add error number, and enable the directory cleanup code.
Modified:
llvm/trunk/unittests/Support/Path.cpp
Modified: llvm/trunk/unittests/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/Path.cpp?rev=122885&r1=122884&r2=122885&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/Path.cpp (original)
+++ llvm/trunk/unittests/Support/Path.cpp Wed Jan 5 10:39:46 2011
@@ -19,9 +19,10 @@
#define ASSERT_NO_ERROR(x) \
if (error_code ec = x) { \
SmallString<128> Message; \
- GTEST_FATAL_FAILURE_((Twine(#x) + ": did not return errc::success.\n" + \
+ GTEST_FATAL_FAILURE_((Twine(#x ": did not return errc::success.\n") + \
+ "error number: " + Twine(ec.value()) + "\n" + \
"error message: " + \
- x.message()).toNullTerminatedStringRef(Message).data()); \
+ ec.message()).toNullTerminatedStringRef(Message).data()); \
} else {}
namespace {
@@ -132,16 +133,20 @@
SmallString<128> TestDirectory;
virtual void SetUp() {
- /*int fd;
+ int fd;
ASSERT_NO_ERROR(
- fs::unique_file("%%-%%-%%-%%/test-directory.anchor", fd, TestDirectory));
+ fs::unique_file("file-system-test-%%-%%-%%-%%/test-directory.anchor", fd,
+ TestDirectory));
// We don't care about this specific file.
- ::close(fd);*/
+ ::close(fd);
+ TestDirectory = path::parent_path(TestDirectory);
+ errs() << "Test Directory: " << TestDirectory << '\n';
+ errs().flush();
}
virtual void TearDown() {
- /*uint32_t removed;
- ASSERT_NO_ERROR(fs::remove_all(TestDirectory.str(), removed));*/
+ uint32_t removed;
+ ASSERT_NO_ERROR(fs::remove_all(TestDirectory.str(), removed));
}
};
More information about the llvm-commits
mailing list