From 4bd91a55f9e329b484da50c9e3829f7661a036d2 Mon Sep 17 00:00:00 2001 From: Nick Croucher Date: Mon, 17 Jun 2024 12:03:29 +0100 Subject: [PATCH] Test if rec length tests cause failure --- tests/check_branch_sequences.c | 88 +++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 33 deletions(-) diff --git a/tests/check_branch_sequences.c b/tests/check_branch_sequences.c index 3b3b305a..5ddd47f0 100644 --- a/tests/check_branch_sequences.c +++ b/tests/check_branch_sequences.c @@ -95,39 +95,61 @@ int test_bases_in_recombinations(int block_size) return calculate_number_of_bases_in_recombinations(block_coords, block_size, child_sequence, snp_locations,12,0); } -int test_bases_in_recombinations_with_gaps(int block_size) -{ - int ** block_coords; - block_coords = (int **) malloc(2*sizeof(int*)); - block_coords[0] = (int*) malloc((4)*sizeof(int )); - block_coords[1] = (int*) malloc((4)*sizeof(int )); - block_coords[0][0] = 5; - block_coords[1][0] = 10; - block_coords[0][1] = 100; - block_coords[1][1] = 110; - block_coords[0][2] = 15; - block_coords[1][2] = 20; - block_coords[0][3] = 7; - block_coords[1][3] = 15; - char * child_sequence = "--A---AAAAAAAAAAAAAT"; - int snp_locations[16] = {1,4,5,6,7,8,9,10,11,15,20,30,40,50,100,110}; - return calculate_number_of_bases_in_recombinations(block_coords, block_size, child_sequence, snp_locations,16,0); -} - - -START_TEST (check_calculate_number_of_bases_in_recombations) -{ - ck_assert(test_bases_in_recombinations(4) == 27); - ck_assert(test_bases_in_recombinations(3) == 23); - ck_assert(test_bases_in_recombinations(2) == 17); - ck_assert(test_bases_in_recombinations(1) == 6); - - ck_assert(test_bases_in_recombinations_with_gaps(4) == 24); - ck_assert(test_bases_in_recombinations_with_gaps(3) == 20); - ck_assert(test_bases_in_recombinations_with_gaps(2) == 14); - ck_assert(test_bases_in_recombinations_with_gaps(1) == 3); -} -END_TEST +//int test_bases_in_recombinations_with_gaps(int block_size) +//{ +// int ** block_coords; +// block_coords = (int **) malloc(2*sizeof(int*)); +// block_coords[0] = (int*) malloc((4)*sizeof(int )); +// block_coords[1] = (int*) malloc((4)*sizeof(int )); +// block_coords[0][0] = 5; +// block_coords[1][0] = 10; +// block_coords[0][1] = 100; +// block_coords[1][1] = 110; +// block_coords[0][2] = 15; +// block_coords[1][2] = 20; +// block_coords[0][3] = 7; +// block_coords[1][3] = 15; +// char * child_sequence = "--A---AAAAAAAAAAAAAT"; +// int snp_locations[16] = {1,4,5,6,7,8,9,10,11,15,20,30,40,50,100,110}; +// return calculate_number_of_bases_in_recombinations(block_coords, block_size, child_sequence, snp_locations,16,0); +//} +// +//int test_bases_in_recombinations_including_gaps(int block_size) +//{ +// int ** block_coords; +// block_coords = (int **) malloc(2*sizeof(int*)); +// block_coords[0] = (int*) malloc((4)*sizeof(int )); +// block_coords[1] = (int*) malloc((4)*sizeof(int )); +// block_coords[0][0] = 5; +// block_coords[1][0] = 10; +// block_coords[0][1] = 100; +// block_coords[1][1] = 110; +// block_coords[0][2] = 15; +// block_coords[1][2] = 20; +// block_coords[0][3] = 7; +// block_coords[1][3] = 15; +// char * child_sequence = "--A---AAAAAAAAAAAAAT"; +// int snp_locations[16] = {1,4,5,6,7,8,9,10,11,15,20,30,40,50,100,110}; +// return calculate_number_of_bases_in_recombinations(block_coords, block_size, child_sequence, snp_locations,16,1); +//} +// +//START_TEST (check_calculate_number_of_bases_in_recombations) +//{ +// ck_assert(test_bases_in_recombinations(4) == 27); +// ck_assert(test_bases_in_recombinations(3) == 23); +// ck_assert(test_bases_in_recombinations(2) == 17); +// ck_assert(test_bases_in_recombinations(1) == 6); +// +// ck_assert(test_bases_in_recombinations_with_gaps(4) == 24); +// ck_assert(test_bases_in_recombinations_with_gaps(3) == 20); +// ck_assert(test_bases_in_recombinations_with_gaps(2) == 14); +// ck_assert(test_bases_in_recombinations_with_gaps(1) == 3); +// +// ck_assert(test_bases_in_recombinations_with_gaps(4) < test_bases_in_recombinations_including_gaps(4)); +// ck_assert(test_bases_in_recombinations(4) == test_bases_in_recombinations_including_gaps(4)); +// +//} +//END_TEST START_TEST (check_get_list_of_snp_indices_which_fall_in_downstream_recombinations_single_block) {