torognes / swarm

A robust and fast clustering method for amplicon-based studies
GNU Affero General Public License v3.0
123 stars 23 forks source link

nw.cc: last lines not triggered by a test #142

Closed frederic-mahe closed 5 years ago

frederic-mahe commented 5 years ago

I don't think I can make up a toy-example that could trigger that error in nw.cc:

       53:  285:  if (score != dist)
        -:  286:  {
    #####:  287:    fprintf(stderr, "WARNING: Error with query no %" PRIu64 " and db sequence no %" PRIu64 ":\n", queryno, dbseqno);
    #####:  288:    fprintf(stderr, "Initial and recomputed alignment score disagreement: %" PRId64 " %" PRId64 "\n", dist, score);
    #####:  289:    fprintf(stderr, "Alignment: %s\n", cigar);
        -:  290:  }

Am I correct? or do you happen to have such an example?

torognes commented 5 years ago

In this case it should be an assert. This error should not occur unless there is a bug in the code.

I'll change it to an assert.

torognes commented 5 years ago

Fixed in commit 9286af7c120f9f319dd4f7eff9072e2b7c15a79f.

torognes commented 5 years ago

Sorry, too quick there. Fixed in commit ece391365b01f395e76db7a6b4425a8d4b2d48b5.

frederic-mahe commented 5 years ago
File 'nw.cc'
Lines executed:100.00% of 121

Nice!