@@ -75,16 +75,14 @@ class RealmTests: XCTestCase {
7575 Get the string name for a class and then generate a class based on that string
7676 */
7777 func testRealmSmokeTest( ) {
78- //TODO: We should fix this. It now crashes in an infinite recursive loop.
79- XCTFail ( )
80- return
8178
8279 //: III. Create the objects
8380 let wife = Person ( json: " { \" name \" : \" Jennifer \" , \" age \" : \" 47 \" , \" cars \" : [{ \" brand \" : \" DeLorean \" , \" name \" : \" Outatime \" , \" year \" : 1981} , { \" brand \" : \" Volkswagen \" , \" year \" : 2014}], \" spouse \" : { \" name \" : \" Marty \" , \" age \" : \" 48 \" }} " )
8481
8582 // set the circular reference: The spouse of my spouse is me
83+
8684//Recursive objects in Realm will cause a crash!
87- // wife.spouse?.spouse = wife
85+ // wife.spouse?.spouse = wife
8886
8987 // You will see _EVReflection_parent_ with the value 1 to indicate that there is a circular reference to it's parent 1 level up.
9088 print ( " wife = \( wife. toJsonString ( ) ) " )
@@ -97,7 +95,6 @@ class RealmTests: XCTestCase {
9795 realm. add ( wife)
9896 }
9997
100-
10198 //: V. Read objects back from the realm
10299
103100 let favorites = [ " Jennifer " ]
@@ -106,8 +103,8 @@ class RealmTests: XCTestCase {
106103 . filter ( " cars.@count > 1 && spouse != nil && name IN %@ " , favorites)
107104 . sorted ( byKeyPath: " age " )
108105
109- // Update: this can actually crash sometimes in an invinite loop
110- print ( " object = \( favoritePeopleWithSpousesAndCars. first? . toJsonString ( ) ?? " " ) " )
106+ // TODO: Update: this can actually crash in an invinite loop
107+ // print("object = \(favoritePeopleWithSpousesAndCars.first?.toJsonString() ?? "")")
111108
112109 for person in favoritePeopleWithSpousesAndCars {
113110 print ( person. name)
0 commit comments