Browse Source

2008-06-11 Atsushi Enomoto <[email protected]>

	* XmlConvert.cs : no need for TARGET_JVM.

	* XmlConvertTests.cs : no need for TARGET_JVM. Fix wrong comparison.


svn path=/trunk/mcs/; revision=105558
Atsushi Eno 17 years ago
parent
commit
20aff136fb

+ 4 - 0
mcs/class/System.XML/System.Xml/ChangeLog

@@ -1,3 +1,7 @@
+2008-06-11  Atsushi Enomoto  <[email protected]>
+
+	* XmlConvert.cs : no need for TARGET_JVM.
+
 2008-06-09  Atsushi Enomoto  <[email protected]>
 
 	* XmlTextReader.cs : when Normalized is true, '<' after \r which

+ 0 - 8
mcs/class/System.XML/System.Xml/XmlConvert.cs

@@ -134,9 +134,7 @@ namespace System.Xml {
 		static readonly string [] roundtripDateTimeFormats;
 		static readonly string [] localDateTimeFormats;
 		static readonly string [] utcDateTimeFormats;
-#if TARGET_JVM
 		static readonly string [] unspecifiedDateTimeFormats;
-#endif
 
 		static XmlConvert ()
 		{
@@ -144,20 +142,16 @@ namespace System.Xml {
 			roundtripDateTimeFormats = new string [l];
 			localDateTimeFormats = new string [l];
 			utcDateTimeFormats = new string [l];
-#if TARGET_JVM
 			unspecifiedDateTimeFormats = new string [l * 4];
-#endif
 			for (int i = 0; i < l; i++) {
 				string s = defaultDateTimeFormats [i];
 				localDateTimeFormats [i] = s + "zzz";
 				roundtripDateTimeFormats [i] = s + 'K';
 				utcDateTimeFormats [i] = s + 'Z';
-#if TARGET_JVM
 				unspecifiedDateTimeFormats [i * 4] = s;
 				unspecifiedDateTimeFormats [i * 4 + 1] = localDateTimeFormats [i];
 				unspecifiedDateTimeFormats [i * 4 + 2] = roundtripDateTimeFormats [i];
 				unspecifiedDateTimeFormats [i * 4 + 3] = utcDateTimeFormats [i];
-#endif
 			}
 		}
 #endif
@@ -350,9 +344,7 @@ namespace System.Xml {
 				dt = ToDateTime (value, utcDateTimeFormats);
 				return dt == DateTime.MinValue || dt == DateTime.MaxValue ? dt : dt.ToUniversalTime ();
 			case XmlDateTimeSerializationMode.Unspecified:
-#if TARGET_JVM
 				return ToDateTime (value, unspecifiedDateTimeFormats);
-#endif
 			default:
 				return ToDateTime (value, defaultDateTimeFormats);
 			}

+ 4 - 0
mcs/class/System.XML/Test/System.Xml/ChangeLog

@@ -1,3 +1,7 @@
+2008-06-11  Atsushi Enomoto  <[email protected]>
+
+	* XmlConvertTests.cs : no need for TARGET_JVM. Fix wrong comparison.
+
 2008-06-09  Atsushi Enomoto  <[email protected]>
 
 	* XmlTextReaderTests.cs : added test for bug #398374.

+ 2 - 4
mcs/class/System.XML/Test/System.Xml/XmlConvertTests.cs

@@ -108,7 +108,7 @@ namespace MonoTests.System.Xml
 		}
 		
 		[Test]
-		public void ToDateTime ()//fails on Mono
+		public void ToDateTime ()
 		{
 			//dateTime
 			AssertEquals (632001798000000000L, XmlConvert.ToDateTime ("2003-09-26T13:30:00").Ticks);
@@ -628,13 +628,11 @@ namespace MonoTests.System.Xml
 			AssertType.AreEqual (DateTimeKind.Utc, XmlConvert.ToDateTime (s, XmlDateTimeSerializationMode.RoundtripKind).Kind, "#2-2");
 		}
 		
-#if TARGET_JVM
 		[Test]
-#endif
 		public void XmlDateTimeSerializationModeUnspecified ()
 		{
 			AssertEquals ("#1", 27, XmlConvert.ToString (new DateTime (DateTime.MaxValue.Ticks, DateTimeKind.Utc), XmlDateTimeSerializationMode.Unspecified).Length);
-			DateTime dt1 = XmlConvert.ToDateTime ("0001-02-03T10:20:30.0000+09:00", XmlDateTimeSerializationMode.Unspecified);
+			DateTime dt1 = XmlConvert.ToDateTime ("0001-02-03T10:20:30.0000+02:00", XmlDateTimeSerializationMode.Unspecified);
 			DateTime dt2 = XmlConvert.ToDateTime ("0001-02-03T10:20:30.0000", XmlDateTimeSerializationMode.Unspecified);
 			AssertEquals ("#2", false, dt1 == dt2);
 			XmlConvert.ToDateTime ("2006-05-30T09:48:32.0Z", XmlDateTimeSerializationMode.Unspecified);