[Issue 10426] New: Improve code coverage of std.random unittests

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 20 13:12:47 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10426

           Summary: Improve code coverage of std.random unittests
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: joseph.wakeling at webdrake.net


--- Comment #0 from Joseph Rushton Wakeling <joseph.wakeling at webdrake.net> 2013-06-20 13:12:46 PDT ---
std.random's unittests currently only cover 79% of the module.

The main culprit is RandomSample.skip() where, due to the change in algorithm
in commit ae15e0ec1459d2af5e1b99eda0d4a44527ab6a29, the pre-existing unittests
fail to cope.  The new algorithm uses two different methods depending on the
ratio of sample points to available points, and the consistent 5:10 ratio in
all the unittests means one of these methods is being avoided.

Some code coverage "failures" are irrelevant -- e.g. methods of the dummy
ranges used to unittest isUniformRNG and isSeedable from lines 179-242,
assert(false) statements that should never be reached, or text() calls in
asserts that do not fail.

Others seem to be down to problems the coverage analyser has with compile-time
evaluations -- e.g. the static methods in LinearCongruentialEngine or static
conditionals that don't get satisfied.

Finally, many objects seem to have some small parts that are never tested --
for some reason .save methods seem particularly prone to not being checked in
the unittests.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list