aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMCalculatedRangeTest.m
diff options
context:
space:
mode:
authorGravatar dmaclach <dmaclach@google.com>2016-10-07 12:10:23 -0400
committerGravatar Thomas Van Lenten <thomasvl@google.com>2016-10-07 12:21:06 -0400
commit42124b3691197c3c4f52f069775fa0390a8ff942 (patch)
treeebd373d398ea64b45bdc1d196fa0a2c5f57cabfd /Foundation/GTMCalculatedRangeTest.m
parent57eeab4193210df8ab0c81e9d3f1ee1ad3e24492 (diff)
First cut at pruning things/updating things.
Remove a bunch of code that Google stopped using/maintaining rather than trying to update it it. Some would be hard to update, some actually has system provided replacements; others are patterns that just don't seem as common now. Prune out the code related to macOS <= 10.5, start pruning some of the really old iOS support also. Get the projects mostly limping again with modern Xcodes so tests can be run. If someone ends up on this commit via history for something they still find as useful, feel free to do a pull request to bring the snippet of code back to life and update it for current SDKs.
Diffstat (limited to 'Foundation/GTMCalculatedRangeTest.m')
-rw-r--r--Foundation/GTMCalculatedRangeTest.m101
1 files changed, 0 insertions, 101 deletions
diff --git a/Foundation/GTMCalculatedRangeTest.m b/Foundation/GTMCalculatedRangeTest.m
deleted file mode 100644
index 0806a0d..0000000
--- a/Foundation/GTMCalculatedRangeTest.m
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// GTMCalculatedRangeTest.m
-//
-// Copyright 2006-2008 Google Inc.
-//
-// Licensed 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 KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-//
-
-#import "GTMCalculatedRange.h"
-#import "GTMSenTestCase.h"
-
-@interface GTMCalculatedRangeTest : GTMTestCase {
- GTMCalculatedRange *range_;
-}
-@end
-
-@implementation GTMCalculatedRangeTest
-NSString *kStrings[] = { @"Fee", @"Fi", @"Fo", @"Fum" };
-const NSUInteger kStringCount = sizeof(kStrings) / sizeof(NSString*);
-const CGFloat kOddPosition = 0.14159265f;
-const CGFloat kExistingPosition = 0.5f;
-const NSUInteger kExisitingIndex = 2;
-
-- (void)setUp {
- range_ = [[GTMCalculatedRange alloc] init];
- for(NSUInteger i = kStringCount; i > 0; --i) {
- [range_ insertStop:kStrings[kStringCount - i] atPosition:(CGFloat)(1.0 / i)];
- }
-}
-
-- (void)tearDown {
- [range_ release];
-}
-
-- (void)testInsertStop {
- // new position
- NSString *theString = @"I smell the blood of an Englishman!";
- [range_ insertStop:theString atPosition:kOddPosition];
- STAssertEquals([range_ stopCount], kStringCount + 1, @"Stop count was bad");
- NSString *getString = [range_ valueAtPosition:kOddPosition];
- STAssertNotNil(getString, @"String was bad");
- STAssertEquals(theString, getString, @"Stops weren't equal");
- // existing position
- NSString *theStringTake2 = @"I smell the blood of an Englishman! Take 2";
- [range_ insertStop:theStringTake2 atPosition:kOddPosition];
- STAssertEquals([range_ stopCount], kStringCount + 1, @"Stop count was bad");
- getString = [range_ valueAtPosition:kOddPosition];
- STAssertNotNil(getString, @"String was bad");
- STAssertEquals(theStringTake2, getString, @"Stops weren't equal");
- STAssertNotEquals(theString, getString, @"Should be the new value");
- STAssertNotEqualObjects(theString, getString, @"Should be the new value");
-}
-
-- (void)testRemoveStopAtPosition {
- STAssertFalse([range_ removeStopAtPosition: kOddPosition], @"Was able to remove non-existant stop");
- STAssertTrue([range_ removeStopAtPosition: kExistingPosition], @"Was unable to remove good stop");
- STAssertEquals([range_ stopCount], kStringCount - 1, @"Removing stop should adjust stop count");
-}
-
-- (void)testRemoveStopAtIndex {
- STAssertThrows([range_ removeStopAtIndex: kStringCount], @"Was able to remove non-existant stop");
- STAssertNoThrow([range_ removeStopAtIndex: kStringCount - 1], @"Was unable to remove good stop");
- STAssertEquals([range_ stopCount], kStringCount - 1, @"Removing stop should adjust stop count");
-}
-
-- (void)testStopCount {
- STAssertEquals([range_ stopCount], kStringCount, @"Bad stop count");
-}
-
-- (void)testValueAtPosition {
- STAssertEqualObjects([range_ valueAtPosition: kExistingPosition], kStrings[kExisitingIndex], nil);
- STAssertNotEqualObjects([range_ valueAtPosition: kExistingPosition], kStrings[kStringCount - 1], nil);
- STAssertNil([range_ valueAtPosition: kOddPosition], nil);
-}
-
-- (void)testStopAtIndex {
- CGFloat thePosition;
-
- STAssertEqualObjects([range_ stopAtIndex:kStringCount - 1 position:nil], kStrings[kStringCount - 1], nil);
- STAssertEqualObjects([range_ stopAtIndex:kExisitingIndex position:&thePosition], kStrings[kExisitingIndex], nil);
- STAssertEquals(thePosition, kExistingPosition, nil);
- STAssertNotEqualObjects([range_ stopAtIndex:kStringCount - 1 position:nil], kStrings[2], nil);
- STAssertThrows([range_ stopAtIndex:kStringCount position:nil], nil);
-}
-
-- (void)testDescription {
- // we expect a description of atleast a few chars
- STAssertGreaterThan([[range_ description] length], (NSUInteger)10, nil);
-}
-
-@end