[Mono-bugs] [Bug 25074] New - Convert.ToByte(string, base) should throw OverflowException

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
21 May 2002 18:59:55 -0000


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 ds99krha@thn.htu.se.

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

--- shadow/25074	Tue May 21 14:59:55 2002
+++ shadow/25074.tmp.2097	Tue May 21 14:59:55 2002
@@ -0,0 +1,41 @@
+Bug#: 25074
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: win2k/cygwin
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ds99krha@thn.htu.se               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: Convert.ToByte(string, base) should throw OverflowException
+
+Description of Problem:
+This should throw OverflowException 
+
+Convert.ToByte("3F3", 16)
+
+since "3F3" is equal to 1011 and byte.MaxValue is 255.
+
+Steps to reproduce the problem:
+1. Run the code
+
+Console.WriteLine(Convert.ToByte("3F3", 16)); 
+
+Actual Results:
+243
+
+Expected Results:
+OverflowException
+
+How often does this happen? 
+All the time
+
+Additional Information:
+The hexadecimal value "3F3" is 1011 in decimal form. If you take 1011-
+256*3 you get 243. When getting to byte.MaxValue it just starts over.