From aed58d6f39f77d9d0426e86d4e6cd6b81ebadee6 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sat, 29 Nov 2014 16:53:56 +0700 Subject: [PATCH] Use test_output_directory() in pbd filesystem test This prevents directory being created in pwd and means deletion of directory is unnecessary --- libs/pbd/test/filesystem_test.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/pbd/test/filesystem_test.cc b/libs/pbd/test/filesystem_test.cc index 59475ff644..781e2bdafe 100644 --- a/libs/pbd/test/filesystem_test.cc +++ b/libs/pbd/test/filesystem_test.cc @@ -1,5 +1,8 @@ #include "filesystem_test.h" +#include +#include + #include #include @@ -19,7 +22,9 @@ void FilesystemTest::testPathIsWithin () { #ifndef PLATFORM_WINDOWS - system ("rm -r foo"); + string output_path = test_output_directory ("testPathIsWithin"); + CPPUNIT_ASSERT (g_chdir (output_path.c_str()) == 0); + CPPUNIT_ASSERT (g_mkdir_with_parents ("foo/bar/baz", 0755) == 0); CPPUNIT_ASSERT (PBD::path_is_within ("foo/bar/baz", "foo/bar/baz"));