Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
nst committed May 28, 2015
1 parent c7538fa commit fafe3e1
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions runtime_cli/UnitTests/RTBTypeDecoder2Tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,31 @@ - (void)testComplicatedType1 {

NSDictionary *d = [td decodeType:@"{TFCGImage=\"fRef\"{TRef<CGImage *, TRetainReleasePolicy<CGImageRef> >=\"fRef\"^{CGImage}}}"]; // OS X "BU_TMSkinnedPushButton"

NSLog(@"-- %@", d);
// NSLog(@"-- %@", d);

XCTAssertEqualObjects(d[@"kind"], @"STRUCT");
XCTAssertEqualObjects(d[@"name"], @"TFCGImage");

XCTAssertEqual([d[@"encodedTypes"] count], 2);

XCTAssertEqualObjects([d[@"encodedTypes"] objectAtIndex:0][@"kind"], @"NAME");
XCTAssertEqualObjects([d[@"encodedTypes"] objectAtIndex:0][@"name"], @"fRef");

XCTAssertEqualObjects([d[@"encodedTypes"] objectAtIndex:1][@"kind"], @"STRUCT");
XCTAssertEqualObjects([d[@"encodedTypes"] objectAtIndex:1][@"name"], @"TRef<CGImage *, TRetainReleasePolicy<CGImageRef> >");

XCTAssertEqual([[d[@"encodedTypes"] objectAtIndex:1][@"encodedTypes"] count], 2);

XCTAssertEqualObjects([[d[@"encodedTypes"] objectAtIndex:1][@"encodedTypes"] objectAtIndex:0][@"kind"], @"NAME");
XCTAssertEqualObjects([[d[@"encodedTypes"] objectAtIndex:1][@"encodedTypes"] objectAtIndex:0][@"name"], @"fRef");

XCTAssertEqualObjects([[d[@"encodedTypes"] objectAtIndex:1][@"encodedTypes"] objectAtIndex:1][@"kind"], @"POINTER");
XCTAssertEqualObjects([[d[@"encodedTypes"] objectAtIndex:1][@"encodedTypes"] objectAtIndex:1][@"encodedType"][@"kind"], @"STRUCT");

NSLog(@"--- %@", [[d[@"encodedTypes"] objectAtIndex:1][@"encodedTypes"] objectAtIndex:1][@"encodedType"]);

XCTAssertEqual([[[d[@"encodedTypes"] objectAtIndex:1][@"encodedTypes"] objectAtIndex:1][@"encodedType"][@"encodedTypes"] count], 1);


/*
struct TFCGImage {
Expand All @@ -146,8 +168,14 @@ - (void)testStructInStruct {

NSLog(@"-- %@", encodedTypes);

XCTAssertEquals([encodedTypes count], 4);
XCTAssertEqual([encodedTypes count], 4);

XCTAssertEqualObjects([encodedTypes objectAtIndex:0][@"kind"], @"NAME");
XCTAssertEqualObjects([encodedTypes objectAtIndex:1][@"kind"], @"STRUCT");
XCTAssertEqualObjects([encodedTypes objectAtIndex:2][@"kind"], @"NAME");
XCTAssertEqualObjects([encodedTypes objectAtIndex:3][@"kind"], @"STRUCT");



//XCTAssertEqual(d[@""], <#expression2, ...#>)

Expand Down

0 comments on commit fafe3e1

Please sign in to comment.