Author: atsushi
Date: 2006-04-25 12:43:57 -0400 (Tue, 25 Apr 2006)
New Revision: 59860

Modified:
   trunk/mcs/class/System/System.ComponentModel/BaseNumberConverter.cs
   trunk/mcs/class/System/System.ComponentModel/ChangeLog
   trunk/mcs/class/System/Test/System.ComponentModel/ByteConverterTests.cs
   trunk/mcs/class/System/Test/System.ComponentModel/ChangeLog
   trunk/mcs/class/System/Test/System.ComponentModel/DecimalConverterTests.cs
   trunk/mcs/class/System/Test/System.ComponentModel/DoubleConverterTests.cs
   trunk/mcs/class/System/Test/System.ComponentModel/Int16ConverterTests.cs
   trunk/mcs/class/System/Test/System.ComponentModel/Int64ConverterTests.cs
   trunk/mcs/class/System/Test/System.ComponentModel/SByteConverterTests.cs
   trunk/mcs/class/System/Test/System.ComponentModel/SingleConverterTests.cs
   trunk/mcs/class/System/Test/System.ComponentModel/UInt16ConverterTests.cs
   trunk/mcs/class/System/Test/System.ComponentModel/UInt32ConverterTests.cs
   trunk/mcs/class/System/Test/System.ComponentModel/UInt64ConverterTests.cs
Log:
2006-04-25  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * BaseNumberConverter.cs : (ConvertTo) regardless of InnerType,
          it converts the argument value to InnerType using supplied format.
          (It might be not limited to NET_2_0 but it's too cosmetic to dig
          into the problem. At least this is for run-test-ondotnet fixes.)

        * ByteConverterTests.cs,
          DecimalConverterTests.cs,
          DoubleConverterTests.cs,
          Int16ConverterTests.cs,
          Int64ConverterTests.cs,
          SByteConverterTests.cs,
          SingleConverterTests.cs,
          UInt16ConverterTests.cs,
          UInt32ConverterTests.cs,
          UInt64ConverterTests.cs:
          ConvertToString() (test with custom culture) failed on .NET 2.0.
          Fixed it by adding NumberFormat override in each test culture.



Modified: trunk/mcs/class/System/System.ComponentModel/BaseNumberConverter.cs
===================================================================
--- trunk/mcs/class/System/System.ComponentModel/BaseNumberConverter.cs 
2006-04-25 16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/System.ComponentModel/BaseNumberConverter.cs 
2006-04-25 16:43:57 UTC (rev 59860)
@@ -100,10 +100,15 @@
                        if (culture == null)
                                culture = CultureInfo.CurrentCulture;
 
+#if NET_2_0
+                       if (destinationType == typeof (string) && value is 
IConvertible)
+                               return ((IConvertible) value).ToType 
(destinationType, culture);
+#else
                        if (destinationType == typeof (string) && value.GetType 
() == InnerType) {
                                NumberFormatInfo numberFormatInfo = 
(NumberFormatInfo) culture.GetFormat (typeof (NumberFormatInfo));
                                return ConvertToString (value, 
numberFormatInfo);
                        }
+#endif
 
                        return base.ConvertTo (context, culture, value, 
destinationType);
                }

Modified: trunk/mcs/class/System/System.ComponentModel/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.ComponentModel/ChangeLog      2006-04-25 
16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/System.ComponentModel/ChangeLog      2006-04-25 
16:43:57 UTC (rev 59860)
@@ -1,3 +1,10 @@
+2006-04-25  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * BaseNumberConverter.cs : (ConvertTo) regardless of InnerType,
+         it converts the argument value to InnerType using supplied format.
+         (It might be not limited to NET_2_0 but it's too cosmetic to dig
+         into the problem. At least this is for run-test-ondotnet fixes.)
+
 2006-04-17  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * BackgroundWorker.cs, RunWorkerCompletedEventArgs.cs :

Modified: 
trunk/mcs/class/System/Test/System.ComponentModel/ByteConverterTests.cs
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/ByteConverterTests.cs     
2006-04-25 16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/Test/System.ComponentModel/ByteConverterTests.cs     
2006-04-25 16:43:57 UTC (rev 59860)
@@ -534,6 +534,19 @@
                                        return base.GetFormat (formatType);
                                }
                        }
+
+#if NET_2_0
+// adding this override in 1.x shows different result in .NET (it is ignored).
+// Some compatibility kids might want to fix this issue.
+                       public override NumberFormatInfo NumberFormat {
+                               get {
+                                       NumberFormatInfo nfi = 
(NumberFormatInfo) base.NumberFormat.Clone ();
+                                       nfi.NegativeSign = "myNegativeSign";
+                                       return nfi;
+                               }
+                               set { throw new NotSupportedException (); }
+                       }
+#endif
                }
        }
 }

Modified: trunk/mcs/class/System/Test/System.ComponentModel/ChangeLog
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/ChangeLog 2006-04-25 
16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/Test/System.ComponentModel/ChangeLog 2006-04-25 
16:43:57 UTC (rev 59860)
@@ -1,3 +1,18 @@
+2006-04-25  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * ByteConverterTests.cs,
+         DecimalConverterTests.cs,
+         DoubleConverterTests.cs,
+         Int16ConverterTests.cs,
+         Int64ConverterTests.cs,
+         SByteConverterTests.cs,
+         SingleConverterTests.cs,
+         UInt16ConverterTests.cs,
+         UInt32ConverterTests.cs,
+         UInt64ConverterTests.cs:
+         ConvertToString() (test with custom culture) failed on .NET 2.0.
+         Fixed it by adding NumberFormat override in each test culture.
+
 2006-03-11 Gert Driesen <[EMAIL PROTECTED]>
 
        * TypeDescriptorTests.cs: Added test for bug #76686.

Modified: 
trunk/mcs/class/System/Test/System.ComponentModel/DecimalConverterTests.cs
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/DecimalConverterTests.cs  
2006-04-25 16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/Test/System.ComponentModel/DecimalConverterTests.cs  
2006-04-25 16:43:57 UTC (rev 59860)
@@ -367,6 +367,19 @@
                                        return base.GetFormat (formatType);
                                }
                        }
+
+#if NET_2_0
+// adding this override in 1.x shows different result in .NET (it is ignored).
+// Some compatibility kids might want to fix this issue.
+                       public override NumberFormatInfo NumberFormat {
+                               get {
+                                       NumberFormatInfo nfi = 
(NumberFormatInfo) base.NumberFormat.Clone ();
+                                       nfi.NegativeSign = "myNegativeSign";
+                                       return nfi;
+                               }
+                               set { throw new NotSupportedException (); }
+                       }
+#endif
                }
        }
 }

Modified: 
trunk/mcs/class/System/Test/System.ComponentModel/DoubleConverterTests.cs
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/DoubleConverterTests.cs   
2006-04-25 16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/Test/System.ComponentModel/DoubleConverterTests.cs   
2006-04-25 16:43:57 UTC (rev 59860)
@@ -367,6 +367,19 @@
                                        return base.GetFormat (formatType);
                                }
                        }
+
+#if NET_2_0
+// adding this override in 1.x shows different result in .NET (it is ignored).
+// Some compatibility kids might want to fix this issue.
+                       public override NumberFormatInfo NumberFormat {
+                               get {
+                                       NumberFormatInfo nfi = 
(NumberFormatInfo) base.NumberFormat.Clone ();
+                                       nfi.NegativeSign = "myNegativeSign";
+                                       return nfi;
+                               }
+                               set { throw new NotSupportedException (); }
+                       }
+#endif
                }
        }
 }

Modified: 
trunk/mcs/class/System/Test/System.ComponentModel/Int16ConverterTests.cs
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/Int16ConverterTests.cs    
2006-04-25 16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/Test/System.ComponentModel/Int16ConverterTests.cs    
2006-04-25 16:43:57 UTC (rev 59860)
@@ -570,6 +570,19 @@
                                        return base.GetFormat (formatType);
                                }
                        }
+
+#if NET_2_0
+// adding this override in 1.x shows different result in .NET (it is ignored).
+// Some compatibility kids might want to fix this issue.
+                       public override NumberFormatInfo NumberFormat {
+                               get {
+                                       NumberFormatInfo nfi = 
(NumberFormatInfo) base.NumberFormat.Clone ();
+                                       nfi.NegativeSign = "myNegativeSign";
+                                       return nfi;
+                               }
+                               set { throw new NotSupportedException (); }
+                       }
+#endif
                }
        }
 }

Modified: 
trunk/mcs/class/System/Test/System.ComponentModel/Int64ConverterTests.cs
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/Int64ConverterTests.cs    
2006-04-25 16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/Test/System.ComponentModel/Int64ConverterTests.cs    
2006-04-25 16:43:57 UTC (rev 59860)
@@ -265,6 +265,19 @@
                                        return base.GetFormat (formatType);
                                }
                        }
+
+#if NET_2_0
+// adding this override in 1.x shows different result in .NET (it is ignored).
+// Some compatibility kids might want to fix this issue.
+                       public override NumberFormatInfo NumberFormat {
+                               get {
+                                       NumberFormatInfo nfi = 
(NumberFormatInfo) base.NumberFormat.Clone ();
+                                       nfi.NegativeSign = "myNegativeSign";
+                                       return nfi;
+                               }
+                               set { throw new NotSupportedException (); }
+                       }
+#endif
                }
        }
 }

Modified: 
trunk/mcs/class/System/Test/System.ComponentModel/SByteConverterTests.cs
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/SByteConverterTests.cs    
2006-04-25 16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/Test/System.ComponentModel/SByteConverterTests.cs    
2006-04-25 16:43:57 UTC (rev 59860)
@@ -264,6 +264,19 @@
                                        return base.GetFormat (formatType);
                                }
                        }
+
+#if NET_2_0
+// adding this override in 1.x shows different result in .NET (it is ignored).
+// Some compatibility kids might want to fix this issue.
+                       public override NumberFormatInfo NumberFormat {
+                               get {
+                                       NumberFormatInfo nfi = 
(NumberFormatInfo) base.NumberFormat.Clone ();
+                                       nfi.NegativeSign = "myNegativeSign";
+                                       return nfi;
+                               }
+                               set { throw new NotSupportedException (); }
+                       }
+#endif
                }
        }
 }

Modified: 
trunk/mcs/class/System/Test/System.ComponentModel/SingleConverterTests.cs
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/SingleConverterTests.cs   
2006-04-25 16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/Test/System.ComponentModel/SingleConverterTests.cs   
2006-04-25 16:43:57 UTC (rev 59860)
@@ -234,6 +234,19 @@
                                        return base.GetFormat (formatType);
                                }
                        }
+
+#if NET_2_0
+// adding this override in 1.x shows different result in .NET (it is ignored).
+// Some compatibility kids might want to fix this issue.
+                       public override NumberFormatInfo NumberFormat {
+                               get {
+                                       NumberFormatInfo nfi = 
(NumberFormatInfo) base.NumberFormat.Clone ();
+                                       nfi.NegativeSign = "myNegativeSign";
+                                       return nfi;
+                               }
+                               set { throw new NotSupportedException (); }
+                       }
+#endif
                }
        }
 }

Modified: 
trunk/mcs/class/System/Test/System.ComponentModel/UInt16ConverterTests.cs
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/UInt16ConverterTests.cs   
2006-04-25 16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/Test/System.ComponentModel/UInt16ConverterTests.cs   
2006-04-25 16:43:57 UTC (rev 59860)
@@ -245,6 +245,18 @@
                                        return base.GetFormat (formatType);
                                }
                        }
+#if NET_2_0
+// adding this override in 1.x shows different result in .NET (it is ignored).
+// Some compatibility kids might want to fix this issue.
+                       public override NumberFormatInfo NumberFormat {
+                               get {
+                                       NumberFormatInfo nfi = 
(NumberFormatInfo) base.NumberFormat.Clone ();
+                                       nfi.NegativeSign = "myNegativeSign";
+                                       return nfi;
+                               }
+                               set { throw new NotSupportedException (); }
+                       }
+#endif
                }
        }
 }

Modified: 
trunk/mcs/class/System/Test/System.ComponentModel/UInt32ConverterTests.cs
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/UInt32ConverterTests.cs   
2006-04-25 16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/Test/System.ComponentModel/UInt32ConverterTests.cs   
2006-04-25 16:43:57 UTC (rev 59860)
@@ -231,6 +231,18 @@
                                        return base.GetFormat (formatType);
                                }
                        }
+#if NET_2_0
+// adding this override in 1.x shows different result in .NET (it is ignored).
+// Some compatibility kids might want to fix this issue.
+                       public override NumberFormatInfo NumberFormat {
+                               get {
+                                       NumberFormatInfo nfi = 
(NumberFormatInfo) base.NumberFormat.Clone ();
+                                       nfi.NegativeSign = "myNegativeSign";
+                                       return nfi;
+                               }
+                               set { throw new NotSupportedException (); }
+                       }
+#endif
                }
        }
 }

Modified: 
trunk/mcs/class/System/Test/System.ComponentModel/UInt64ConverterTests.cs
===================================================================
--- trunk/mcs/class/System/Test/System.ComponentModel/UInt64ConverterTests.cs   
2006-04-25 16:32:25 UTC (rev 59859)
+++ trunk/mcs/class/System/Test/System.ComponentModel/UInt64ConverterTests.cs   
2006-04-25 16:43:57 UTC (rev 59860)
@@ -254,6 +254,19 @@
                                        return base.GetFormat (formatType);
                                }
                        }
+
+#if NET_2_0
+// adding this override in 1.x shows different result in .NET (it is ignored).
+// Some compatibility kids might want to fix this issue.
+                       public override NumberFormatInfo NumberFormat {
+                               get {
+                                       NumberFormatInfo nfi = 
(NumberFormatInfo) base.NumberFormat.Clone ();
+                                       nfi.NegativeSign = "myNegativeSign";
+                                       return nfi;
+                               }
+                               set { throw new NotSupportedException (); }
+                       }
+#endif
                }
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to