13
0

Use test_output_directory() in pbd filesystem test

This prevents directory being created in pwd and means deletion of
directory is unnecessary
This commit is contained in:
Tim Mayberry 2014-11-29 16:53:56 +07:00
parent 61f9ca9f3c
commit aed58d6f39

View File

@ -1,5 +1,8 @@
#include "filesystem_test.h"
#include <glib.h>
#include <glib/gstdio.h>
#include <unistd.h>
#include <stdlib.h>
@ -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"));