diff options
Diffstat (limited to 'src/tests/StringUtiltest.cc')
-rw-r--r-- | src/tests/StringUtiltest.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/tests/StringUtiltest.cc b/src/tests/StringUtiltest.cc index 05bfde9..220949e 100644 --- a/src/tests/StringUtiltest.cc +++ b/src/tests/StringUtiltest.cc | |||
@@ -43,11 +43,16 @@ void testStringtok() { | |||
43 | void testExpandFilename() { | 43 | void testExpandFilename() { |
44 | string filename(StringUtil::expandFilename("~/filename/~filename2/file3~/file4")); | 44 | string filename(StringUtil::expandFilename("~/filename/~filename2/file3~/file4")); |
45 | cerr<<"test "; | 45 | cerr<<"test "; |
46 | string test = string(getenv("HOME"))+"/filename/~filename2/file3~/file4"; | 46 | const char* home = getenv("HOME"); |
47 | if (test == filename) | 47 | if (home) { |
48 | cerr<<"ok."; | 48 | string test = string(home)+"/filename/~filename2/file3~/file4"; |
49 | else | 49 | if (test == filename) |
50 | cerr<<"faild"; | 50 | cerr<<"ok."; |
51 | else | ||
52 | cerr<<"failed"; | ||
53 | } else { | ||
54 | cerr << "failed, can't get $HOME."; | ||
55 | } | ||
51 | cerr<<endl; | 56 | cerr<<endl; |
52 | } | 57 | } |
53 | 58 | ||