You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2012/09/21 17:16:14 UTC

[11/11] bin/uncrustify.sh --all

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/CordovaLib/CordovaLibTests/CDVWhitelistTests.m
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLibTests/CDVWhitelistTests.m b/CordovaLib/CordovaLibTests/CDVWhitelistTests.m
index 48a45d7..cd5cca3 100644
--- a/CordovaLib/CordovaLibTests/CDVWhitelistTests.m
+++ b/CordovaLib/CordovaLibTests/CDVWhitelistTests.m
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -29,7 +29,7 @@
 - (void)setUp
 {
     [super setUp];
-    
+
     // setup code here
 }
 
@@ -40,223 +40,209 @@
     [super tearDown];
 }
 
-- (void) testAllowedSchemes
+- (void)testAllowedSchemes
 {
-    NSArray* allowedHosts = [NSArray arrayWithObjects: 
-                             @"*.apache.org",
-                             nil];
-    
+    NSArray* allowedHosts = [NSArray arrayWithObjects:
+        @"*.apache.org",
+        nil];
+
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
-    
+
     STAssertTrue([whitelist schemeIsAllowed:@"http"], nil);
     STAssertTrue([whitelist schemeIsAllowed:@"https"], nil);
     STAssertTrue([whitelist schemeIsAllowed:@"ftp"], nil);
     STAssertTrue([whitelist schemeIsAllowed:@"ftps"], nil);
     STAssertFalse([whitelist schemeIsAllowed:@"gopher"], nil);
-
 }
 
-- (void) testSubdomainWildcard
+- (void)testSubdomainWildcard
 {
-    NSArray* allowedHosts = [NSArray arrayWithObjects: 
-                     @"*.apache.org",
-                     nil];
-    
+    NSArray* allowedHosts = [NSArray arrayWithObjects:
+        @"*.apache.org",
+        nil];
+
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
-    
+
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://build.apache.org"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://sub1.sub0.build.apache.org"]], nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org.ca"]], nil);
 }
 
-- (void) testWildcardInTLD
+- (void)testWildcardInTLD
 {
     // NOTE: if the user chooses to do this (a wildcard in the TLD, not a wildcard as the TLD), we allow it because we assume they know what they are doing! We don't replace it with known TLDs
     // This might be applicable for custom TLDs on a local network DNS
-    
-    NSArray* allowedHosts = [NSArray arrayWithObjects: 
-                             @"apache.o*g",
-                             nil];
-    
+
+    NSArray* allowedHosts = [NSArray arrayWithObjects:
+        @"apache.o*g",
+        nil];
+
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
-    
+
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.ogg"]], nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.foo"]], nil);
-
 }
 
-- (void) testTLDWildcard
-{    
-    NSArray* allowedHosts = [NSArray arrayWithObjects: 
-                             @"apache.*",
-                             nil];
-    
+- (void)testTLDWildcard
+{
+    NSArray* allowedHosts = [NSArray arrayWithObjects:
+        @"apache.*",
+        nil];
+
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
-    
+
     NSString* hostname = @"apache";
-    
+
     NSArray* knownTLDs = [NSArray arrayWithObjects:
-                          @"aero", @"asia", @"arpa", @"biz", @"cat",
-                          @"com", @"coop", @"edu", @"gov", @"info",
-                          @"int", @"jobs", @"mil", @"mobi", @"museum",
-                          @"name", @"net", @"org", @"pro", @"tel",
-                          @"travel", @"xxx",
-                          nil];
-    
+        @"aero", @"asia", @"arpa", @"biz", @"cat",
+        @"com", @"coop", @"edu", @"gov", @"info",
+        @"int", @"jobs", @"mil", @"mobi", @"museum",
+        @"name", @"net", @"org", @"pro", @"tel",
+        @"travel", @"xxx",
+        nil];
+
     // 26*26 combos
-    NSMutableArray* twoCharCountryCodes = [NSMutableArray arrayWithCapacity:(26*26)];
-    for (char c0 = 'a'; c0 <= 'z'; ++c0)
-    {
-        for (char c1 = 'a'; c1 <= 'z'; ++c1)
-        {
+    NSMutableArray* twoCharCountryCodes = [NSMutableArray arrayWithCapacity:(26 * 26)];
+
+    for (char c0 = 'a'; c0 <= 'z'; ++c0) {
+        for (char c1 = 'a'; c1 <= 'z'; ++c1) {
             [twoCharCountryCodes addObject:[NSString stringWithFormat:@"%c%c", c0, c1]];
         }
     }
 
-    NSMutableArray* shouldPass = [NSMutableArray arrayWithCapacity:[knownTLDs count]+[twoCharCountryCodes count]];
+    NSMutableArray* shouldPass = [NSMutableArray arrayWithCapacity:[knownTLDs count] + [twoCharCountryCodes count]];
 
     NSEnumerator* knownTLDEnumerator = [knownTLDs objectEnumerator];
     NSString* tld = nil;
-    
-    while (tld = [knownTLDEnumerator nextObject])
-    {
+
+    while (tld = [knownTLDEnumerator nextObject]) {
         [shouldPass addObject:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@.%@", hostname, tld]]];
     }
 
     NSEnumerator* twoCharCountryCodesEnumerator = [twoCharCountryCodes objectEnumerator];
     NSString* cc = nil;
-    
-    while (cc = [twoCharCountryCodesEnumerator nextObject])
-    {
+
+    while (cc = [twoCharCountryCodesEnumerator nextObject]) {
         [shouldPass addObject:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@.%@", hostname, cc]]];
     }
-    
+
     NSEnumerator* shouldPassEnumerator = [shouldPass objectEnumerator];
     NSURL* url = nil;
 
-    while (url = [shouldPassEnumerator nextObject])
-    {
+    while (url = [shouldPassEnumerator nextObject]) {
         STAssertTrue([whitelist URLIsAllowed:url], @"Url tested :%@", [url description]);
     }
-    
+
     STAssertFalse(([whitelist URLIsAllowed:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@.%@", hostname, @"faketld"]]]), nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://unknownhostname.faketld"]], nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://unknownhostname.com"]], nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://www.apache.org"]], nil);
-
 }
 
-- (void) testCatchallWildcardOnly
-{    
-    NSArray* allowedHosts = [NSArray arrayWithObjects: 
-                             @"*",
-                             nil];
-    
+- (void)testCatchallWildcardOnly
+{
+    NSArray* allowedHosts = [NSArray arrayWithObjects:
+        @"*",
+        nil];
+
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
-    
+
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://build.apache.prg"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://MyDangerousSite.org"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org.SuspiciousSite.com"]], nil);
-
 }
 
-- (void) testWildcardInHostname
-{    
-    NSArray* allowedHosts = [NSArray arrayWithObjects: 
-                             @"www.*apac*he.org",
-                             nil];
-    
+- (void)testWildcardInHostname
+{
+    NSArray* allowedHosts = [NSArray arrayWithObjects:
+        @"www.*apac*he.org",
+        nil];
+
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
-        
+
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://www.apache.org"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://www.apacMAChe.org"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://www.MACapache.org"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://www.MACapacMAChe.org"]], nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]], nil);
-
 }
 
-- (void) testExactMatch
-{    
-    NSArray* allowedHosts = [NSArray arrayWithObjects: 
-                             @"www.apache.org",
-                             nil];
-    
+- (void)testExactMatch
+{
+    NSArray* allowedHosts = [NSArray arrayWithObjects:
+        @"www.apache.org",
+        nil];
+
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
-    
+
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://www.apache.org"]], nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://build.apache.org"]], nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]], nil);
-
 }
 
-- (void) testWildcardMix
-{    
-    NSArray* allowedHosts = [NSArray arrayWithObjects: 
-                             @"*.apac*he.*",
-                             nil];
-    
+- (void)testWildcardMix
+{
+    NSArray* allowedHosts = [NSArray arrayWithObjects:
+        @"*.apac*he.*",
+        nil];
+
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
-    
+
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://www.apache.org"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apacMAChe.ca"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apacMAChe.museum"]], nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://blahMAChe.museum"]], nil);
-
 }
 
-- (void) testIpExactMatch
-{    
-    NSArray* allowedHosts = [NSArray arrayWithObjects: 
-                             @"192.168.1.1",
-                             @"192.168.2.1",
-                             nil];
-    
+- (void)testIpExactMatch
+{
+    NSArray* allowedHosts = [NSArray arrayWithObjects:
+        @"192.168.1.1",
+        @"192.168.2.1",
+        nil];
+
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
-    
+
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.1.1"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.2.1"]], nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.3.1"]], nil);
-
 }
 
-- (void) testIpWildcardMatch
-{    
-    NSArray* allowedHosts = [NSArray arrayWithObjects: 
-                             @"192.168.1.*",
-                             @"192.168.2.*",
-                             nil];
-    
+- (void)testIpWildcardMatch
+{
+    NSArray* allowedHosts = [NSArray arrayWithObjects:
+        @"192.168.1.*",
+        @"192.168.2.*",
+        nil];
+
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
-    
+
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.1.1"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.1.2"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.2.1"]], nil);
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.2.2"]], nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.3.1"]], nil);
-
 }
 
-- (void) testHostnameExtraction
-{    
-    NSArray* allowedHosts = [NSArray arrayWithObjects: 
-                             @"http://apache.org/",
-                             @"http://apache.org/foo/bar?x=y",
-                             @"ftp://apache.org/foo/bar?x=y",
-                             @"ftps://apache.org/foo/bar?x=y",
-                             @"http://apache.*/foo/bar?x=y",
-                             nil];
-    
+- (void)testHostnameExtraction
+{
+    NSArray* allowedHosts = [NSArray arrayWithObjects:
+        @"http://apache.org/",
+        @"http://apache.org/foo/bar?x=y",
+        @"ftp://apache.org/foo/bar?x=y",
+        @"ftps://apache.org/foo/bar?x=y",
+        @"http://apache.*/foo/bar?x=y",
+        nil];
+
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
-    
+
     STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]], nil);
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://google.com"]], nil);
 }
 
-
 @end

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/bin/templates/project/__TESTING__/Classes/AppDelegate.h
----------------------------------------------------------------------
diff --git a/bin/templates/project/__TESTING__/Classes/AppDelegate.h b/bin/templates/project/__TESTING__/Classes/AppDelegate.h
index d50a071..d0024ee 100644
--- a/bin/templates/project/__TESTING__/Classes/AppDelegate.h
+++ b/bin/templates/project/__TESTING__/Classes/AppDelegate.h
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -29,17 +29,14 @@
 
 #import <Cordova/CDVViewController.h>
 
-@interface AppDelegate : NSObject < UIApplicationDelegate > {
+@interface AppDelegate : NSObject <UIApplicationDelegate>{}
 
-}
-
-// invoke string is passed to your app on launch, this is only valid if you 
+// invoke string is passed to your app on launch, this is only valid if you
 // edit __TESTING__-Info.plist to add a protocol
-// a simple tutorial can be found here : 
+// a simple tutorial can be found here :
 // http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
 
 @property (nonatomic, strong) IBOutlet UIWindow* window;
 @property (nonatomic, strong) IBOutlet CDVViewController* viewController;
 
 @end
-

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/bin/templates/project/__TESTING__/Classes/AppDelegate.m
----------------------------------------------------------------------
diff --git a/bin/templates/project/__TESTING__/Classes/AppDelegate.m b/bin/templates/project/__TESTING__/Classes/AppDelegate.m
index a6d5db1..f188074 100644
--- a/bin/templates/project/__TESTING__/Classes/AppDelegate.m
+++ b/bin/templates/project/__TESTING__/Classes/AppDelegate.m
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -30,19 +30,19 @@
 
 #import <Cordova/CDVPlugin.h>
 
-
 @implementation AppDelegate
 
 @synthesize window, viewController;
 
-- (id) init
-{	
-	/** If you need to do any extra app-specific initialization, you can do it here
-	 *  -jm
-	 **/
-    NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; 
+- (id)init
+{
+    /** If you need to do any extra app-specific initialization, you can do it here
+     *  -jm
+     **/
+    NSHTTPCookieStorage* cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
+
     [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
-        
+
     self = [super init];
     return self;
 }
@@ -52,20 +52,20 @@
 /**
  * This is main kick off after the app inits, the views and Settings are setup here. (preferred - iOS4 and up)
  */
-- (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
-{    
+- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
+{
     NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
     NSString* invokeString = nil;
-    
+
     if (url && [url isKindOfClass:[NSURL class]]) {
         invokeString = [url absoluteString];
-		NSLog(@"__TESTING__ launchOptions = %@", url);
-    }    
-    
+        NSLog(@"__TESTING__ launchOptions = %@", url);
+    }
+
     CGRect screenBounds = [[UIScreen mainScreen] bounds];
     self.window = [[UIWindow alloc] initWithFrame:screenBounds];
     self.window.autoresizesSubviews = YES;
-    
+
     self.viewController = [[MainViewController alloc] init];
     self.viewController.useSplashScreen = YES;
     self.viewController.wwwFolderName = @"www";
@@ -73,65 +73,67 @@
     self.viewController.invokeString = invokeString;
 
     // NOTE: To control the view's frame size, override [self.viewController viewWillAppear:] in your view controller.
-    
+
     // check whether the current orientation is supported: if it is, keep it, rather than forcing a rotation
     BOOL forceStartupRotation = YES;
     UIDeviceOrientation curDevOrientation = [[UIDevice currentDevice] orientation];
-    
+
     if (UIDeviceOrientationUnknown == curDevOrientation) {
         // UIDevice isn't firing orientation notifications yet… go look at the status bar
         curDevOrientation = (UIDeviceOrientation)[[UIApplication sharedApplication] statusBarOrientation];
     }
-    
+
     if (UIDeviceOrientationIsValidInterfaceOrientation(curDevOrientation)) {
         if ([self.viewController supportsOrientation:curDevOrientation]) {
             forceStartupRotation = NO;
-        } 
-    } 
-    
+        }
+    }
+
     if (forceStartupRotation) {
         UIInterfaceOrientation newOrient;
-        if ([self.viewController supportsOrientation:UIInterfaceOrientationPortrait])
+        if ([self.viewController supportsOrientation:UIInterfaceOrientationPortrait]) {
             newOrient = UIInterfaceOrientationPortrait;
-        else if ([self.viewController supportsOrientation:UIInterfaceOrientationLandscapeLeft])
+        } else if ([self.viewController supportsOrientation:UIInterfaceOrientationLandscapeLeft]) {
             newOrient = UIInterfaceOrientationLandscapeLeft;
-        else if ([self.viewController supportsOrientation:UIInterfaceOrientationLandscapeRight])
+        } else if ([self.viewController supportsOrientation:UIInterfaceOrientationLandscapeRight]) {
             newOrient = UIInterfaceOrientationLandscapeRight;
-        else
+        } else {
             newOrient = UIInterfaceOrientationPortraitUpsideDown;
+        }
 
         NSLog(@"AppDelegate forcing status bar to: %d from: %d", newOrient, curDevOrientation);
         [[UIApplication sharedApplication] setStatusBarOrientation:newOrient];
     }
-    
+
     self.window.rootViewController = self.viewController;
     [self.window makeKeyAndVisible];
-    
+
     return YES;
 }
 
 // this happens while we are running ( in the background, or from within our own app )
 // only valid if __TESTING__-Info.plist specifies a protocol to handle
-- (BOOL) application:(UIApplication*)application handleOpenURL:(NSURL*)url 
+- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url
 {
-    if (!url) { 
-        return NO; 
+    if (!url) {
+        return NO;
     }
-    
-	// calls into javascript global function 'handleOpenURL'
+
+    // calls into javascript global function 'handleOpenURL'
     NSString* jsString = [NSString stringWithFormat:@"handleOpenURL(\"%@\");", url];
     [self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];
-    
-    // all plugins will get the notification, and their handlers will be called 
+
+    // all plugins will get the notification, and their handlers will be called
     [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
-    
-    return YES;    
+
+    return YES;
 }
 
-- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
-{    
+- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
+{
     // IPhone doesn't support upside down by default, while the IPad does.  Override to allow all orientations always, and let the root view controller decide whats allowed (the supported orientations mask gets intersected).
     NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown);
+
     return supportedInterfaceOrientations;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/bin/templates/project/__TESTING__/Classes/MainViewController.h
----------------------------------------------------------------------
diff --git a/bin/templates/project/__TESTING__/Classes/MainViewController.h b/bin/templates/project/__TESTING__/Classes/MainViewController.h
index ea5ea36..a821b06 100644
--- a/bin/templates/project/__TESTING__/Classes/MainViewController.h
+++ b/bin/templates/project/__TESTING__/Classes/MainViewController.h
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/bin/templates/project/__TESTING__/Classes/MainViewController.m
----------------------------------------------------------------------
diff --git a/bin/templates/project/__TESTING__/Classes/MainViewController.m b/bin/templates/project/__TESTING__/Classes/MainViewController.m
index 91c8753..ce10a2d 100644
--- a/bin/templates/project/__TESTING__/Classes/MainViewController.m
+++ b/bin/templates/project/__TESTING__/Classes/MainViewController.m
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -29,7 +29,7 @@
 
 @implementation MainViewController
 
-- (id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+- (id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
 {
     self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
     if (self) {
@@ -38,11 +38,11 @@
     return self;
 }
 
-- (void) didReceiveMemoryWarning
+- (void)didReceiveMemoryWarning
 {
     // Releases the view if it doesn't have a superview.
     [super didReceiveMemoryWarning];
-    
+
     // Release any cached data, images, etc that aren't in use.
 }
 
@@ -53,8 +53,9 @@
     // Set the main view to utilize the entire application frame space of the device.
     // Change this to suit your view's UI footprint needs in your application.
 
-    UIView* rootView =[[[[UIApplication sharedApplication] keyWindow] rootViewController] view];
+    UIView* rootView = [[[[UIApplication sharedApplication] keyWindow] rootViewController] view];
     CGRect webViewFrame = [[[rootView subviews] objectAtIndex:0] frame];  // first subview is the UIWebView
+
     if (CGRectEqualToRect(webViewFrame, CGRectZero)) { // UIWebView is sized according to its parent, here it hasn't been sized yet
         self.view.frame = [[UIScreen mainScreen] applicationFrame]; // size UIWebView's parent according to application frame, which will in turn resize the UIWebView
     }
@@ -62,26 +63,27 @@
     [super viewWillAppear:animated];
 }
 
-- (void) viewDidLoad
+- (void)viewDidLoad
 {
     [super viewDidLoad];
     // Do any additional setup after loading the view from its nib.
 }
 
-- (void) viewDidUnload
+- (void)viewDidUnload
 {
     [super viewDidUnload];
     // Release any retained subviews of the main view.
     // e.g. self.myOutlet = nil;
 }
 
-- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
 {
     // Return YES for supported orientations
     return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
 }
 
 /* Comment out the block below to over-ride */
+
 /*
 - (CDVCordovaView*) newCordovaViewWithFrame:(CGRect)bounds
 {
@@ -90,24 +92,25 @@
 */
 
 /* Comment out the block below to over-ride */
+
 /*
 #pragma CDVCommandDelegate implementation
 
 - (id) getCommandInstance:(NSString*)className
 {
-	return [super getCommandInstance:className];
+    return [super getCommandInstance:className];
 }
 
 - (BOOL) execute:(CDVInvokedUrlCommand*)command
 {
-	return [super execute:command];
+    return [super execute:command];
 }
 
 - (NSString*) pathForResource:(NSString*)resourcepath;
 {
-	return [super pathForResource:resourcepath];
+    return [super pathForResource:resourcepath];
 }
- 
+
 - (void) registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className
 {
     return [super registerPlugin:plugin withClassName:className];
@@ -116,39 +119,39 @@
 
 #pragma UIWebDelegate implementation
 
-- (void) webViewDidFinishLoad:(UIWebView*) theWebView 
+- (void)webViewDidFinishLoad:(UIWebView*)theWebView
 {
-     // only valid if ___PROJECTNAME__-Info.plist specifies a protocol to handle
-     if (self.invokeString)
-     {
+    // only valid if ___PROJECTNAME__-Info.plist specifies a protocol to handle
+    if (self.invokeString) {
         // this is passed before the deviceready event is fired, so you can access it in js when you receive deviceready
-		NSLog(@"DEPRECATED: window.invokeString - use the window.handleOpenURL(url) function instead, which is always called when the app is launched through a custom scheme url.");
+        NSLog(@"DEPRECATED: window.invokeString - use the window.handleOpenURL(url) function instead, which is always called when the app is launched through a custom scheme url.");
         NSString* jsString = [NSString stringWithFormat:@"var invokeString = \"%@\";", self.invokeString];
         [theWebView stringByEvaluatingJavaScriptFromString:jsString];
-     }
-     
-     // Black base color for background matches the native apps
-     theWebView.backgroundColor = [UIColor blackColor];
+    }
 
-	return [super webViewDidFinishLoad:theWebView];
+    // Black base color for background matches the native apps
+    theWebView.backgroundColor = [UIColor blackColor];
+
+    return [super webViewDidFinishLoad:theWebView];
 }
 
 /* Comment out the block below to over-ride */
+
 /*
 
-- (void) webViewDidStartLoad:(UIWebView*)theWebView 
+- (void) webViewDidStartLoad:(UIWebView*)theWebView
 {
-	return [super webViewDidStartLoad:theWebView];
+    return [super webViewDidStartLoad:theWebView];
 }
 
-- (void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error 
+- (void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error
 {
-	return [super webView:theWebView didFailLoadWithError:error];
+    return [super webView:theWebView didFailLoadWithError:error];
 }
 
 - (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
 {
-	return [super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
+    return [super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
 }
 */
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/ecf289cc/bin/templates/project/__TESTING__/main.m
----------------------------------------------------------------------
diff --git a/bin/templates/project/__TESTING__/main.m b/bin/templates/project/__TESTING__/main.m
index 2dbcb26..8070643 100644
--- a/bin/templates/project/__TESTING__/main.m
+++ b/bin/templates/project/__TESTING__/main.m
@@ -6,9 +6,9 @@
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
- 
+
  http://www.apache.org/licenses/LICENSE-2.0
- 
+
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,10 +26,10 @@
 
 #import <UIKit/UIKit.h>
 
-int main(int argc, char *argv[]) {
-    
+int main(int argc, char* argv[])
+{
     @autoreleasepool {
-	int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
-	return retVal;
+        int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
+        return retVal;
     }
 }