Skip to content

Commit

Permalink
Add array to RLMProperty's description
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoyne committed Aug 1, 2017
1 parent 0c40517 commit f4664c2
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Realm/RLMProperty.mm
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,22 @@ - (BOOL)isEqualToProperty:(RLMProperty *)property {
}

- (NSString *)description {
return [NSString stringWithFormat:@"%@ {\n\ttype = %@;\n\tobjectClassName = %@;\n\tlinkOriginPropertyName = %@;\n\tindexed = %@;\n\tisPrimary = %@;\n\toptional = %@;\n}", self.name, RLMTypeToString(self.type), self.objectClassName, self.linkOriginPropertyName, self.indexed ? @"YES" : @"NO", self.isPrimary ? @"YES" : @"NO", self.optional ? @"YES" : @"NO"];
return [NSString stringWithFormat:
@"%@ {\n"
"\ttype = %@;\n"
"\tobjectClassName = %@;\n"
"\tlinkOriginPropertyName = %@;\n"
"\tindexed = %@;\n"
"\tisPrimary = %@;\n"
"\tarray = %@;\n"
"\toptional = %@;\n"
"}",
self.name, RLMTypeToString(self.type), self.objectClassName,
self.linkOriginPropertyName,
self.indexed ? @"YES" : @"NO",
self.isPrimary ? @"YES" : @"NO",
self.array ? @"YES" : @"NO",
self.optional ? @"YES" : @"NO"];
}

- (realm::Property)objectStoreCopy {
Expand Down
2 changes: 2 additions & 0 deletions Realm/Tests/ObjectSchemaTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ - (void)testDescription {
@"\t\tlinkOriginPropertyName = (null);\n"
@"\t\tindexed = YES;\n"
@"\t\tisPrimary = YES;\n"
@"\t\tarray = NO;\n"
@"\t\toptional = NO;\n"
@"\t}\n"
@"\tintCol {\n"
Expand All @@ -71,6 +72,7 @@ - (void)testDescription {
@"\t\tlinkOriginPropertyName = (null);\n"
@"\t\tindexed = NO;\n"
@"\t\tisPrimary = NO;\n"
@"\t\tarray = NO;\n"
@"\t\toptional = NO;\n"
@"\t}\n"
@"}");
Expand Down
1 change: 1 addition & 0 deletions Realm/Tests/PropertyTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ - (void)testDescription {
@"\tlinkOriginPropertyName = (null);\n"
@"\tindexed = NO;\n"
@"\tisPrimary = NO;\n"
@"\tarray = NO;\n"
@"\toptional = YES;\n"
@"}");
}
Expand Down
13 changes: 13 additions & 0 deletions Realm/Tests/SchemaTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = NO;\n"
@"\t\t}\n"
@"\t\tintCol {\n"
Expand All @@ -525,6 +526,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = NO;\n"
@"\t\t}\n"
@"\t\tfloatCol {\n"
Expand All @@ -533,6 +535,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = NO;\n"
@"\t\t}\n"
@"\t\tdoubleCol {\n"
Expand All @@ -541,6 +544,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = NO;\n"
@"\t\t}\n"
@"\t\tstringCol {\n"
Expand All @@ -549,6 +553,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = NO;\n"
@"\t\t}\n"
@"\t\tbinaryCol {\n"
Expand All @@ -557,6 +562,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = NO;\n"
@"\t\t}\n"
@"\t\tdateCol {\n"
Expand All @@ -565,6 +571,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = NO;\n"
@"\t\t}\n"
@"\t\tcBoolCol {\n"
Expand All @@ -573,6 +580,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = NO;\n"
@"\t\t}\n"
@"\t\tlongCol {\n"
Expand All @@ -581,6 +589,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = NO;\n"
@"\t\t}\n"
@"\t\tobjectCol {\n"
Expand All @@ -589,6 +598,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = YES;\n"
@"\t\t}\n"
@"\t\tlinkingObjectsCol {\n"
Expand All @@ -597,6 +607,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = allTypesCol;\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = YES;\n"
@"\t\t\toptional = NO;\n"
@"\t\t}\n"
@"\t}\n"
Expand All @@ -607,6 +618,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = NO;\n"
@"\t\t}\n"
@"\t}\n"
Expand All @@ -617,6 +629,7 @@ - (void)testDescription {
@"\t\t\tlinkOriginPropertyName = (null);\n"
@"\t\t\tindexed = NO;\n"
@"\t\t\tisPrimary = NO;\n"
@"\t\t\tarray = NO;\n"
@"\t\t\toptional = YES;\n"
@"\t\t}\n"
@"\t}\n"
Expand Down

0 comments on commit f4664c2

Please sign in to comment.