[Mono-bugs] [Bug 568778] New: Convert.ToBase64String inserts line break after short string

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jan 7 02:50:05 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=568778

http://bugzilla.novell.com/show_bug.cgi?id=568778#c0


           Summary: Convert.ToBase64String inserts line break after short
                    string
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.6.x
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: lesnikowski at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7)
Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)

[Test]
public void Base64String_ShorterThan76Chars_DoesNotEndWithNewLine()
{
    string base64 = Convert.ToBase64String(new byte[] { 42 },
Base64FormattingOptions.InsertLineBreaks);
    Assert.IsFalse(base64.EndsWith("\r\n"));
    Assert.AreEqual("Kg==", base64);
}


Reproducible: Always

Steps to Reproduce:
[Test]
public void Base64String_ShorterThan76Chars_DoesNotEndWithNewLine()
{
    string base64 = Convert.ToBase64String(new byte[] { 42 },
Base64FormattingOptions.InsertLineBreaks);
    Assert.IsFalse(base64.EndsWith("\r\n"));
    Assert.AreEqual("Kg==", base64);
}
Actual Results:  
Base64 string ends with new line chars

Expected Results:  
For strings shorter than 76 chars no line break should be inserted

Test passes on MS implementation of .NET framework

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list