www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10426] New: Improve code coverage of std.random unittests

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: joseph.wakeling 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: -------
Jun 20 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10426




Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/b135fe92931ac7319999a0f291e69cdfa1cb381c


 Issue 10426 - Improve code coverage of std.random unittests

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 29 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10426


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |FIXED



07:25:18 PDT ---
http://d.puremagic.com/issues/show_bug.cgi?id=10426

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