[Mono-bugs] [Bug 41522][Nor] Changed - Enum.Format Improper Formats

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Wed, 30 Apr 2003 13:12:27 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by r.h.lee@attbi.com.

http://bugzilla.ximian.com/show_bug.cgi?id=41522

--- shadow/41522	Wed Apr 30 10:44:06 2003
+++ shadow/41522.tmp.15842	Wed Apr 30 13:12:27 2003
@@ -1,13 +1,13 @@
 Bug#: 41522
 Product: Mono/Class Libraries
 Version: unspecified
 OS: unknown
 OS Details: 
-Status: CLOSED   
-Resolution: FIXED
+Status: REOPENED   
+Resolution: 
 Severity: Unknown
 Priority: Normal
 Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: r.h.lee@attbi.com               
 QAContact: mono-bugs@ximian.com
@@ -70,6 +70,49 @@
 Fixed in CVS.
 
 Thanks for reporting!
 
 ------- Additional Comments From r.h.lee@attbi.com  2003-04-30 10:44 -------
 [Wed Apr 30 07:43:10] Cvs Ok
+
+------- Additional Comments From r.h.lee@attbi.com  2003-04-30 13:12 -------
+The following bugs were isolated:
+
+using System;
+using NUnit.Framework;
+
+[TestFixture]
+public class EnumFormatBug {
+	enum E {A=0,B=1,C=2,D=3,}
+	enum UE : ulong {A=1,B=2,C=3,D=4,} 
+	enum EA {A=0, B=2, C=3, D=4}
+	
+	[Test]
+	public void AnotherFormatBugPinned () {
+		Assertion.AssertEquals ("TC-007fx", "100",
+			Enum.Format ( typeof(E), 100, "f"));
+	}
+	
+	[Test]
+	public void LogicBugPinned () {
+		//build flags
+		string format=null;
+		string[] names=new string[] {"A","B","C","D",};
+		string[] fmtSpl=null;
+		UE ue=UE.A|UE.B|UE.C|UE.D;
+		
+		//all flags must be in format return
+		format=Enum.Format ( typeof( UE ), ue, "f" );
+		fmtSpl=format.Split (',');
+		for( int i=0 ; i<fmtSpl.Length ; ++i )
+			fmtSpl[i]=fmtSpl[i].Trim();
+		foreach( string nval in fmtSpl )
+			Assertion.Assert( nval + " is not a valid enum value name",
+					Array.IndexOf( names, nval )>=0 );
+		foreach( string nval in names )
+			Assertion.Assert( nval + " is not contained in format return.",
+					Array.IndexOf( fmtSpl, nval )>=0 );
+	}
+}
+
+Note: In Enum.cs with a "bool first" line: 534, 586, 620.
+586 and 620 are related.