Browse Source

Tested FilePath::isAbsolute() under Windows.


git-svn-id: https://svn.microneil.com/svn/CodeDweller-Tests/trunk@49 b3372362-9eaa-4a85-aa2b-6faa1ab7c995
master
adeniz 9 years ago
parent
commit
323a2142dc
2 changed files with 11 additions and 5 deletions
  1. 1
    1
      TestFilesystem/buildAndRun
  2. 10
    4
      TestFilesystem/testFilesystem.cpp

+ 1
- 1
TestFilesystem/buildAndRun View File

CFLAGS='-I.. -std=c++11 -g -O0' CFLAGS='-I.. -std=c++11 -g -O0'
g++ $CFLAGS testFilesystem.cpp ../CodeDweller/filesystem.cpp -o testFilesystem
g++ $CFLAGS testFilesystem.cpp ../CodeDweller/filesystem.cpp -lShlwapi -o testFilesystem
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
exit -1 exit -1

+ 10
- 4
TestFilesystem/testFilesystem.cpp View File

RETURN_FALSE("isAbsolute() failure"); RETURN_FALSE("isAbsolute() failure");
} }
if (!CodeDweller::FilePath::isAbsolute("x:\\sll\lll")) {
if (!CodeDweller::FilePath::isAbsolute("x:\\sll\\lll")) {
RETURN_FALSE("isAbsolute() failure"); RETURN_FALSE("isAbsolute() failure");
} }
RETURN_FALSE("isAbsolute() failure"); RETURN_FALSE("isAbsolute() failure");
} }
if (!CodeDweller::FilePath::isAbsolute("\\sll\lll")) {
if (!CodeDweller::FilePath::isAbsolute("\\sll\\lll")) {
RETURN_FALSE("isAbsolute() failure"); RETURN_FALSE("isAbsolute() failure");
} }
#endif #endif
RETURN_FALSE("join() failure"); RETURN_FALSE("join() failure");
} }
#ifdef _WIN32
std::string absComponent = "\\abs";
#else
std::string absComponent = "/abs";
#endif
try { try {
(void) CodeDweller::FilePath::join({"rel", "/abs"});
(void) CodeDweller::FilePath::join({"rel", absComponent});
NO_EXCEPTION_TERM("join()"); NO_EXCEPTION_TERM("join()");
return false; return false;
try { try {
(void) CodeDweller::FilePath::join({"rel", "/abs", "otherrel"});
(void) CodeDweller::FilePath::join({"rel", absComponent, "otherrel"});
NO_EXCEPTION_TERM("join()"); NO_EXCEPTION_TERM("join()");
return false; return false;

Loading…
Cancel
Save