Rework Evoral::coverage() to pass unit tests
authorColin Fletcher <colin.m.fletcher@googlemail.com>
Mon, 1 Dec 2014 20:03:22 +0000 (20:03 +0000)
committerColin Fletcher <colin.m.fletcher@googlemail.com>
Mon, 1 Dec 2014 20:03:22 +0000 (20:03 +0000)
commitd7cc7775f37abd4163da08876528af10dd661109
tree30b0c3185fec2b0c02120d13f9befab1fcc0860b
parent47d329ca408a214d1ac65785dc33ff9a4a06337f
Rework Evoral::coverage() to pass unit tests

Rewrite Evoral::coverage() to (hopefully) do what it's supposed to.

Return OverlapNone for invalid ranges: if either of the ranges passed to
Evoral::coverage() have negative length (i.e.  start > end), return OverlapNone
- it seems reasonable to say that a negative-length range can't overlap
anything. Also return OverlapNone from the fallthrough case, though this should
never happen.
libs/evoral/evoral/Range.hpp