Author: atsushi
Date: 2006-01-20 11:56:36 -0500 (Fri, 20 Jan 2006)
New Revision: 55841
Modified:
branches/mono-1-1-13/mcs/class/corlib/System.Text/ChangeLog
branches/mono-1-1-13/mcs/class/corlib/System.Text/Decoder.cs
branches/mono-1-1-13/mcs/class/corlib/System.Text/Encoder.cs
branches/mono-1-1-13/mcs/class/corlib/System.Text/Encoding.cs
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/ChangeLog
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/DecoderReplacementFallbackBufferTest.cs
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/EncoderReplacementFallbackBufferTest.cs
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UTF7EncodingTest.cs
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UTF8EncodingTest.cs
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UnicodeEncodingTest.cs
Log:
merged r55794, r55795, r55823, r55830, r55832 and r55833 from trunk.
Modified: branches/mono-1-1-13/mcs/class/corlib/System.Text/ChangeLog
===================================================================
--- branches/mono-1-1-13/mcs/class/corlib/System.Text/ChangeLog 2006-01-20
16:38:49 UTC (rev 55840)
+++ branches/mono-1-1-13/mcs/class/corlib/System.Text/ChangeLog 2006-01-20
16:56:36 UTC (rev 55841)
@@ -1,3 +1,15 @@
+2006-01-20 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * Decoder.cs : ditto.
+
+2006-01-20 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * Encoder.cs : Fallback should be initialized to have an instance.
+
+2006-01-20 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * Encoding.cs : Cloned instances should not be read-only.
+
2005-12-08 Atsushi Enomoto <[EMAIL PROTECTED]>
* UTF8Encoding.cs : (GetChars) let ABCREM work effectively.
Modified: branches/mono-1-1-13/mcs/class/corlib/System.Text/Decoder.cs
===================================================================
--- branches/mono-1-1-13/mcs/class/corlib/System.Text/Decoder.cs
2006-01-20 16:38:49 UTC (rev 55840)
+++ branches/mono-1-1-13/mcs/class/corlib/System.Text/Decoder.cs
2006-01-20 16:56:36 UTC (rev 55841)
@@ -36,7 +36,7 @@
protected Decoder () {}
#if NET_2_0
- DecoderFallback fallback;
+ DecoderFallback fallback = new DecoderReplacementFallback ();
DecoderFallbackBuffer fallback_buffer;
public DecoderFallback Fallback {
Modified: branches/mono-1-1-13/mcs/class/corlib/System.Text/Encoder.cs
===================================================================
--- branches/mono-1-1-13/mcs/class/corlib/System.Text/Encoder.cs
2006-01-20 16:38:49 UTC (rev 55840)
+++ branches/mono-1-1-13/mcs/class/corlib/System.Text/Encoder.cs
2006-01-20 16:56:36 UTC (rev 55841)
@@ -36,7 +36,7 @@
protected Encoder() {}
#if NET_2_0
- EncoderFallback fallback;
+ EncoderFallback fallback = new EncoderReplacementFallback ();
EncoderFallbackBuffer fallback_buffer;
public EncoderFallback Fallback {
@@ -52,7 +52,7 @@
public EncoderFallbackBuffer FallbackBuffer {
get {
if (fallback_buffer == null)
- fallback_buffer = fallback.CreateFallbackBuffer
();
+ fallback_buffer = Fallback.CreateFallbackBuffer
();
return fallback_buffer;
}
}
Modified: branches/mono-1-1-13/mcs/class/corlib/System.Text/Encoding.cs
===================================================================
--- branches/mono-1-1-13/mcs/class/corlib/System.Text/Encoding.cs
2006-01-20 16:38:49 UTC (rev 55840)
+++ branches/mono-1-1-13/mcs/class/corlib/System.Text/Encoding.cs
2006-01-20 16:56:36 UTC (rev 55841)
@@ -504,7 +504,9 @@
public virtual object Clone ()
{
- return MemberwiseClone ();
+ Encoding e = (Encoding) MemberwiseClone ();
+ e.is_readonly = false;
+ return e;
}
public static Encoding GetEncoding (int codePage,
Modified: branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/ChangeLog
===================================================================
--- branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/ChangeLog
2006-01-20 16:38:49 UTC (rev 55840)
+++ branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/ChangeLog
2006-01-20 16:56:36 UTC (rev 55841)
@@ -1,3 +1,23 @@
+2006-01-20 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * UTF8EncodingTest.cs : added CloneNotReadOnly().
+
+2006-01-19 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * UnicodeEncodingTest.cs, DecoderReplacementFallbackBufferTest.cs,
+ EncoderReplacementFallbackBufferTest.cs : tests were fixed but
+ "NotWorking" were not marked correctly.
+
+2006-01-19 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * UTF7EncodingTest.cs UTF8EncodingTest.cs UnicodeEncodingTest.cs :
+ due to the introduction of fallback, some of their internals have
+ changed. Thus marked some tests as NotWorking.
+ * DecoderReplacementFallbackBufferTest.cs,
+ EncoderReplacementFallbackBufferTest.cs :
+ some behaviors have changed since beta2, so marked old tests as
+ NotWorking.
+
2005-12-05 Sebastien Pouliot <[EMAIL PROTECTED]>
* StringBuilderTest.cs: Test case MaxCapacity_Overflow3 doesn't work
Modified:
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/DecoderReplacementFallbackBufferTest.cs
===================================================================
---
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/DecoderReplacementFallbackBufferTest.cs
2006-01-20 16:38:49 UTC (rev 55840)
+++
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/DecoderReplacementFallbackBufferTest.cs
2006-01-20 16:56:36 UTC (rev 55841)
@@ -69,20 +69,21 @@
}
[Test]
+ [Category ("NotWorking")]
public void Iterate ()
{
Assert.AreEqual ('\0', Encoding.UTF8.DecoderFallback
.CreateFallbackBuffer ().GetNextChar (), "#1");
Buffer b = NewInstance ();
- Assert.AreEqual (1, b.Remaining, "#2");
- Assert.AreEqual ('?', b.GetNextChar (), "#3");
+// Assert.AreEqual (1, b.Remaining, "#2");
+// Assert.AreEqual ('?', b.GetNextChar (), "#3");
Assert.AreEqual (0, b.Remaining, "#4");
Assert.AreEqual ('\0', b.GetNextChar (), "#5");
- Assert.IsTrue (b.MovePrevious (), "#6");
- Assert.AreEqual (1, b.Remaining, "#7");
+// Assert.IsTrue (b.MovePrevious (), "#6");
+// Assert.AreEqual (1, b.Remaining, "#7");
Assert.IsFalse (b.MovePrevious (), "#8");
- Assert.AreEqual ('?', b.GetNextChar (), "#9");
+// Assert.AreEqual ('?', b.GetNextChar (), "#9");
}
}
}
Modified:
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/EncoderReplacementFallbackBufferTest.cs
===================================================================
---
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/EncoderReplacementFallbackBufferTest.cs
2006-01-20 16:38:49 UTC (rev 55840)
+++
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/EncoderReplacementFallbackBufferTest.cs
2006-01-20 16:56:36 UTC (rev 55841)
@@ -69,20 +69,21 @@
}
[Test]
+ [Category ("NotWorking")]
public void Iterate ()
{
Assert.AreEqual ('\0', Encoding.UTF8.EncoderFallback
.CreateFallbackBuffer ().GetNextChar (), "#1");
Buffer b = NewInstance ();
- Assert.AreEqual (1, b.Remaining, "#2");
- Assert.AreEqual ('?', b.GetNextChar (), "#3");
+// Assert.AreEqual (1, b.Remaining, "#2");
+// Assert.AreEqual ('?', b.GetNextChar (), "#3");
Assert.AreEqual (0, b.Remaining, "#4");
Assert.AreEqual ('\0', b.GetNextChar (), "#5");
- Assert.IsTrue (b.MovePrevious (), "#6");
- Assert.AreEqual (1, b.Remaining, "#7");
+// Assert.IsTrue (b.MovePrevious (), "#6");
+// Assert.AreEqual (1, b.Remaining, "#7");
Assert.IsFalse (b.MovePrevious (), "#8");
- Assert.AreEqual ('?', b.GetNextChar (), "#9");
+// Assert.AreEqual ('?', b.GetNextChar (), "#9");
}
}
}
Modified:
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UTF7EncodingTest.cs
===================================================================
--- branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UTF7EncodingTest.cs
2006-01-20 16:38:49 UTC (rev 55840)
+++ branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UTF7EncodingTest.cs
2006-01-20 16:56:36 UTC (rev 55841)
@@ -230,10 +230,17 @@
}
[Test]
+#if NET_2_0
+ [Category ("NotWorking")]
+#endif
public void TestMaxByteCount()
{
UTF7Encoding UTF7enc = new UTF7Encoding ();
+#if NET_2_0
+ Assertion.AssertEquals ("UTF #1", 152,
UTF7enc.GetMaxByteCount(50));
+#else
Assertion.AssertEquals ("UTF #1", 136,
UTF7enc.GetMaxByteCount(50));
+#endif
}
}
}
Modified:
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UTF8EncodingTest.cs
===================================================================
--- branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UTF8EncodingTest.cs
2006-01-20 16:38:49 UTC (rev 55840)
+++ branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UTF8EncodingTest.cs
2006-01-20 16:56:36 UTC (rev 55841)
@@ -93,17 +93,33 @@
}
[Test]
+#if NET_2_0
+ [Category ("NotWorking")]
+#endif
public void TestMaxCharCount()
{
UTF8Encoding UTF8enc = new UTF8Encoding ();
+#if NET_2_0
+ // hmm, where is this extra 1 coming from?
+ Assertion.AssertEquals ("UTF #1", 51,
UTF8enc.GetMaxCharCount(50));
+#else
Assertion.AssertEquals ("UTF #1", 50,
UTF8enc.GetMaxCharCount(50));
+#endif
}
[Test]
+#if NET_2_0
+ [Category ("NotWorking")]
+#endif
public void TestMaxByteCount()
{
UTF8Encoding UTF8enc = new UTF8Encoding ();
+#if NET_2_0
+ // maybe under .NET 2.0 insufficient surrogate pair is
just not handled, and 3 is Preamble size.
+ Assertion.AssertEquals ("UTF #1", 153,
UTF8enc.GetMaxByteCount(50));
+#else
Assertion.AssertEquals ("UTF #1", 200,
UTF8enc.GetMaxByteCount(50));
+#endif
}
// regression for bug #59648
@@ -690,6 +706,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void
T5_IllegalCodePosition_1_UTF16Surrogates_511 ()
@@ -701,6 +721,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_1_UTF16Surrogates_512 ()
@@ -712,6 +736,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_1_UTF16Surrogates_513 ()
@@ -723,6 +751,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_1_UTF16Surrogates_514 ()
@@ -734,6 +766,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_1_UTF16Surrogates_515 ()
@@ -745,6 +781,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_1_UTF16Surrogates_516 ()
@@ -756,6 +796,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_1_UTF16Surrogates_517 ()
@@ -767,6 +811,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_2_PairedUTF16Surrogates_521
()
@@ -779,6 +827,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_2_PairedUTF16Surrogates_522
()
@@ -791,6 +843,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_2_PairedUTF16Surrogates_523
()
@@ -803,6 +859,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_2_PairedUTF16Surrogates_524
()
@@ -815,6 +875,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_2_PairedUTF16Surrogates_525
()
@@ -827,6 +891,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_2_PairedUTF16Surrogates_526
()
@@ -839,6 +907,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_2_PairedUTF16Surrogates_527
()
@@ -851,6 +923,10 @@
}
[Test]
+#if NET_2_0
+ [ExpectedException (typeof (DecoderFallbackException))]
+ [Category ("NotWorking")]
+#endif
// MS Fx 1.1 accept this
// [ExpectedException (typeof (DecoderException))]
public void T5_IllegalCodePosition_2_PairedUTF16Surrogates_528
()
@@ -901,5 +977,16 @@
AssertEquals ("#1", '\uFEFF', chars [0]);
AssertEquals ("#2", 'A', chars [1]);
}
+
+#if NET_2_0
+ [Test]
+ public void CloneNotReadOnly ()
+ {
+ Encoding e = Encoding.GetEncoding (65001).Clone ()
+ as Encoding;
+ AssertEquals (false, e.IsReadOnly);
+ e.EncoderFallback = new EncoderExceptionFallback ();
+ }
+#endif
}
}
Modified:
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UnicodeEncodingTest.cs
===================================================================
---
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UnicodeEncodingTest.cs
2006-01-20 16:38:49 UTC (rev 55840)
+++
branches/mono-1-1-13/mcs/class/corlib/Test/System.Text/UnicodeEncodingTest.cs
2006-01-20 16:56:36 UTC (rev 55841)
@@ -136,17 +136,34 @@
}
[Test]
+#if NET_2_0
+ [Category ("NotWorking")]
+#endif
public void TestMaxCharCount()
{
UnicodeEncoding UnicodeEnc = new UnicodeEncoding ();
+#if NET_2_0
+ // where is this extra 1 coming from?
+ Assertion.AssertEquals ("UTF #1", 25,
UnicodeEnc.GetMaxCharCount(51));
+#else
Assertion.AssertEquals ("UTF #1", 25,
UnicodeEnc.GetMaxCharCount(50));
+#endif
}
[Test]
+#if NET_2_0
+ [Category ("NotWorking")]
+#endif
public void TestMaxByteCount()
{
UnicodeEncoding UnicodeEnc = new UnicodeEncoding ();
+#if NET_2_0
+ // is this extra 2 BOM?
+ Assertion.AssertEquals ("UTF #1", 102,
UnicodeEnc.GetMaxByteCount(50));
+#else
+ UnicodeEncoding UnicodeEnc = new UnicodeEncoding ();
Assertion.AssertEquals ("UTF #1", 100,
UnicodeEnc.GetMaxByteCount(50));
+#endif
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches