mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 04:17:55 +01:00
remove POCO_WIN32_UTF8
This commit is contained in:
@@ -29,11 +29,7 @@ FileStreamTest::~FileStreamTest()
|
||||
|
||||
void FileStreamTest::testRead()
|
||||
{
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_WIN32_UTF8)
|
||||
char tmp[]={'\xc4', '\xd6', '\xdc', '\xe4', '\xf6', '\xfc', '\0'};
|
||||
std::string file(tmp);
|
||||
file.append(".txt");
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
char tmp[]={'\xc3', '\x84', '\xc3', '\x96', '\xc3', '\x9c', '\xc3', '\xa4', '\xc3', '\xb6', '\xc3', '\xbc', '\0'};
|
||||
std::string file(tmp);
|
||||
file.append(".txt");
|
||||
@@ -57,11 +53,7 @@ void FileStreamTest::testRead()
|
||||
|
||||
void FileStreamTest::testWrite()
|
||||
{
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_WIN32_UTF8)
|
||||
char tmp[]={'\xdf', '\xc4', '\xd6', '\xdc', '\xe4', '\xf6', '\xfc', '\0'};
|
||||
std::string file(tmp);
|
||||
file = "dummy_" + file + (".txt");
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
char tmp[]={'\xc3', '\x9f', '\xc3', '\x84', '\xc3', '\x96', '\xc3', '\x9c', '\xc3', '\xa4', '\xc3', '\xb6', '\xc3', '\xbc', '\0'};
|
||||
std::string file(tmp);
|
||||
file = "dummy_" + file + ".txt";
|
||||
@@ -86,15 +78,9 @@ void FileStreamTest::testWrite()
|
||||
|
||||
void FileStreamTest::testReadWrite()
|
||||
{
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_WIN32_UTF8)
|
||||
char tmp[]={'\xdf', '\xc4', '\xd6', '\xdc', '\xe4', '\xf6', '\xfc', '\0'};
|
||||
std::string file(tmp);
|
||||
file = "dummy_" + file + (".txt");
|
||||
#else
|
||||
char tmp[]={'\xc3', '\x9f', '\xc3', '\x84', '\xc3', '\x96', '\xc3', '\x9c', '\xc3', '\xa4', '\xc3', '\xb6', '\xc3', '\xbc', '\0'};
|
||||
std::string file(tmp);
|
||||
file = "dummy_" + file + ".txt";
|
||||
#endif
|
||||
|
||||
Poco::TemporaryFile::registerForDeletion(file);
|
||||
|
||||
@@ -122,9 +108,9 @@ void FileStreamTest::testOpenModeIn()
|
||||
Poco::File f("nonexistent.txt");
|
||||
if (f.exists())
|
||||
f.remove();
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
{
|
||||
Poco::FileInputStream istr("nonexistent.txt");
|
||||
fail("nonexistent file - must throw");
|
||||
}
|
||||
@@ -143,20 +129,20 @@ void FileStreamTest::testOpenModeOut()
|
||||
Poco::File f("test.txt");
|
||||
if (f.exists())
|
||||
f.remove();
|
||||
|
||||
|
||||
Poco::FileOutputStream ostr1("test.txt");
|
||||
ostr1 << "Hello, world!";
|
||||
ostr1.close();
|
||||
|
||||
assertTrue (f.exists());
|
||||
assertTrue (f.getSize() != 0);
|
||||
|
||||
|
||||
Poco::FileStream str1("test.txt");
|
||||
str1.close();
|
||||
|
||||
assertTrue (f.exists());
|
||||
assertTrue (f.getSize() != 0);
|
||||
|
||||
|
||||
Poco::FileOutputStream ostr2("test.txt");
|
||||
ostr2.close();
|
||||
|
||||
@@ -172,14 +158,14 @@ void FileStreamTest::testOpenModeTrunc()
|
||||
Poco::File f("test.txt");
|
||||
if (f.exists())
|
||||
f.remove();
|
||||
|
||||
|
||||
Poco::FileOutputStream ostr1("test.txt");
|
||||
ostr1 << "Hello, world!";
|
||||
ostr1.close();
|
||||
|
||||
assertTrue (f.exists());
|
||||
assertTrue (f.getSize() != 0);
|
||||
|
||||
|
||||
Poco::FileStream str1("test.txt", std::ios::trunc);
|
||||
str1.close();
|
||||
|
||||
@@ -195,16 +181,16 @@ void FileStreamTest::testOpenModeAte()
|
||||
Poco::FileOutputStream ostr("test.txt");
|
||||
ostr << "0123456789";
|
||||
ostr.close();
|
||||
|
||||
|
||||
Poco::FileStream str1("test.txt", std::ios::ate);
|
||||
int c = str1.get();
|
||||
assertTrue (str1.eof());
|
||||
|
||||
|
||||
str1.clear();
|
||||
str1.seekg(0);
|
||||
c = str1.get();
|
||||
assertTrue (c == '0');
|
||||
|
||||
|
||||
str1.close();
|
||||
|
||||
Poco::FileStream str2("test.txt", std::ios::ate);
|
||||
@@ -222,15 +208,15 @@ void FileStreamTest::testOpenModeApp()
|
||||
Poco::FileOutputStream ostr("test.txt");
|
||||
ostr << "0123456789";
|
||||
ostr.close();
|
||||
|
||||
|
||||
Poco::FileStream str1("test.txt", std::ios::app);
|
||||
|
||||
str1 << "abc";
|
||||
|
||||
|
||||
str1.seekp(0);
|
||||
|
||||
|
||||
str1 << "def";
|
||||
|
||||
|
||||
str1.close();
|
||||
|
||||
Poco::FileInputStream istr("test.txt");
|
||||
@@ -245,35 +231,35 @@ void FileStreamTest::testSeek()
|
||||
{
|
||||
Poco::FileStream str("test.txt", std::ios::trunc);
|
||||
str << "0123456789abcdef";
|
||||
|
||||
|
||||
str.seekg(0);
|
||||
int c = str.get();
|
||||
assertTrue (c == '0');
|
||||
|
||||
|
||||
str.seekg(10);
|
||||
assertTrue (str.tellg() == std::streampos(10));
|
||||
c = str.get();
|
||||
assertTrue (c == 'a');
|
||||
assertTrue (str.tellg() == std::streampos(11));
|
||||
|
||||
|
||||
str.seekg(-1, std::ios::end);
|
||||
assertTrue (str.tellg() == std::streampos(15));
|
||||
c = str.get();
|
||||
assertTrue (c == 'f');
|
||||
assertTrue (str.tellg() == std::streampos(16));
|
||||
|
||||
|
||||
str.seekg(-1, std::ios::cur);
|
||||
assertTrue (str.tellg() == std::streampos(15));
|
||||
c = str.get();
|
||||
assertTrue (c == 'f');
|
||||
assertTrue (str.tellg() == std::streampos(16));
|
||||
|
||||
|
||||
str.seekg(-4, std::ios::cur);
|
||||
assertTrue (str.tellg() == std::streampos(12));
|
||||
c = str.get();
|
||||
assertTrue (c == 'c');
|
||||
assertTrue (str.tellg() == std::streampos(13));
|
||||
|
||||
|
||||
str.seekg(1, std::ios::cur);
|
||||
assertTrue (str.tellg() == std::streampos(14));
|
||||
c = str.get();
|
||||
@@ -289,7 +275,7 @@ void FileStreamTest::testMultiOpen()
|
||||
str << "abcdefghij\n";
|
||||
str << "klmnopqrst\n";
|
||||
str.close();
|
||||
|
||||
|
||||
std::string s;
|
||||
str.open("test.txt", std::ios::in);
|
||||
std::getline(str, s);
|
||||
@@ -299,7 +285,7 @@ void FileStreamTest::testMultiOpen()
|
||||
str.open("test.txt", std::ios::in);
|
||||
std::getline(str, s);
|
||||
assertTrue (s == "0123456789");
|
||||
str.close();
|
||||
str.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ void FileTest::testCopy()
|
||||
f1.setWriteable().remove();
|
||||
}
|
||||
|
||||
void FileTest::testCopyFailIfDestinationFileExists()
|
||||
void FileTest::testCopyFailIfDestinationFileExists()
|
||||
{
|
||||
std::ofstream ostr("testfile.dat");
|
||||
ostr << "Hello, world!" << std::endl;
|
||||
@@ -499,7 +499,7 @@ void FileTest::testCopyDirectory()
|
||||
fd3.remove(true);
|
||||
}
|
||||
|
||||
void FileTest::testCopyDirectoryFailIfExists()
|
||||
void FileTest::testCopyDirectoryFailIfExists()
|
||||
{
|
||||
Path pd1("testdir");
|
||||
File fd1(pd1);
|
||||
@@ -516,7 +516,7 @@ void FileTest::testCopyDirectoryFailIfExists()
|
||||
std::ofstream ostr2(pf2.toString().c_str());
|
||||
ostr2 << "Hello, world!" << std::endl;
|
||||
ostr2.close();
|
||||
|
||||
|
||||
Path pd2("destination");
|
||||
File fd2(pd2);
|
||||
try {
|
||||
@@ -584,7 +584,7 @@ void FileTest::testRenameFailIfExists() {
|
||||
|
||||
void FileTest::testLongPath()
|
||||
{
|
||||
#if defined(_WIN32) && defined(POCO_WIN32_UTF8) && !defined(_WIN32_WCE)
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE)
|
||||
Poco::Path p("longpathtest");
|
||||
p.makeAbsolute();
|
||||
std::string longpath(p.toString());
|
||||
@@ -601,7 +601,7 @@ void FileTest::testLongPath()
|
||||
assertTrue (d.isDirectory());
|
||||
|
||||
Poco::File f(p.toString());
|
||||
f.remove(true);
|
||||
f.remove(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -17,16 +17,16 @@
|
||||
#include "Poco/Environment.h"
|
||||
#include <iostream>
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#if defined(_WIN32_WCE)
|
||||
#include "Poco/Path_WINCE.h"
|
||||
#else
|
||||
#include "Poco/Path_WIN32U.h"
|
||||
#endif
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#include "Poco/Path_WIN32.h"
|
||||
#endif
|
||||
|
||||
|
||||
using Poco::Path;
|
||||
using Poco::PathSyntaxException;
|
||||
using Poco::Environment;
|
||||
@@ -98,7 +98,7 @@ void PathTest::testParseUnix1()
|
||||
assertTrue (!p.isDirectory());
|
||||
assertTrue (p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_UNIX) == "usr");
|
||||
|
||||
|
||||
p.parse("/usr/local", Path::PATH_UNIX);
|
||||
assertTrue (!p.isRelative());
|
||||
assertTrue (p.isAbsolute());
|
||||
@@ -214,7 +214,7 @@ void PathTest::testParseUnix3()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_UNIX) == "/usr/local/bin/");
|
||||
|
||||
|
||||
p.parse("/usr/local/./bin/", Path::PATH_UNIX);
|
||||
assertTrue (!p.isRelative());
|
||||
assertTrue (p.isAbsolute());
|
||||
@@ -345,7 +345,7 @@ void PathTest::testParseUnix4()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_UNIX) == "../lib/");
|
||||
|
||||
|
||||
p.parse("a/b/c/d", Path::PATH_UNIX);
|
||||
assertTrue (p.isRelative());
|
||||
assertTrue (!p.isAbsolute());
|
||||
@@ -371,7 +371,7 @@ void PathTest::testParseUnix5()
|
||||
assertTrue (p[1] == "system32");
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_UNIX) == "/c:/windows/system32/");
|
||||
assertTrue (p.toString(Path::PATH_UNIX) == "/c:/windows/system32/");
|
||||
}
|
||||
|
||||
|
||||
@@ -467,7 +467,7 @@ void PathTest::testParseWindows2()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "usr\\");
|
||||
|
||||
|
||||
p.parse("/usr/local", Path::PATH_WINDOWS);
|
||||
assertTrue (!p.isRelative());
|
||||
assertTrue (p.isAbsolute());
|
||||
@@ -574,7 +574,7 @@ void PathTest::testParseWindows2()
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "\\usr\\local\\bin\\");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void PathTest::testParseWindows3()
|
||||
{
|
||||
Path p;
|
||||
@@ -739,7 +739,7 @@ void PathTest::testParseWindows4()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "\\\\server\\files\\");
|
||||
|
||||
|
||||
p.parse("\\\\server\\files\\file", Path::PATH_WINDOWS);
|
||||
assertTrue (!p.isRelative());
|
||||
assertTrue (p.isAbsolute());
|
||||
@@ -770,7 +770,7 @@ void PathTest::testParseWindows4()
|
||||
assertTrue (p.getNode() == "server");
|
||||
assertTrue (!p.isDirectory());
|
||||
assertTrue (p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "\\\\server\\files\\dir\\file");
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "\\\\server\\files\\dir\\file");
|
||||
|
||||
p.parse("\\\\server", Path::PATH_WINDOWS);
|
||||
assertTrue (!p.isRelative());
|
||||
@@ -780,7 +780,7 @@ void PathTest::testParseWindows4()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "\\\\server\\");
|
||||
|
||||
|
||||
p.parse("c:\\", Path::PATH_WINDOWS);
|
||||
assertTrue (!p.isRelative());
|
||||
assertTrue (p.isAbsolute());
|
||||
@@ -788,7 +788,7 @@ void PathTest::testParseWindows4()
|
||||
assertTrue (p.getDevice() == "c");
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "c:\\");
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "c:\\");
|
||||
|
||||
p.parse("c:\\WinNT", Path::PATH_WINDOWS);
|
||||
assertTrue (!p.isRelative());
|
||||
@@ -797,7 +797,7 @@ void PathTest::testParseWindows4()
|
||||
assertTrue (p.getDevice() == "c");
|
||||
assertTrue (!p.isDirectory());
|
||||
assertTrue (p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "c:\\WinNT");
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "c:\\WinNT");
|
||||
|
||||
p.parse("c:\\WinNT\\", Path::PATH_WINDOWS);
|
||||
assertTrue (!p.isRelative());
|
||||
@@ -808,7 +808,7 @@ void PathTest::testParseWindows4()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "c:\\WinNT\\");
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
p.parse("~:\\", Path::PATH_WINDOWS);
|
||||
@@ -817,7 +817,7 @@ void PathTest::testParseWindows4()
|
||||
catch (PathSyntaxException&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
p.parse("c:file.txt", Path::PATH_WINDOWS);
|
||||
@@ -826,7 +826,7 @@ void PathTest::testParseWindows4()
|
||||
catch (PathSyntaxException&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
p.parse("a\\b\\c\\d", Path::PATH_WINDOWS);
|
||||
assertTrue (p.isRelative());
|
||||
assertTrue (!p.isAbsolute());
|
||||
@@ -850,7 +850,7 @@ void PathTest::testParseVMS1()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_VMS) == "");
|
||||
|
||||
|
||||
p.parse("[]", Path::PATH_VMS);
|
||||
assertTrue (p.isRelative());
|
||||
assertTrue (!p.isAbsolute());
|
||||
@@ -858,7 +858,7 @@ void PathTest::testParseVMS1()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_VMS) == "");
|
||||
|
||||
|
||||
p.parse("[foo]", Path::PATH_VMS);
|
||||
assertTrue (!p.isRelative());
|
||||
assertTrue (p.isAbsolute());
|
||||
@@ -896,7 +896,7 @@ void PathTest::testParseVMS1()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_VMS) == "[.foo.bar]");
|
||||
|
||||
|
||||
p.parse("[foo.bar.foobar]", Path::PATH_VMS);
|
||||
assertTrue (!p.isRelative());
|
||||
assertTrue (p.isAbsolute());
|
||||
@@ -933,7 +933,7 @@ void PathTest::testParseVMS2()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_VMS) == "[foo.bar]");
|
||||
|
||||
|
||||
p.parse("[foo.][bar]", Path::PATH_VMS);
|
||||
assertTrue (!p.isRelative());
|
||||
assertTrue (p.isAbsolute());
|
||||
@@ -943,7 +943,7 @@ void PathTest::testParseVMS2()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_VMS) == "[foo.bar]");
|
||||
|
||||
|
||||
p.parse("[foo.bar][foo]", Path::PATH_VMS);
|
||||
assertTrue (!p.isRelative());
|
||||
assertTrue (p.isAbsolute());
|
||||
@@ -954,7 +954,7 @@ void PathTest::testParseVMS2()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_VMS) == "[foo.bar.foo]");
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
p.parse("[foo.bar][.foo]", Path::PATH_VMS);
|
||||
@@ -972,7 +972,7 @@ void PathTest::testParseVMS2()
|
||||
catch (PathSyntaxException&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
p.parse("[-]", Path::PATH_VMS);
|
||||
assertTrue (p.isRelative());
|
||||
assertTrue (!p.isAbsolute());
|
||||
@@ -1192,7 +1192,7 @@ void PathTest::testParseVMS4()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_VMS) == "node::device:[foo.bar]");
|
||||
|
||||
|
||||
p.parse("node::device:[foo.bar.][goo]", Path::PATH_VMS);
|
||||
assertTrue (!p.isRelative());
|
||||
assertTrue (p.isAbsolute());
|
||||
@@ -1205,7 +1205,7 @@ void PathTest::testParseVMS4()
|
||||
assertTrue (p.isDirectory());
|
||||
assertTrue (!p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_VMS) == "node::device:[foo.bar.goo]");
|
||||
|
||||
|
||||
p.parse("[]foo.txt", Path::PATH_VMS);
|
||||
assertTrue (p.isRelative());
|
||||
assertTrue (!p.isAbsolute());
|
||||
@@ -1333,7 +1333,7 @@ void PathTest::testParseGuess()
|
||||
assertTrue (p.getDevice() == "c");
|
||||
assertTrue (!p.isDirectory());
|
||||
assertTrue (p.isFile());
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "c:\\WinNT");
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "c:\\WinNT");
|
||||
|
||||
p.parse("foo:bar.txt;5", Path::PATH_GUESS);
|
||||
assertTrue (!p.isRelative());
|
||||
@@ -1382,12 +1382,12 @@ void PathTest::testStatics()
|
||||
assertTrue (!s.empty());
|
||||
Path p(s);
|
||||
assertTrue (p.isDirectory() && p.isAbsolute());
|
||||
|
||||
|
||||
s = Path::home();
|
||||
assertTrue (!s.empty());
|
||||
p = s;
|
||||
assertTrue (p.isDirectory() && p.isAbsolute());
|
||||
|
||||
|
||||
s = Path::temp();
|
||||
assertTrue (!s.empty());
|
||||
p = s;
|
||||
@@ -1405,17 +1405,17 @@ void PathTest::testBaseNameExt()
|
||||
assertTrue (p.getFileName() == "foo.bar");
|
||||
assertTrue (p.getBaseName() == "foo");
|
||||
assertTrue (p.getExtension() == "bar");
|
||||
|
||||
|
||||
p.setBaseName("readme");
|
||||
assertTrue (p.getFileName() == "readme.bar");
|
||||
assertTrue (p.getBaseName() == "readme");
|
||||
assertTrue (p.getExtension() == "bar");
|
||||
|
||||
|
||||
p.setExtension("txt");
|
||||
assertTrue (p.getFileName() == "readme.txt");
|
||||
assertTrue (p.getBaseName() == "readme");
|
||||
assertTrue (p.getExtension() == "txt");
|
||||
|
||||
|
||||
p.setExtension("html");
|
||||
assertTrue (p.getFileName() == "readme.html");
|
||||
assertTrue (p.getBaseName() == "readme");
|
||||
@@ -1434,7 +1434,7 @@ void PathTest::testAbsolute()
|
||||
Path rel("Poco");
|
||||
Path abs = rel.absolute(base);
|
||||
assertTrue (abs.toString(Path::PATH_WINDOWS) == "C:\\Program Files\\Poco");
|
||||
|
||||
|
||||
base.parse("/usr/local", Path::PATH_UNIX);
|
||||
rel.parse("Poco/include", Path::PATH_UNIX);
|
||||
abs = rel.absolute(base);
|
||||
@@ -1516,7 +1516,7 @@ void PathTest::testExpand()
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
std::string s = Path::expand("~/.bashrc");
|
||||
assertTrue (s == Path::expand("$HOME/.bashrc"));
|
||||
assertTrue (s == Environment::get("HOME") + "/.bashrc" ||
|
||||
assertTrue (s == Environment::get("HOME") + "/.bashrc" ||
|
||||
s == Environment::get("HOME") + "//.bashrc");
|
||||
Path p(s);
|
||||
s = Path::expand("$HOME/.bashrc");
|
||||
@@ -1565,7 +1565,7 @@ void PathTest::testFind()
|
||||
#endif
|
||||
assertTrue (found);
|
||||
assertTrue (!notfound);
|
||||
|
||||
|
||||
std::string fn = p.toString();
|
||||
assertTrue (fn.size() > 0);
|
||||
}
|
||||
@@ -1586,15 +1586,15 @@ void PathTest::testResolve()
|
||||
Path p("c:\\foo\\", Path::PATH_WINDOWS);
|
||||
p.resolve("test.dat");
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "c:\\foo\\test.dat");
|
||||
|
||||
|
||||
p.assign("c:\\foo\\", Path::PATH_WINDOWS);
|
||||
p.resolve(Path("d:\\bar.txt", Path::PATH_WINDOWS));
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "d:\\bar.txt");
|
||||
|
||||
|
||||
p.assign("c:\\foo\\bar.txt", Path::PATH_WINDOWS);
|
||||
p.resolve("foo.txt");
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "c:\\foo\\foo.txt");
|
||||
|
||||
|
||||
p.assign("c:\\foo\\bar\\", Path::PATH_WINDOWS);
|
||||
p.resolve(Path("..\\baz\\test.dat", Path::PATH_WINDOWS));
|
||||
assertTrue (p.toString(Path::PATH_WINDOWS) == "c:\\foo\\baz\\test.dat");
|
||||
|
||||
Reference in New Issue
Block a user