@@ -6140,6 +6140,8 @@ TEST_IF(Sync_CollectionInMixed, sync::SYNC_SUPPORTS_NESTED_COLLECTIONS)
61406140 dict->insert_collection (" list" , CollectionType::List);
61416141 auto l = dict->get_list (" list" );
61426142 l->add (5 );
6143+ l->insert_collection (1 , CollectionType::List);
6144+ l->get_list (1 )->add (7 );
61436145
61446146 auto bar = table->create_object_with_primary_key (456 );
61456147
@@ -6148,15 +6150,6 @@ TEST_IF(Sync_CollectionInMixed, sync::SYNC_SUPPORTS_NESTED_COLLECTIONS)
61486150 auto list = bar.get_list_ptr <Mixed>(col_any);
61496151 list->add (" John" );
61506152 list->insert (0 , 5 );
6151-
6152- auto foobar = table->create_object_with_primary_key (789 );
6153-
6154- // Create set in Mixed property
6155- foobar.set_collection (col_any, CollectionType::Set);
6156- auto set = foobar.get_set_ptr <Mixed>(col_any);
6157- set->insert (1 );
6158- set->insert (2 );
6159- set->insert (5 );
61606153 });
61616154
61626155 session_1.wait_for_upload_complete_or_client_stopped ();
@@ -6165,7 +6158,7 @@ TEST_IF(Sync_CollectionInMixed, sync::SYNC_SUPPORTS_NESTED_COLLECTIONS)
61656158 write_transaction (db_2, [&](WriteTransaction& tr) {
61666159 auto table = tr.get_table (" class_Table" );
61676160 auto col_any = table->get_column_key (" any" );
6168- CHECK_EQUAL (table->size (), 3 );
6161+ CHECK_EQUAL (table->size (), 2 );
61696162
61706163 auto obj = table->get_object_with_primary_key (123 );
61716164 auto dict = obj.get_dictionary_ptr (col_any);
@@ -6195,15 +6188,6 @@ TEST_IF(Sync_CollectionInMixed, sync::SYNC_SUPPORTS_NESTED_COLLECTIONS)
61956188 list->set (1 , " Paul" );
61966189 // Erase list element
61976190 list->remove (0 );
6198-
6199- obj = table->get_object_with_primary_key (789 );
6200- auto set = obj.get_set_ptr <Mixed>(col_any);
6201- // Check that values are replicated
6202- CHECK_NOT_EQUAL (set->find (1 ), realm::npos);
6203- CHECK_NOT_EQUAL (set->find (2 ), realm::npos);
6204- CHECK_NOT_EQUAL (set->find (5 ), realm::npos);
6205- // Erase set element
6206- set->erase (2 );
62076191 });
62086192
62096193 session_2.wait_for_upload_complete_or_client_stopped ();
@@ -6212,7 +6196,7 @@ TEST_IF(Sync_CollectionInMixed, sync::SYNC_SUPPORTS_NESTED_COLLECTIONS)
62126196 write_transaction (db_1, [&](WriteTransaction& tr) {
62136197 auto table = tr.get_table (" class_Table" );
62146198 auto col_any = table->get_column_key (" any" );
6215- CHECK_EQUAL (table->size (), 3 );
6199+ CHECK_EQUAL (table->size (), 2 );
62166200
62176201 auto obj = table->get_object_with_primary_key (123 );
62186202 auto dict = obj.get_dictionary (col_any);
@@ -6232,11 +6216,6 @@ TEST_IF(Sync_CollectionInMixed, sync::SYNC_SUPPORTS_NESTED_COLLECTIONS)
62326216 CHECK_EQUAL (list->get (0 ).get_string (), " Paul" );
62336217 // List clear
62346218 list->clear ();
6235-
6236- obj = table->get_object_with_primary_key (789 );
6237- auto set = obj.get_set_ptr <Mixed>(col_any);
6238- CHECK_EQUAL (set->size (), 2 );
6239- set->clear ();
62406219 });
62416220
62426221 session_1.wait_for_upload_complete_or_client_stopped ();
@@ -6246,7 +6225,7 @@ TEST_IF(Sync_CollectionInMixed, sync::SYNC_SUPPORTS_NESTED_COLLECTIONS)
62466225 auto table = tr.get_table (" class_Table" );
62476226 auto col_any = table->get_column_key (" any" );
62486227
6249- CHECK_EQUAL (table->size (), 3 );
6228+ CHECK_EQUAL (table->size (), 2 );
62506229
62516230 auto obj = table->get_object_with_primary_key (123 );
62526231 auto dict = obj.get_dictionary (col_any);
@@ -6258,14 +6237,9 @@ TEST_IF(Sync_CollectionInMixed, sync::SYNC_SUPPORTS_NESTED_COLLECTIONS)
62586237 obj = table->get_object_with_primary_key (456 );
62596238 auto list = obj.get_list <Mixed>(col_any);
62606239 CHECK_EQUAL (list.size (), 0 );
6261- // Replace list with set on property
6262- obj.set_collection (col_any, CollectionType::Set);
6263-
6264- obj = table->get_object_with_primary_key (789 );
6265- auto set = obj.get_set <Mixed>(col_any);
6266- CHECK_EQUAL (set.size (), 0 );
6267- // Replace set with dictionary on property
6240+ // Replace list with Dictionary on property
62686241 obj.set_collection (col_any, CollectionType::Dictionary);
6242+
62696243 });
62706244
62716245 session_2.wait_for_upload_complete_or_client_stopped ();
@@ -6278,17 +6252,13 @@ TEST_IF(Sync_CollectionInMixed, sync::SYNC_SUPPORTS_NESTED_COLLECTIONS)
62786252 auto table = read_2.get_table (" class_Table" );
62796253 auto col_any = table->get_column_key (" any" );
62806254
6281- CHECK_EQUAL (table->size (), 3 );
6255+ CHECK_EQUAL (table->size (), 2 );
62826256
62836257 auto obj = table->get_object_with_primary_key (123 );
62846258 auto list = obj.get_list <Mixed>(col_any);
62856259 CHECK_EQUAL (list.size (), 0 );
62866260
62876261 obj = table->get_object_with_primary_key (456 );
6288- auto set = obj.get_set <Mixed>(col_any);
6289- CHECK_EQUAL (set.size (), 0 );
6290-
6291- obj = table->get_object_with_primary_key (789 );
62926262 auto dict = obj.get_dictionary (col_any);
62936263 CHECK_EQUAL (dict.size (), 0 );
62946264
0 commit comments