[Mono-bugs] [Bug 622042] New: Regression: Array.Sort no longer sorts properly.
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Jul 13 16:32:47 EDT 2010
http://bugzilla.novell.com/show_bug.cgi?id=622042
http://bugzilla.novell.com/show_bug.cgi?id=622042#c0
Summary: Regression: Array.Sort no longer sorts properly.
Classification: Mono
Product: Mono: Runtime
Version: SVN
Platform: Other
OS/Version: openSUSE 11.2
Status: NEW
Severity: Critical
Priority: P5 - None
Component: JIT
AssignedTo: lupus at novell.com
ReportedBy: miguel at novell.com
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Blocker: Yes
With Mono 2.6 this sample does not print anything, with Mono trunk it reports a
handful of errors:
using System;
using System.Collections;
class B : IComparer
{
public int Compare(object x, object y)
{
if (((char)x).CompareTo((char)y) > 0)
return -1;
else
{
if (x == y)
{
return 0;
}
else
{
return 1;
}
}
}
}
class Test {
static void Main ()
{
char[] c1 = new char[10] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j' };
char[] c2 = new char[10] { 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c',
'b', 'a' };
char[] d1 = new char[10];
char[] d2 = new char[10];
c1.CopyTo(d2, 0);
c2.CopyTo(d1, 0);
IComparer b = new B();
Array.Sort (c1, c2, b);
for (int i = 0; i < 10; i++)
{
if (c1[i] != d1[i])
{
Console.WriteLine ("Error at {0} values {1} and {2}", i, c1[i],
d1[i]);
}
if (c2[i] != d2[i])
{
Console.WriteLine ("Error at {0} values {1} and {2}", i, c1[i],
d1[i]);
}
}
}
}
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list