Tim Mayberry
9192a2e969
This currently fails because the windows only realpath implementation in pbd/pathexpand.cc, which is called from PBD::canonical_path to resolve the path uses Glib::locale_from/to_utf8. As I demonstrated in the testOpenFileUTF8Filename test case Glib::locale_from/to_utf8 are not the correct functions to use for this use case as it converts to/from utf-8 to the locale's current character encoding. On Windows this is most often a single byte encoding such as Windows-1252 and conversion will fail if the path contains any characters that are not in system codepage.
34 lines
974 B
C++
34 lines
974 B
C++
#include <cppunit/TestFixture.h>
|
|
#include <cppunit/extensions/HelperMacros.h>
|
|
|
|
class FilesystemTest : public CppUnit::TestFixture
|
|
{
|
|
CPPUNIT_TEST_SUITE (FilesystemTest);
|
|
CPPUNIT_TEST (testPathIsWithin);
|
|
CPPUNIT_TEST (testCopyFileASCIIFilename);
|
|
CPPUNIT_TEST (testCopyFileUTF8Filename);
|
|
CPPUNIT_TEST (testOpenFileUTF8Filename);
|
|
CPPUNIT_TEST (testFindFilesMatchingPattern);
|
|
CPPUNIT_TEST (testClearDirectory);
|
|
CPPUNIT_TEST (testRemoveDirectory);
|
|
CPPUNIT_TEST (testCanonicalPathASCII);
|
|
CPPUNIT_TEST (testCanonicalPathUTF8);
|
|
CPPUNIT_TEST (testTouchFile);
|
|
CPPUNIT_TEST (testStatFile);
|
|
CPPUNIT_TEST_SUITE_END ();
|
|
|
|
public:
|
|
void testPathIsWithin ();
|
|
void testCopyFileASCIIFilename ();
|
|
void testCopyFileUTF8Filename ();
|
|
void testOpenFileUTF8Filename ();
|
|
void testFindFilesMatchingPattern ();
|
|
void testClearDirectory ();
|
|
void testRemoveDirectory ();
|
|
void testCanonicalPathASCII ();
|
|
void testCanonicalPathUTF8 ();
|
|
void testTouchFile ();
|
|
void testStatFile ();
|
|
};
|
|
|