Skip to content

Commit

Permalink
Test if rec length tests cause failure
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjcroucher committed Jun 17, 2024
1 parent 4ecbd72 commit 4bd91a5
Showing 1 changed file with 55 additions and 33 deletions.
88 changes: 55 additions & 33 deletions tests/check_branch_sequences.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 4bd91a5

Please sign in to comment.