From 0a0258edcfe7622115ab7f5418f318f6c0f1c866 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 3 Jun 2011 17:33:07 +0200 Subject: COMMON: Let Common::normalizePath normalize '..' in paths There are some unit tests to verify that this works correctly. There is a small chance that this causes regressions in weird setups. --- test/common/str.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test') diff --git a/test/common/str.h b/test/common/str.h index 0dee16a493..2c563f3132 100644 --- a/test/common/str.h +++ b/test/common/str.h @@ -284,6 +284,19 @@ class StringTestSuite : public CxxTest::TestSuite TS_ASSERT_EQUALS(Common::normalizePath("foo/./bar", '/'), "foo/bar"); TS_ASSERT_EQUALS(Common::normalizePath("foo//./bar//", '/'), "foo/bar"); TS_ASSERT_EQUALS(Common::normalizePath("foo//.bar//", '/'), "foo/.bar"); + + TS_ASSERT_EQUALS(Common::normalizePath("..", '/'), ".."); + TS_ASSERT_EQUALS(Common::normalizePath("../", '/'), ".."); + TS_ASSERT_EQUALS(Common::normalizePath("/..", '/'), "/.."); + TS_ASSERT_EQUALS(Common::normalizePath("../bar", '/'), "../bar"); + TS_ASSERT_EQUALS(Common::normalizePath("foo//../", '/'), ""); + TS_ASSERT_EQUALS(Common::normalizePath("foo/../bar", '/'), "bar"); + TS_ASSERT_EQUALS(Common::normalizePath("foo//../bar//", '/'), "bar"); + TS_ASSERT_EQUALS(Common::normalizePath("foo//..bar//", '/'), "foo/..bar"); + + TS_ASSERT_EQUALS(Common::normalizePath("foo/../../bar//", '/'), "../bar"); + TS_ASSERT_EQUALS(Common::normalizePath("../foo/../bar", '/'), "../bar"); + TS_ASSERT_EQUALS(Common::normalizePath("../../foo/bar/", '/'), "../../foo/bar"); } void test_matchString() { -- cgit v1.2.3 From afb06b51cceb96cf3ac2baae1f562c673114d108 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 6 Jun 2011 15:02:33 +0200 Subject: BACKENDS: Unify AudioCD manager instantiation --- test/module.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/module.mk b/test/module.mk index 4e5cbf62e1..bed2dff04f 100644 --- a/test/module.mk +++ b/test/module.mk @@ -6,7 +6,7 @@ ###################################################################### TESTS := $(srcdir)/test/common/*.h $(srcdir)/test/audio/*.h -TEST_LIBS := audio/libaudio.a common/libcommon.a +TEST_LIBS := backends/libbackends.a audio/libaudio.a common/libcommon.a # TEST_FLAGS := --runner=StdioPrinter --no-std --no-eh -- cgit v1.2.3 From 8db8a0b3fc597c5c57f17ff4dd940bfd7baa216e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 8 Jun 2011 14:58:53 +0200 Subject: TEST: Remove backends hack again --- test/module.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/module.mk b/test/module.mk index bed2dff04f..4e5cbf62e1 100644 --- a/test/module.mk +++ b/test/module.mk @@ -6,7 +6,7 @@ ###################################################################### TESTS := $(srcdir)/test/common/*.h $(srcdir)/test/audio/*.h -TEST_LIBS := backends/libbackends.a audio/libaudio.a common/libcommon.a +TEST_LIBS := audio/libaudio.a common/libcommon.a # TEST_FLAGS := --runner=StdioPrinter --no-std --no-eh -- cgit v1.2.3