aboutsummaryrefslogtreecommitdiff
path: root/src/tests/StringUtiltest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/StringUtiltest.cc')
-rw-r--r--src/tests/StringUtiltest.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/tests/StringUtiltest.cc b/src/tests/StringUtiltest.cc
index e5e8419..a821184 100644
--- a/src/tests/StringUtiltest.cc
+++ b/src/tests/StringUtiltest.cc
@@ -46,11 +46,16 @@ void testStringtok() {
46void testExpandFilename() { 46void testExpandFilename() {
47 string filename(StringUtil::expandFilename("~/filename/~filename2/file3~/file4")); 47 string filename(StringUtil::expandFilename("~/filename/~filename2/file3~/file4"));
48 cerr<<"test "; 48 cerr<<"test ";
49 string test = string(getenv("HOME"))+"/filename/~filename2/file3~/file4"; 49 const char* home = getenv("HOME");
50 if (test == filename) 50 if (home) {
51 cerr<<"ok."; 51 string test = string(home)+"/filename/~filename2/file3~/file4";
52 else 52 if (test == filename)
53 cerr<<"faild"; 53 cerr<<"ok.";
54 else
55 cerr<<"failed";
56 } else {
57 cerr << "failed, can't get $HOME.";
58 }
54 cerr<<endl; 59 cerr<<endl;
55} 60}
56 61