Permalink
Browse files

Pruning some unused and confusing functions.

  • Loading branch information...
1 parent aea4cf9 commit 8505b787a78d2786106af5d495ee616847f9f529 @jagill committed Apr 3, 2012
@@ -63,7 +63,6 @@ JAGPropertySetterSemantics;
property.isObject == YES;
property.propertyClass == [NSString class];
property.isNumber == NO;
- property.isScalar == NO;
property.typeEncoding == @"@\"NSString\"";
property.isNonAtomic == YES;
property.isReadOnly == YES;
@@ -78,7 +77,6 @@ JAGPropertySetterSemantics;
property.isObject == YES;
property.propertyClass == nil;
property.isNumber == YES;
- property.isScalar == YES;
property.typeEncoding == @"i";
property.isNonAtomic == NO;
property.isReadOnly == NO;
@@ -225,15 +223,9 @@ JAGPropertySetterSemantics;
*/
- (BOOL)isEligibleForGarbageCollection;
-/// @return YES if the property is char (signed or unsigned) or char array
-- (BOOL) isCharacterType;
-
/// @return YES if the property is any sort of integer, float, char, or BOOL
- (BOOL) isNumber;
-/// @return YES if the property is for a Number, Bool, or CharacterType
-- (BOOL) isScalar;
-
/// @return YES if the property is for an NSObject subclass or `id`.
- (BOOL) isObject;
@@ -194,16 +194,6 @@ - (Class) propertyClass {
return class;
}
-- (BOOL) isCharacterType
-{
- NSString *typeEncoding = [self typeEncoding];
- return ([typeEncoding isEqualToString: @"c"]
- || [typeEncoding isEqualToString: @"C"]
- || [typeEncoding isEqualToString: @"*"]
- );
-}
-
-//Temporarily including characters.
- (BOOL) isNumber
{
NSString *typeEncoding = [self typeEncoding];
@@ -223,13 +213,6 @@ - (BOOL) isNumber
);
}
-- (BOOL) isScalar
-{
- return ([self isCharacterType]
- || [self isNumber] //isNumber includes Boolean
- );
-}
-
- (BOOL) isObject
{
return [[self typeEncoding] hasPrefix: @"@"] && ![self isBlock];
@@ -71,8 +71,6 @@ - (void) setUp {
- (void) testIntProperty {
STAssertTrue([[intProp typeEncoding] isEqualToString:@"i"], @"Type encoding should be i, is %@", [intProp typeEncoding]);
STAssertTrue([intProp isNumber], @"Property should be Number.");
- STAssertFalse([intProp isCharacterType], @"Property should not be CharacterType.");
- STAssertTrue([intProp isScalar], @"Property should be scalar.");
STAssertFalse([intProp isObject], @"Property should not be object.");
STAssertEqualObjects([intProp ivarName], @"_intProperty", @"ivarName should be correct.");
STAssertEquals([intProp setterSemantics], JAGPropertySetterSemanticsAssign, @"Setter semantics should be assign.");
@@ -89,8 +87,6 @@ - (void) testModelProperty {
STAssertTrue([[modelProp typeEncoding] isEqualToString:@"@\"TestModel\""],
@"Type encoding should be @\"TestModel\", is %@", [modelProp typeEncoding]);
STAssertFalse([modelProp isNumber], @"Property should not be Number.");
- STAssertFalse([modelProp isCharacterType], @"Property should not be CharacterType.");
- STAssertFalse([modelProp isScalar], @"Property should not be scalar.");
STAssertEqualObjects([modelProp ivarName], @"_modelProperty", @"ivarName should be correct.");
STAssertEquals([modelProp setterSemantics], JAGPropertySetterSemanticsRetain, @"Setter semantics should be retain.");
STAssertEqualObjects([modelProp name], @"modelProperty", @"Name should be correct.");
@@ -27,11 +27,20 @@
#import "TestModel.h"
#import "JAGPropertyFinder.h"
+@interface PropertyModelTests() {
+@private
+ TestModel *model;
+}
+
+@end
+
@implementation PropertyModelTests
+- (void) setUp {
+ model = [TestModel testModel];
+}
- (void) testMixedModelToDict {
- TestModel *model = [TestModel testModel];
int intProp = 5;
model.intProperty = intProp;
NSString *stringProp = @"Title!";
@@ -83,7 +92,6 @@ - (void) testMixedModelFromDict {
[props setValue:otherModelProps forKey:@"modelProperty"];
- TestModel *model = [TestModel testModel];
[model setPropertiesFromDictionary:props];
STAssertEquals(model.intProperty, intProp,
@@ -106,35 +114,11 @@ - (void) testMixedModelFromDict {
}
- (void) testCoordinate {
- TestModel *model = [TestModel testModel];
NSArray *propertyNames = [JAGPropertyFinder propertyNamesForClass:[TestModel class]];
NSLog(@"Found property names for TestModel: %@", propertyNames);
TestModel *model2 = [TestModel testModel];
//We should not have crashed on coordinate here.
[model2 setPropertiesFromDictionary:[model propertiesAsDictionary]];
}
-/*
-- (void) testGetIntProperty {}
-- (void) testSetIntProperty {}
-
-- (void) testGetModelProperty;
-- (void) testSetModelProperty;
-
-- (void) testGetArrayWithNumbersProperty;
-- (void) testSetArrayWithNumbersProperty;
-
-- (void) testGetArrayWithModelsProperty;
-- (void) testSetArrayWithModelsProperty;
-
-- (void) testGetSetWithNumbersProperty;
-- (void) testSetSetWithNumbersProperty;
-
-- (void) testGetSetWithModelsProperty;
-- (void) testSetSetWithModelsProperty;
-
-- (void) testGetDictionaryProperty;
-- (void) testSetDictionaryProperty;
-*/
-
@end

0 comments on commit 8505b78

Please sign in to comment.