mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Move three file utility functions from pbd/filesystem.h to pbd/file_utils.h
git-svn-id: svn://localhost/ardour2/branches/3.0@12863 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
6aee537109
commit
e26e59b006
9 changed files with 79 additions and 74 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "filesystem_test.h"
|
||||
#include "pbd/file_utils.h"
|
||||
#include "pbd/filesystem.h"
|
||||
|
||||
using namespace std;
|
||||
|
|
@ -13,23 +14,23 @@ FilesystemTest::testPathIsWithin ()
|
|||
system ("rm -r foo");
|
||||
PBD::sys::create_directories ("foo/bar/baz");
|
||||
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo/bar/baz", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo/bar", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo/bar", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo/bar", "foo/bar"));
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo/bar/baz", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo/bar", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo/bar", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo/bar", "foo/bar"));
|
||||
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo/bar/baz", "frobozz") == false);
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo/bar/baz", "frobozz") == false);
|
||||
|
||||
int const r = symlink ("bar", "foo/jim");
|
||||
CPPUNIT_ASSERT (r == 0);
|
||||
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo/bar/baz", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo/bar", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo/bar", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo/bar", "foo/bar"));
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo/bar/baz", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo/bar", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo/bar", "foo/bar/baz"));
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo/bar", "foo/bar"));
|
||||
|
||||
CPPUNIT_ASSERT (PBD::sys::path_is_within ("foo/jim/baz", "frobozz") == false);
|
||||
CPPUNIT_ASSERT (PBD::path_is_within ("foo/jim/baz", "frobozz") == false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue