From ef30f6fe63e1bc91b3694206de63669a69c53079 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 30 May 2015 03:38:03 +0200 Subject: [PATCH] Fix recently added wxFileName::MakeRelativeTo() unit test for non-Unix. Don't hard code the use of slashes as path separators. --- tests/filename/filenametest.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/filename/filenametest.cpp b/tests/filename/filenametest.cpp index 6e344126cd..a69ff1dad7 100644 --- a/tests/filename/filenametest.cpp +++ b/tests/filename/filenametest.cpp @@ -445,17 +445,20 @@ void FileNameTestCase::TestNormalize() void FileNameTestCase::TestRelative() { - wxFileName fn("a/b.cpp"); + const wxString pathSep = wxFileName::GetPathSeparator(); + + wxFileName fn("a" + pathSep + "b.cpp"); fn.MakeRelativeTo("a"); CPPUNIT_ASSERT_EQUAL( "b.cpp", fn.GetFullPath() ); - fn.AssignDir("a/b"); + fn.AssignDir("a" + pathSep + "b"); fn.MakeRelativeTo("a"); - CPPUNIT_ASSERT_EQUAL( "b/", fn.GetFullPath() ); + + CPPUNIT_ASSERT_EQUAL( "b" + pathSep, fn.GetFullPath() ); fn.AssignDir("a"); fn.MakeRelativeTo("a"); - CPPUNIT_ASSERT_EQUAL( "./", fn.GetFullPath() ); + CPPUNIT_ASSERT_EQUAL( "." + pathSep, fn.GetFullPath() ); } void FileNameTestCase::TestReplace()