From c3bcb7fba7c3d3eebb003890a0a8ad40373b82a3 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Thu, 8 Nov 2012 08:51:05 +0100 Subject: [PATCH] Bug 386675 - Added a junit test for MapEntrySourceContainer --- .../tests/MapEntrySourceContainerTests.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/MapEntrySourceContainerTests.java diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/MapEntrySourceContainerTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/MapEntrySourceContainerTests.java new file mode 100644 index 00000000000..10144aa170d --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/MapEntrySourceContainerTests.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2012 Wind River Systems, Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.debug.core.tests; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +import org.eclipse.cdt.debug.internal.core.sourcelookup.MapEntrySourceContainer; +import org.eclipse.core.runtime.IPath; + +@SuppressWarnings("restriction") +public class MapEntrySourceContainerTests extends TestCase { + + public static Test suite() { + return new TestSuite(MapEntrySourceContainerTests.class); + } + + public MapEntrySourceContainerTests(String name) { + super(name); + } + + public void testUNCPath() { + String uncPath = "//server/path/on/server"; + IPath path = MapEntrySourceContainer.createPath(uncPath); + assertEquals(uncPath, path.toString()); + + uncPath = "\\\\server\\path\\on\\server"; + path = MapEntrySourceContainer.createPath(uncPath); + assertEquals(uncPath, path.toOSString()); + } +}