Skip to content

Commit

Permalink
Recover type description test (disabled because iOS 64 bits)
Browse files Browse the repository at this point in the history
Use a template for a bool TyphoonTypeDescriptor, which gives us the platform
bool description, and primitiveType value.
  • Loading branch information
drodriguez committed Jan 30, 2014
1 parent 76c1f7d commit 4eda11f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Tests/TypeConversion/TyphoonTypeDescriptorTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,22 @@ @implementation TyphoonTypeDescriptorTests

- (void)test_type_description_primitive
{
// Depending on the platform, bools are encoded either as chars or as bool
// both are 1 byte, and with 1 byte padding.
// iOS 64 bits is the one needing this "template", so we don't hardcode the
// expected description below.
TyphoonTypeDescriptor* boolDescriptor = [TyphoonTypeDescriptor descriptorWithTypeCode:[NSString stringWithCString:@encode(BOOL) encoding:NSASCIIStringEncoding]];

TyphoonTypeDescriptor* descriptor = [self typeForPropertyWithName:@"aBoolProperty"];
assertThatBool([descriptor isPrimitive], equalToBool(YES));
assertThat([descriptor typeBeingDescribed], nilValue());
assertThat([descriptor protocol], nilValue());
assertThatBool([descriptor isArray], equalToBool(NO));
assertThatInt([descriptor arrayLength], equalToInt(0));
assertThatInt(descriptor.primitiveType, equalToInt(boolDescriptor.primitiveType));

NSString* description = [descriptor description];
// assertThat(description, equalTo(@"Type descriptor for primitive: 1"));
// fails when running on iOS 64 bit simulator
assertThat(description, equalTo([boolDescriptor description]));
}

- (void)test_type_description_class
Expand Down

0 comments on commit 4eda11f

Please sign in to comment.