Unit test fixes for Win32
authorEd Swartz <ed.swartz@nokia.com>
Wed, 02 Dec 2009 15:23:23 -0600
changeset 611 5d967503c150
parent 610 bfb3ab3f70f2
child 612 c43ac80c8d32
Unit test fixes for Win32
project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestBldInfView.java
project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestImageMakefileView.java
project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestMMPView2.java
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestBldInfView.java	Wed Dec 02 15:02:05 2009 -0600
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestBldInfView.java	Wed Dec 02 15:23:23 2009 -0600
@@ -22,6 +22,7 @@
 import com.nokia.carbide.cpp.epoc.engine.preprocessor.DefineFactory;
 import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine;
 import com.nokia.carbide.internal.api.cpp.epoc.engine.dom.IASTProblemNode;
+import com.nokia.cpp.internal.api.utils.core.FileUtils;
 import com.nokia.cpp.internal.api.utils.core.HostOS;
 import com.nokia.cpp.internal.api.utils.core.IMessage;
 
@@ -1526,9 +1527,12 @@
 			"\r\n" + 
 			"// End of File\r\n" ; 
 			
-		parserConfig.getFilesystem().put("../MusicPlayer/group/bld.inf", musicPlayerBldInf);
-		parserConfig.getFilesystem().put("../MusicShop/group/bld.inf", musicShopBldInf);
-		parserConfig.getFilesystem().put("../MusicVisualization/group/bld.inf", musicVisualizationBldInf);
+		String musicPlayerBldInfPath = FileUtils.createPossiblyRelativePath("../MusicPlayer/group/bld.inf").toOSString();
+		parserConfig.getFilesystem().put(musicPlayerBldInfPath, musicPlayerBldInf);
+		String musicShopBldInfPath = FileUtils.createPossiblyRelativePath("../MusicShop/group/bld.inf").toOSString();
+		parserConfig.getFilesystem().put(musicShopBldInfPath, musicShopBldInf);
+		String musicVisBldInfPath = FileUtils.createPossiblyRelativePath("../MusicVisualization/group/bld.inf").toOSString();
+		parserConfig.getFilesystem().put(musicVisBldInfPath, musicVisualizationBldInf);
 			
 		makeModel(origFile);
 		
@@ -1539,10 +1543,10 @@
 		ref.setPath(new Path("group/FMRadio.mmp"));
 		view.getMakMakeReferences().add(ref);
 		
+		assertEquals(parserConfig.getFilesystem().get(musicPlayerBldInfPath), musicPlayerBldInf);
+		assertEquals(parserConfig.getFilesystem().get(musicShopBldInfPath), musicShopBldInf);
+		assertEquals(parserConfig.getFilesystem().get(musicVisBldInfPath), musicVisualizationBldInf);
 		commitTest(view, updatedFile);
-		assertEquals(parserConfig.getFilesystem().get("../MusicPlayer/group/bld.inf"), musicPlayerBldInf);
-		assertEquals(parserConfig.getFilesystem().get("../MusicShop/group/bld.inf"), musicShopBldInf);
-		assertEquals(parserConfig.getFilesystem().get("../MusicVisualization/group/bld.inf"), musicVisualizationBldInf);
  
 	}
 	
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestImageMakefileView.java	Wed Dec 02 15:02:05 2009 -0600
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestImageMakefileView.java	Wed Dec 02 15:23:23 2009 -0600
@@ -976,7 +976,7 @@
 		IImageSource source = imageMakefileData.getMultiImageSources().get(0).getSources().get(0);
 		// important to be relative
 		IPath relBase;
-		relBase = stockRootedProjectPath.makeRelative();
+		relBase = stockRootedProjectPath.makeRelative().setDevice(null);
 		assertEquals(relBase.append("/gfx/file.svg"), source.getPath());
 	}
 	
--- a/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestMMPView2.java	Wed Dec 02 15:02:05 2009 -0600
+++ b/project/com.nokia.carbide.cpp.epoc.engine.tests/src/com/nokia/carbide/cpp/epoc/engine/tests/model/TestMMPView2.java	Wed Dec 02 15:23:23 2009 -0600
@@ -132,11 +132,11 @@
 			IMMPView view = model.createView(mmpConfig);
 			IPath[] srcPaths = view.getEffectiveSourcePaths();
 			// important to be relative
-			assertEquals(base.makeRelative().append("symbian/9.1/S60_3rd/S60Ex/Hello/src"), srcPaths[0]);
+			assertEquals(base.makeRelative().setDevice(null).append("symbian/9.1/S60_3rd/S60Ex/Hello/src"), srcPaths[0]);
 	
 			IPath src = view.getSources().get(0);
 			// important to be relative
-			assertEquals(base.makeRelative().append("symbian/9.1/S60_3rd/S60Ex/Hello/src/foo.cpp"), src);
+			assertEquals(base.makeRelative().setDevice(null).append("symbian/9.1/S60_3rd/S60Ex/Hello/src/foo.cpp"), src);
 		}
 	}
 	
@@ -1214,8 +1214,9 @@
 		} catch (InvalidDriveInMMPPathException e) {
 			view.getUserIncludes().add(e.getPathNoDevice());
 		}
+		IPath fullpath = new Path(getTokenAbsolutePath()).setDevice(null).append("temp");
 		commitTest(view,
-				"USERINCLUDE ..\\group \\temp\n");
+				"USERINCLUDE ..\\group " + toDosPath(fullpath) + "\n");
 	}
 	
 	public void testBug2817() {