From 9eef60d9601f1d9dbb9c8332e376ed69560339a8 Mon Sep 17 00:00:00 2001 From: Siddharth Agarwal Date: Wed, 25 Jul 2012 00:29:46 +0530 Subject: [PATCH] Bug 770141 - xpcom/tests/windows/TestRegistrationOrder.cpp fails with pymake because of a design failure with command lines on Win32. Sidestep the issue by doing it in C++ instead of the shell. r=bsmedberg --HG-- extra : rebase_source : 29e9960ebce6882b56941de16be017f6ae0f97fe --- xpcom/tests/Makefile.in | 3 +-- xpcom/tests/TestRegistrationOrder.cpp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/xpcom/tests/Makefile.in b/xpcom/tests/Makefile.in index e02382c5ff9..4886e53c057 100644 --- a/xpcom/tests/Makefile.in +++ b/xpcom/tests/Makefile.in @@ -156,8 +156,7 @@ install:: $(SYSINSTALL) $(IFLAGS1) $(srcdir)/test.properties $(DESTDIR)$(mozappdir)/res ifeq (,$(filter-out WINNT os2-emx, $(HOST_OS_ARCH))) -swapslashes = $(shell echo $(1) | sed -e 's|/|\\|g') -getnativepath = $(call swapslashes,$(call normalizepath,$(1))) +getnativepath = $(call normalizepath,$(1)) else getnativepath = $(1) endif diff --git a/xpcom/tests/TestRegistrationOrder.cpp b/xpcom/tests/TestRegistrationOrder.cpp index 8bf713d8dcd..8e6f734704b 100644 --- a/xpcom/tests/TestRegistrationOrder.cpp +++ b/xpcom/tests/TestRegistrationOrder.cpp @@ -156,8 +156,19 @@ int main(int argc, char** argv) } ScopedLogging logging; - + +#ifdef XP_WIN + // On Windows, convert to backslashes + size_t regPathLen = strlen(argv[1]); + char* regPath = new char[regPathLen]; + for (int i = 0; i < regPathLen; i++) { + char curr = argv[1][i]; + regPath[i] = (curr == '/') ? '\\' : curr; + } +#else const char *regPath = argv[1]; +#endif + XRE_AddManifestLocation(NS_COMPONENT_LOCATION, nsCOMPtr(GetRegDirectory(regPath, "core", "component.manifest"))); XRE_AddManifestLocation(NS_COMPONENT_LOCATION,