Thread overview
[Issue 5626] New: std.random unittest disabled
Feb 20, 2011
Brad Roberts
Feb 21, 2011
Masahiro Nakagawa
Mar 27, 2011
Brad Roberts
Mar 28, 2011
Brad Roberts
Mar 28, 2011
Masahiro Nakagawa
February 20, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5626

           Summary: std.random unittest disabled
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: braddr@puremagic.com


--- Comment #0 from Brad Roberts <braddr@puremagic.com> 2011-02-20 14:22:13 PST ---
Testing generated/linux/debug/64/unittest/std/random core.exception.AssertError@std.random(796): unittest failure

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 21, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5626


Masahiro Nakagawa <repeatedly@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |repeatedly@gmail.com
         AssignedTo|nobody@puremagic.com        |repeatedly@gmail.com


--- Comment #1 from Masahiro Nakagawa <repeatedly@gmail.com> 2011-02-21 06:58:34 PST ---
Oops! Currently, I don't have Linux 64bit environment. Please wait.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 27, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5626


Brad Roberts <braddr@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|repeatedly@gmail.com        |nobody@puremagic.com


--- Comment #2 from Brad Roberts <braddr@puremagic.com> 2011-03-27 15:23:47 PDT ---
Reduced bug, nothing to do with the random parts at all:

module bug;

extern(C) int printf(const char*, ...);

int main()
{
    // neither of these produce the expected result.
    ulong[] checking = [ 2_463_534_242UL ];
    //long[] checking = [ 2_463_534_242L ];

    printf("typeof(checking) = '%.*s'\n",
        typeid(checking).toString.length,
        typeid(checking).toString.ptr);

    foreach (i, e; checking)
        printf("i = %zd, e = %lld\n", i, e);

    return 0;
}

$ dmd -m64 bug-random.d && ./bug-random

Produces:
  typeof(checking) = 'ulong[]'
  i = 0, e = -1831433054

using %llu (or %lu, just to make sure I wasn't crazy about the size specifier):
  typeof(checking) = 'ulong[]'
  i = 0, e = 18446744071878118562

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 28, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5626


Brad Roberts <braddr@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #3 from Brad Roberts <braddr@puremagic.com> 2011-03-28 00:16:46 PDT ---
dmd fix: https://github.com/D-Programming-Language/dmd/commit/5c746cad4c6fb09a86e322bd4992237023d0fe87

phobos enable test: https://github.com/D-Programming-Language/phobos/commit/4dfe6b9e715246c1ad31f6829531d0cb555ad33b

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 28, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5626



--- Comment #4 from Masahiro Nakagawa <repeatedly@gmail.com> 2011-03-28 16:32:41 PDT ---
Thanks to Walter and Brad for fixing!

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