[Issue 3245] New: Easy bug fix available for disabled unit test code in std.encoding

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 11 21:59:40 PDT 2009


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

           Summary: Easy bug fix available for disabled unit test code in
                    std.encoding
           Product: D
           Version: 2.031
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: y0uf00bar at gmail.com


Bug: unittest line 55 in std.encoding was disabled by version(none)

Rationale: Re-enabling unittest at line 55 results in failure. 

Fix: At line 1059  inside template EncoderInstance(CharType : char). 

Current version:

    dchar decodeReverseViaRead()()

    {

        auto c = read;
....


Fixed version:
    dchar decodeReverseViaRead()()
    {
        dchar c = read;
....

Its obvious after failure point is pinned, even if not knowing the exact specs,
as decodeReverseViaRead must return a dchar, and variable c accumulates left
shifted bits in the loop, same as the nearby safeDecodeViaRead method. In
UTF-8,the auto c = read makes a char type only (thank you zerobugs debugger),
so high bits put in c are thrown away, and function may return character 0.
Re-enabled unittest code ran succesfully after above fix.

-- 
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