Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pvanheus committed Oct 21, 2019
1 parent 11e2f3c commit 0dbdfc0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -91,6 +91,8 @@ make
make check
```

This requires libcheck (the `check` package in Ubuntu) to be installed.

## Usage

```
Expand Down
18 changes: 9 additions & 9 deletions tests/check-snp-sites.c
Expand Up @@ -183,64 +183,64 @@ END_TEST

START_TEST (valid_genome_length)
{
detect_snps("../tests/data/alignment_file_one_line_per_sequence.aln",0,0);
detect_snps("../tests/data/alignment_file_one_line_per_sequence.aln",0,0,0);
fail_unless( get_length_of_genome() == 2000 );
}
END_TEST

START_TEST (valid_genome_length_with_multiple_lines_per_sequence)
{
detect_snps("../tests/data/alignment_file_multiple_lines_per_sequence.aln",0,0);
detect_snps("../tests/data/alignment_file_multiple_lines_per_sequence.aln",0,0,0);
fail_unless( get_length_of_genome() == 2000 );
}
END_TEST

START_TEST (valid_number_of_sequences_in_file)
{
detect_snps("../tests/data/alignment_file_one_line_per_sequence.aln",0,0);
detect_snps("../tests/data/alignment_file_one_line_per_sequence.aln",0,0,0);
fail_unless( get_number_of_samples() == 109 );
}
END_TEST

START_TEST (valid_number_of_sequences_in_file_with_multiple_lines_per_sequence)
{
detect_snps("../tests/data/alignment_file_multiple_lines_per_sequence.aln",0,0);
detect_snps("../tests/data/alignment_file_multiple_lines_per_sequence.aln",0,0,0);
fail_unless( get_number_of_samples() == 109 );
}
END_TEST

START_TEST (number_of_snps_detected)
{
detect_snps("../tests/data/alignment_file_multiple_lines_per_sequence.aln",0,0);
detect_snps("../tests/data/alignment_file_multiple_lines_per_sequence.aln",0,0,0);
fail_unless( get_number_of_snps() == 5);
}
END_TEST

START_TEST (number_of_snps_detected_small)
{
detect_snps("../tests/data/small_alignment.aln",0,0);
detect_snps("../tests/data/small_alignment.aln",0,0,0);
fail_unless( get_number_of_snps() == 1);
}
END_TEST

START_TEST (detect_snps_pure_mode)
{
detect_snps("../tests/data/pure_mode_alignment.aln",1,0);
detect_snps("../tests/data/pure_mode_alignment.aln",1,0,0);
fail_unless( get_number_of_snps() == 2);
}
END_TEST


START_TEST (detect_snps_pure_mode_monomorphic)
{
detect_snps("../tests/data/pure_mode_monomorphic_alignment.aln",1,1);
detect_snps("../tests/data/pure_mode_monomorphic_alignment.aln",1,1,0);
fail_unless( get_number_of_snps() == 3);
}
END_TEST

START_TEST (sample_names_from_alignment_file)
{
detect_snps("../tests/data/small_alignment.aln",0,0);
detect_snps("../tests/data/small_alignment.aln",0,0,0);
char ** current_sequence_names = get_sequence_names();

fail_unless(strcmp(current_sequence_names[0],"reference_sequence") == 0);
Expand Down

0 comments on commit 0dbdfc0

Please sign in to comment.