Split test for debuggability and restrict # of contexts per SDK to 4 to improve speed
authorEd Swartz <ed.swartz@nokia.com>
Tue, 05 Jan 2010 09:42:14 -0600
changeset 739 68ec3f10b981
parent 737 952b6f67894a
child 740 ba87a4b50604
Split test for debuggability and restrict # of contexts per SDK to 4 to improve speed
core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SymbianContextTest.java
--- a/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SymbianContextTest.java	Mon Jan 04 11:11:25 2010 -0600
+++ b/core/com.nokia.carbide.cpp.sdk.core.test/src/com/nokia/carbide/cpp/sdk/core/test/SymbianContextTest.java	Tue Jan 05 09:42:14 2010 -0600
@@ -49,28 +49,39 @@
 		assertTrue(sdkList.size() > 0);
 		
 		for (ISymbianSDK sdk : sdkList) {
-			if (sdk.getName().equals("S60_5th_Edition_SDK_v1.0")) {
-				// test that we get the SDK version
-				Version sdkVer = sdk.getSDKVersion();
-				assertEquals(5,sdkVer.getMajor());
-				assertEquals(0,sdkVer.getMinor());
-				
-				// test that we get the OS version
-				Version osVer = sdk.getOSVersion();
-				assertEquals(9,osVer.getMajor());
-				assertEquals(4,osVer.getMinor());
-			}
-			
-			SymbianBuildContext context = new SymbianBuildContext(sdk, "WINSCW", "UDEB");
-			ISymbianSDK contextSDK = context.getSDK();
-			
-			assertEquals(sdk, contextSDK);
-			
-			// test that get get the macros
-			List<String> platMacros = contextSDK.getPlatformMacros("WINSCW");
-			assertTrue("WINSCW platform macros should be > 0", platMacros.size() > 0);
+			doTestSDK(sdk);
 		}
 		
 	}
+
+	/**
+	 * @param sdk
+	 */
+	private void doTestSDK(ISymbianSDK sdk) {
+		if (sdk.getName().equals("S60_5th_Edition_SDK_v1.0")) {
+			// test that we get the SDK version
+			Version sdkVer = sdk.getSDKVersion();
+			assertEquals(5,sdkVer.getMajor());
+			assertEquals(0,sdkVer.getMinor());
+			
+			// test that we get the OS version
+			Version osVer = sdk.getOSVersion();
+			assertEquals(9,osVer.getMajor());
+			assertEquals(4,osVer.getMinor());
+		}
+		
+		SymbianBuildContext context = new SymbianBuildContext(sdk, "WINSCW", "UDEB");
+		ISymbianSDK contextSDK = context.getSDK();
+		
+		assertEquals(sdk, contextSDK);
+		
+		// test that we can get the macros for valid SDKs 
+		// (if the default of 0.0, then we never fetch macros)
+		if (sdk.getOSVersion().compareTo(new Version(0, 0, 0)) > 0) {
+			List<String> platMacros = contextSDK.getPlatformMacros("WINSCW");
+			if (platMacros.size() == 0)
+				fail("WINSCW platform macros should be > 0");
+		}
+	}
 	
 }