mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
Missing files.
git-svn-id: svn://localhost/ardour2/branches/3.0@12469 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
7eb8a33910
commit
ec362b39ad
2 changed files with 49 additions and 0 deletions
35
libs/pbd/test/filesystem_test.cc
Normal file
35
libs/pbd/test/filesystem_test.cc
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "filesystem_test.h"
|
||||
#include "pbd/filesystem.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION (FilesystemTest);
|
||||
|
||||
void
|
||||
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::sys::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::sys::path_is_within ("foo/jim/baz", "frobozz") == false);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue