aboutsummaryrefslogtreecommitdiffstats
path: root/unittests/Support/Path.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-07 17:04:04 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-07 17:04:04 +0000
commit5029159fbe7c267c9322fc6c38064e9ab2ce91bc (patch)
treeb9250f8f63705ef6cadd62c3a3e9eeb0c1ac3546 /unittests/Support/Path.cpp
parentdc3b90617312c4bb62e56095ebcf1fb6a8153090 (diff)
downloadexternal_llvm-5029159fbe7c267c9322fc6c38064e9ab2ce91bc.zip
external_llvm-5029159fbe7c267c9322fc6c38064e9ab2ce91bc.tar.gz
external_llvm-5029159fbe7c267c9322fc6c38064e9ab2ce91bc.tar.bz2
Support/PathV2: Change most functions in the path namespace to return their work
via their return value instead of an out parameter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support/Path.cpp')
-rw-r--r--unittests/Support/Path.cpp38
1 files changed, 18 insertions, 20 deletions
diff --git a/unittests/Support/Path.cpp b/unittests/Support/Path.cpp
index 016a7cd..fb4d2bc 100644
--- a/unittests/Support/Path.cpp
+++ b/unittests/Support/Path.cpp
@@ -83,24 +83,22 @@ TEST(Support, Path) {
outs() << "]\n";
#endif
- bool bres;
- StringRef sfres;
- path::has_root_path(*i, bres);
- path::root_path(*i, sfres);
- path::has_root_name(*i, bres);
- path::root_name(*i, sfres);
- path::has_root_directory(*i, bres);
- path::root_directory(*i, sfres);
- path::has_parent_path(*i, bres);
- path::parent_path(*i, sfres);
- path::has_filename(*i, bres);
- path::filename(*i, sfres);
- path::has_stem(*i, bres);
- path::stem(*i, sfres);
- path::has_extension(*i, bres);
- path::extension(*i, sfres);
- path::is_absolute(*i, bres);
- path::is_relative(*i, bres);
+ path::has_root_path(*i);
+ path::root_path(*i);
+ path::has_root_name(*i);
+ path::root_name(*i);
+ path::has_root_directory(*i);
+ path::root_directory(*i);
+ path::has_parent_path(*i);
+ path::parent_path(*i);
+ path::has_filename(*i);
+ path::filename(*i);
+ path::has_stem(*i);
+ path::stem(*i);
+ path::has_extension(*i);
+ path::extension(*i);
+ path::is_absolute(*i);
+ path::is_relative(*i);
SmallString<16> temp_store;
temp_store = *i;
@@ -111,8 +109,8 @@ TEST(Support, Path) {
temp_store = *i;
path::replace_extension(temp_store, "ext");
StringRef filename(temp_store.begin(), temp_store.size()), stem, ext;
- path::stem(filename, stem);
- path::extension(filename, ext);
+ stem = path::stem(filename);
+ ext = path::extension(filename);
EXPECT_EQ(*(--sys::path::end(filename)), (stem + ext).str());
path::native(*i, temp_store);