Skip to content

Commit

Permalink
Added test cases to guard against possible overflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelklee committed Aug 5, 2021
1 parent 0ece016 commit fd35aed
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,16 @@ public Object[][] counts() {
{552, 438, 207, 0.9367121245319978},
{886, 812, 216, 0.1488013326311986},
{537, 845, 72, 0.14763417247333427},
{8700, 3186, 5918, 0.46111947799744585}
{8700, 3186, 5918, 0.46111947799744585},
// The following test cases were also generated using the python implementation and
// further guard against the possibility of overflow as seen in
// https://github.com/samtools/htsjdk/issues/44.
// This implementation doesn't have a problem, since we cast to double when calculating the midpoint,
// but see e.g. https://github.com/samtools/htsjdk/pull/70.
{1998, 1, 998001, 0.7359430663641368},
{19800, 100, 980100, 0.5267641864418983},
{180000, 10000, 810000, 0.5028886002589862},
{500000, 250000, 250000, 0.5009973527964665}
};
}

Expand Down

0 comments on commit fd35aed

Please sign in to comment.