[Mono-bugs] [Bug 77252][Nor] New - XmlConvert.ToString( TimeSpan t ) ignores the TimeSpan Tick value

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Jan 13 20:40:08 EST 2006


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 olynch at fnfr.com.

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

--- shadow/77252	2006-01-13 20:40:08.000000000 -0500
+++ shadow/77252.tmp.30009	2006-01-13 20:40:08.000000000 -0500
@@ -0,0 +1,66 @@
+Bug#: 77252
+Product: Mono: Class Libraries
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: Fedora Core 4
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com                            
+ReportedBy: olynch at fnfr.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlConvert.ToString( TimeSpan t ) ignores the TimeSpan Tick value
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+XmlConvert.ToString( TimeSpan t ) ignores the TimeSpan Tick value
+
+Steps to reproduce the problem:
+1. 
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace XmlConvertBug
+{
+    class Program
+    {
+        /// <summary>
+        /// Mono XmlConvert.ToString() ignores TimeSpan ticks
+        /// </summary>
+        /// <param name="args"></param>
+        static void Main(string[] args)
+        {
+            TimeSpan t1 = TimeSpan.FromTicks( TimeSpan.TicksPerSecond + 
+1 );
+            string s = XmlConvert.ToString(t1);
+            TimeSpan t2 = XmlConvert.ToTimeSpan(s);
+            if( t1.Equals(t2) )
+                Console.WriteLine( "XmlConvert.ToString(TimeSpan.FromTicks
+(1)) works properly" );
+            else
+                Console.WriteLine("XmlConvert.ToString(TimeSpan.FromTicks
+(1)) has a bug");
+        }
+    }
+} 
+
+Actual Results:
+XmlConvert.ToString(TimeSpan.FromTicks(1)) has a bug
+
+Expected Results:
+XmlConvert.ToString(TimeSpan.FromTicks(1)) works properly
+
+How often does this happen? 
+Always
+
+Additional Information:
+Inspection of string s = XmlConvert.ToString(TimeSpan.FromTicks(1)) shows 
+the bug clearly.


More information about the mono-bugs mailing list