summaryrefslogtreecommitdiff
path: root/unittests/Support
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-11-30 23:28:07 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-11-30 23:28:07 +0000
commita42cf73c779fe4210cedce0a7a0b2ada2085b55b (patch)
treeeff4e99d7db5a9672f24b36ee230abff15cce1af /unittests/Support
parent63c133b67d61b0c457ff46c957aed2b8d90b599c (diff)
downloadllvm-a42cf73c779fe4210cedce0a7a0b2ada2085b55b.tar.gz
llvm-a42cf73c779fe4210cedce0a7a0b2ada2085b55b.tar.bz2
llvm-a42cf73c779fe4210cedce0a7a0b2ada2085b55b.tar.xz
Support/PathV2: Implement reverse iteration and parent_path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120496 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support')
-rw-r--r--unittests/Support/Path.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/unittests/Support/Path.cpp b/unittests/Support/Path.cpp
index 2c7c3cba9e..b8f818ff1d 100644
--- a/unittests/Support/Path.cpp
+++ b/unittests/Support/Path.cpp
@@ -71,6 +71,15 @@ TEST(Support, Path) {
}
outs() << "]\n";
+ outs() << " Reverse Iteration: [";
+ for (sys::path::reverse_iterator ci = sys::path::rbegin(*i),
+ ce = sys::path::rend(*i);
+ ci != ce;
+ ++ci) {
+ outs() << *ci << ',';
+ }
+ outs() << "]\n";
+
StringRef res;
SmallString<16> temp_store;
if (error_code ec = sys::path::root_path(*i, res))
@@ -82,6 +91,9 @@ TEST(Support, Path) {
if (error_code ec = sys::path::root_directory(*i, res))
ASSERT_FALSE(ec.message().c_str());
outs() << " root_directory: " << res << '\n';
+ if (error_code ec = sys::path::parent_path(*i, res))
+ ASSERT_FALSE(ec.message().c_str());
+ outs() << " parent_path: " << res << '\n';
temp_store = *i;
if (error_code ec = sys::path::make_absolute(temp_store))