@@ -6280,10 +6280,10 @@ test_sort_tables_offsets(void)
6280
6280
CU_ASSERT_EQUAL_FATAL (ret , 0 );
6281
6281
CU_ASSERT_TRUE (tsk_table_collection_equals (& tables , & copy , 0 ));
6282
6282
6283
- /* Check that sorting would have had an effect */
6283
+ /* Check that sorting would have had no effect as individuals not in default sort */
6284
6284
ret = tsk_table_collection_sort (& tables , NULL , 0 );
6285
6285
CU_ASSERT_EQUAL_FATAL (ret , 0 );
6286
- CU_ASSERT_FALSE (tsk_table_collection_equals (& tables , & copy , 0 ));
6286
+ CU_ASSERT_TRUE (tsk_table_collection_equals (& tables , & copy , 0 ));
6287
6287
6288
6288
tsk_memset (& bookmark , 0 , sizeof (bookmark ));
6289
6289
bookmark .individuals = tables .individuals .num_rows - 1 ;
@@ -6807,12 +6807,21 @@ test_sort_tables_individuals(void)
6807
6807
CU_ASSERT_EQUAL_FATAL (ret , 0 );
6808
6808
tables .sequence_length = 1.0 ;
6809
6809
parse_individuals (individuals , & tables .individuals );
6810
+
6811
+ ret = tsk_table_collection_copy (& tables , & copy , 0 );
6812
+ CU_ASSERT_EQUAL_FATAL (ret , 0 );
6813
+
6814
+ /* Table sort doesn't touch individuals by default*/
6815
+ ret = tsk_table_collection_sort (& tables , NULL , 0 );
6816
+ CU_ASSERT_EQUAL_FATAL (ret , 0 );
6817
+ CU_ASSERT_FATAL (tsk_table_collection_equals (& tables , & copy , 0 ));
6818
+
6810
6819
/* Not calling with TSK_CHECK_TREES so casting is safe */
6811
6820
ret = (int ) tsk_table_collection_check_integrity (
6812
6821
& tables , TSK_CHECK_INDIVIDUAL_ORDERING );
6813
6822
CU_ASSERT_EQUAL_FATAL (ret , TSK_ERR_UNSORTED_INDIVIDUALS );
6814
6823
6815
- ret = tsk_table_collection_sort (& tables , NULL , 0 );
6824
+ ret = tsk_table_collection_individual_topological_sort (& tables , 0 );
6816
6825
CU_ASSERT_EQUAL_FATAL (ret , 0 );
6817
6826
ret = (int ) tsk_table_collection_check_integrity (
6818
6827
& tables , TSK_CHECK_INDIVIDUAL_ORDERING );
@@ -6821,16 +6830,14 @@ test_sort_tables_individuals(void)
6821
6830
/* Check that the sort is stable */
6822
6831
ret = tsk_table_collection_copy (& tables , & copy , 0 );
6823
6832
CU_ASSERT_EQUAL_FATAL (ret , 0 );
6824
- CU_ASSERT_FATAL (tsk_table_collection_equals (& tables , & copy , 0 ));
6825
-
6826
- ret = tsk_table_collection_sort (& tables , NULL , 0 );
6833
+ ret = tsk_table_collection_individual_topological_sort (& tables , 0 );
6827
6834
CU_ASSERT_EQUAL_FATAL (ret , 0 );
6828
- CU_ASSERT (tsk_table_collection_equals (& tables , & copy , 0 ));
6835
+ CU_ASSERT_FATAL (tsk_table_collection_equals (& tables , & copy , 0 ));
6829
6836
6830
6837
/* Errors on cycle */
6831
6838
tsk_individual_table_clear (& tables .individuals );
6832
6839
parse_individuals (individuals_cycle , & tables .individuals );
6833
- ret = tsk_table_collection_sort (& tables , NULL , 0 );
6840
+ ret = tsk_table_collection_individual_topological_sort (& tables , 0 );
6834
6841
CU_ASSERT_EQUAL (ret , TSK_ERR_INDIVIDUAL_PARENT_CYCLE );
6835
6842
6836
6843
tsk_table_collection_free (& tables );
0 commit comments