[Mono-dev] Regression in String tests

Roei Erez roeie at mainsoft.com
Tue Mar 6 03:07:45 EST 2007


Yes, I you are right, I will fix the test. 

-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Jamie
Cansdale
Sent: Tuesday, March 06, 2007 10:04 AM
To: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-dev] Regression in String tests

>                          PropertyInfo[] props =
typeof(String).GetProperties();
>                          AssertEquals(props[0].Name, "Chars");
>                          AssertEquals(props[1].Name, "Length");

I'm curious it know what this is testing for. I thought the ordering of
reflected members was explicitly not guaranteed. IIRC there was talk of
returning them in random order in .NET 2.0 to discourage this kind of
dependency.

Thanks, Jamie.

--
http://www.testdriven.net
http://weblogs.asp.net/nunitaddin



On 3/6/07, Atsushi Eno <atsushi at ximian.com> wrote:
> It is not a regression. Actually the test is quite odd.
>
>                  [Test]
>                  public void StringProperties()
>                  {
>                          PropertyInfo[] props =
typeof(String).GetProperties();
>                          AssertEquals(props[0].Name, "Chars");
>                          AssertEquals(props[1].Name, "Length");
>                  }
>
> I'll revert r73699.
>
> Atsushi Eno
>
> Miguel de Icaza wrote:
> > I just noticed this while running the corlib tests:
> >
> > Failures:
> > 1) MonoTests.System.StringTest.StringProperties :
> >         String lengths differ.  Expected length=6, but was length=5.
> >         Strings differ at index 0.
> >
> >         expected:<"Length">
> >          but was:<"Chars">
> >         -----------^
> >
> >   at MonoTests.System.StringTest.StringProperties () [0x00010] in 
> > /home/cvs/mcs/class/corlib/Test/System/StringTest.cs:1807
> >   at <0x00000> <unknown method>
> >   at (wrapper managed-to-native)
> > System.Reflection.MonoMethod:InternalInvoke (object,object[])
> >   at System.Reflection.MonoMethod.Invoke (System.Object obj, 
> > BindingFlags invokeAttr, System.Reflection.Binder binder, 
> > System.Object[] parameters, System.Globalization.CultureInfo 
> > culture) [0x00040] in 
> > /home/cvs/mcs/class/corlib/System.Reflection/MonoMethod.cs:143
> >
> >
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list