Commit Graph
66 Commits
Author SHA1 Message Date
Sebastien Pouliot 07efc64d03 In System:
2009-10-27  Sebastien Pouliot  <[email protected]>

	* String.cs: Remove unused (and unneeded) internal call defs.
	Reduce duplication (and fix test) for Concat (object,object).
	Avoid allocating zero-length strings in the cases where the
	FX does not do so.

In Test/System.Text:
2009-10-27  Sebastien Pouliot  <[email protected]>

	* UnicodeEncodingTest.cs: Add test cases with an odd number of 
	bytes being used in GetString (it does not crash but it does not
	work like MS FX either).

In Test/System:
2009-10-27  Sebastien Pouliot  <[email protected]>

	* StringTest.cs: Add test case for methods that can return
	empty strings.

In System.Globalization:
2009-10-27  Sebastien Pouliot  <[email protected]>

	* TextInfo.cs: Avoid allocating zero-length strings in ToLower 
	and ToUpper methods


svn path=/trunk/mcs/; revision=144921
2009-10-27 23:42:55 +00:00
Gonzalo Paniagua Javier 32ce184cba 2009-09-12 Gonzalo Paniagua Javier <[email protected]>
* StringBuilderTest.cs: new test.


svn path=/trunk/mcs/; revision=141859
2009-09-13 02:44:02 +00:00
Gonzalo Paniagua Javier 885b9f9f7e 2009-07-26 Gonzalo Paniagua Javier <[email protected]>
* StringBuilderTest.cs: new overflow tests.


svn path=/trunk/mcs/; revision=138688
2009-07-26 16:27:07 +00:00
Robert Jordan a5b5163351 2009-06-26 Robert Jordan <[email protected]>
* UTF8EncodingTest.cs: Fix the NET_1_1 build.


svn path=/trunk/mcs/; revision=137012
2009-06-26 21:53:51 +00:00
Zoltan Varga 67b04fd53a 2009-06-26 Zoltan Varga <[email protected]>
* *.cs: Convert all tests to new-style nunit classes/methods. Add
	[Test] attributes to some tests which were missing them.

svn path=/trunk/mcs/; revision=136944
2009-06-26 11:16:10 +00:00
Gert Driesen 81ef506280 * UTF32EncodingTest.cs: Added tests for GetByteCount overloads.
svn path=/trunk/mcs/; revision=125864
2009-02-05 14:56:52 +00:00
Atsushi Eno 3ef06e62ed 2009-01-30 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : surrogate characters are handled in 
	  InternalGetChars() but not in InternalGetCharCount().
	  Fixed bug #415628.

	* UTF8EncodingTest.cs : added test for bug #415628.

	* 415628.bin : new test resource.

	* Makefile: new resource, new EXTRA_DIST mess.


svn path=/trunk/mcs/; revision=125075
2009-01-30 12:13:56 +00:00
Jb Evain 37111e4f26 in System.Text:
2009-01-13  Jb Evain  <[email protected]>

	* Encoding.cs: when creating a ForwardingEncoder or a
	ForwardingDecoder, don't crash if the Encoding doesn't
	provide an EncoderFallback or a DecoderFallback.

in Test/System.Text:
2009-01-13  Jb Evain  <[email protected]>

	* EncoderTest.cs: Make sure we can get an encoder for a custom
	encoding.
	* DecoderTest.cs: ditto.

svn path=/trunk/mcs/; revision=123196
2009-01-13 15:25:45 +00:00
Atsushi Eno c12917a979 2008-04-09 Atsushi Enomoto <[email protected]>
* UTF7Encoding.cs :
	  Fixed misplaced leftOverSize reset in InternalGetCharCount().
	  Fixed base64 value for '+' (the value is actually unused though).

	* UTF7EncodingTest.cs : added test for broken GetCharCount() case.


svn path=/trunk/mcs/; revision=100197
2008-04-09 07:11:59 +00:00
Atsushi Eno 646393c59c 2007-12-27 Atsushi Enomoto <[email protected]>
* DecoderFallback.cs, EncoderFallback.cs, Encoding.cs :
	  the same "\uFFFD" fix for encoder fallback.
	  Reduced extra instantiation of those fallbacks.

	* EncoderReplacementFallbackTest.cs,
	  EncoderReplacementFallbackBufferTest.cs : encoder test for
	  "\uFFFD" replacement.


svn path=/trunk/mcs/; revision=91947
2007-12-27 16:04:57 +00:00
Atsushi Eno 1ab79d0289 2007-10-26 Atsushi Enomoto <[email protected]>
* UTF8EncodingTest.cs : looks like the issue is not fixed in .NET 1.x
	  and hence it looked like a regression. (It wasn't.)


svn path=/trunk/mcs/; revision=88248
2007-10-26 04:19:51 +00:00
Atsushi Eno f4071fef2b 2007-10-25 Atsushi Enomoto <[email protected]>
* DecoderReplacementFallbackBuffer.cs : Reset() should also reset the
	  input buffer. When fallback is not assigned, just return '\0'.
	* UnicodeEncoding.cs : handle throwOnInvalid .ctor argument.
	  Default replacement fallback buffer is now "\uFFFD".
	* UTF8Encoding.cs : couple of replacement buffer size fixes.
	  Default replacement fallback buffer is now "\uFFFD".
	* UTF32Encoding.cs : Default replacement is "\uFFFD" too here.
	  See http://support.microsoft.com/kb/940521/ for this change.

	* UnicodeEncodingTest.cs,
	  UTF8EncodingTest.cs,
	  DecoderReplacementFallbackBufferTest.cs,
	  DecoderReplacementFallbackTest.cs : default replacement buffer fix.
	  Added test for Reset() for replacement buffer.


svn path=/trunk/mcs/; revision=88150
2007-10-25 09:42:03 +00:00
Gert Driesen 797ad860d5 * UTF8Encoding.cs: IsMailNewsSave should return true. Fixes bug
#332515.
* UTF32Encoding.cs: IsBrowserSave returns false for both Big-Endian and
Little-Endian.
* TestEncoding.cs: Also make class available on 1.0 profile.
* EncodingTest.cs: Added tests for Is* properties.
* UTF7EncodingTest.cs: Added tests for Is* properties.
* UnicodeEncodingTest.cs: Added tests for Is* properties. Fixed 
line endings.
* UTF8EncodingTest.cs: Added tests for Is* properties. Spaces to
tabs. Numbered tests.
* ASCIIEncodingTest.cs: Added tests for Is* properties. No longer
derive from TestCase class. Spaces to tabs.    
* UTF32EncodingTest.cs: Added tests for Is* properties. No longer
derive from deprecated Assertion class.

svn path=/trunk/mcs/; revision=87593
2007-10-16 14:48:47 +00:00
Gert Driesen decc14ec8d * DecoderReplacementFallbackTest.cs: Fixed DontChangeReadOnlyCodePage-
DecoderFallback test to pass on systems where codepage 932 is valid.
Assert that exception is thrown by DecoderFallback property.
* EncoderReplacementFallbackTest.cs: Fixed DontChangeReadOnlyCodePage-
EncoderFallback test to pass on systems where codepage 932 is valid.
Assert that exception is thrown by EncoderFallback property.

svn path=/trunk/mcs/; revision=81463
2007-07-06 11:46:57 +00:00
Marek Habersack 6e5bd19fbd 2007-04-19 Marek Habersack <[email protected]>
* DecoderReplacementFallbackTest.cs: expect the correct
	exception.


svn path=/trunk/mcs/; revision=75962
2007-04-19 16:20:42 +00:00
Gert Driesen 5aa45b37f3 * Encoding.cs: Enabled ArgumentException in GetEncoding (string) again.
In Encoding.Default, catch both ArgumentException and NotSupportException.
* EncodingTest.cs: Enabled test again.

svn path=/trunk/mcs/; revision=72130
2007-02-01 20:06:07 +00:00
Atsushi Eno bb68bac1cb 2007-02-01 Atsushi Enomoto <[email protected]>
* Encoding.cs : the change broke the build, so reverted part of it.

	* EncodingTest.cs :
	  reverted part of the related patch, thus added NotWorking.


svn path=/trunk/mcs/; revision=72087
2007-02-01 12:43:52 +00:00
Gert Driesen 4f954982a9 * Encoding.cs: Also set ParamName of the ArgumentException.
* EncodingTest.cs: Improved test for not-supported encoding.

svn path=/trunk/mcs/; revision=72057
2007-01-31 22:22:48 +00:00
Gert Driesen dc13e6c1f5 * EncodingTest.cs: Added tests for GetEncoding.
* Encoding.cs: In GetEncoding (int) do not allow codepage value below zero
and above 0xffff. Modified NotSupportedException to ArgumentException in
GetEncoding (string).
 * corlib_test.dll.sources: Added EncodingTest.cs.

svn path=/trunk/mcs/; revision=72052
2007-01-31 20:58:30 +00:00
Kornél Pál 628c615df2 ASCIIEncodingTest.cs: Added TestGetString3 test.
svn path=/trunk/mcs/; revision=62704
2006-07-18 14:44:07 +00:00
Kornél Pál 55747d218d StringBuilder.cs: Pad the string with NULL characters when setting Length.
svn path=/trunk/mcs/; revision=62421
2006-07-11 00:55:09 +00:00
Kornél Pál 1449d61f23 UnicodeEncodingTest.cs: Added ByteOrderMark tests.
svn path=/trunk/mcs/; revision=62009
2006-06-24 13:39:30 +00:00
Atsushi Eno f943aba680 2006-05-25 Atsushi Enomoto <[email protected]>
* corlib_test.dll.sources : added EncodingInfoTest.cs.

	* EncodingInfo.cs, Encoding.cs :
	  Implemented Encoding.GetEncodings(). It's so hacky!

	* EncodingInfoTest.cs : new TestFixture.


svn path=/trunk/mcs/; revision=61128
2006-05-25 16:51:36 +00:00
Atsushi Eno 8e3081f83f 2006-04-13 Atsushi Enomoto <[email protected]>
* ASCIIEncoding.cs : 2.0 decoder fallback support was missing.

        * ASCIIEncodingTest.cs : added DecoderFallback().


svn path=/trunk/mcs/; revision=59434
2006-04-13 08:14:42 +00:00
Atsushi Eno 20ef4631cf 2006-03-30 Atsushi Enomoto <[email protected]>
* Encoder.cs, Decoder.cs : implemented Convert(). Also added argument
	  check in some methods.

	* EncoderTest.cs, DecoderTest.cs : new tests, for Convert().

	* corlib_test.dll.sources: added EncoderTest.cs and DecoderTest.cs.


svn path=/trunk/mcs/; revision=58819
2006-03-30 19:08:18 +00:00
Atsushi Eno ce4d8a502d 2006-02-14 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : Fallback was indicating incorrect index.
	  Fixed bug #77550.

	* UTF8EncodingTest.cs : test for bug #77550.


svn path=/trunk/mcs/; revision=56848
2006-02-14 10:31:51 +00:00
Atsushi Eno e85a1fe77c 2006-02-03 Atsushi Enomoto <[email protected]>
* UTF8Encoding.cs : In zero-charbuffer case, byte buffer count should
	  be checked. Also it should not ignore leftOver characters even if
	  byte buffer length is 0.

	* UTF8EncodingTest.cs : added test for insufficient bytes for
	  flush=true and leftOver!='\0' case.


svn path=/trunk/mcs/; revision=56533
2006-02-03 16:54:56 +00:00
Atsushi Eno fb852c038d 2006-01-24 Atsushi Enomoto <[email protected]>
* UTF7Encoding.cs UTF8Encoding.cs :
	  Fixed bug #77315 (Patch by [email protected]).
	  Make strict check for invalid surrogate.

	* UTF7EncodingTest.cs : added test for bug #77315.
	* UTF8EncodingTest.cs : added test for bug #77315. Also, now a
	  bunch of tests are working (while they are marked as NotDotNet
	  under 1.1 profile).


svn path=/trunk/mcs/; revision=55971
2006-01-24 07:53:12 +00:00
Raja R Harinath ec321852f1 * UnicodeEncodingTest.cs (TestMaxByteCount): Remove extra declaration.
svn path=/trunk/mcs/; revision=55830
2006-01-20 12:49:51 +00:00
Atsushi Eno 3c311bcdc0 2006-01-20 Atsushi Enomoto <[email protected]>
* Encoding.cs : Cloned instances should not be read-only.

	* UTF8EncodingTest.cs : added CloneNotReadOnly().


svn path=/trunk/mcs/; revision=55823
2006-01-20 08:21:53 +00:00
Atsushi Eno f8d58865f5 2006-01-19 Atsushi Enomoto <[email protected]>
* UnicodeEncodingTest.cs, DecoderReplacementFallbackBufferTest.cs,
	  EncoderReplacementFallbackBufferTest.cs : tests were fixed but
	  "NotWorking" were not marked correctly.


svn path=/trunk/mcs/; revision=55795
2006-01-19 17:32:07 +00:00
Atsushi Eno 37c22e54fb 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.


svn path=/trunk/mcs/; revision=55794
2006-01-19 17:08:13 +00:00
Sebastien Pouliot abfdd1fe9f 2005-12-05 Sebastien Pouliot <[email protected]>
* StringBuilderTest.cs: Test case MaxCapacity_Overflow3 doesn't work
	under MS 1.1 SP1 (it should throw an ArgumentOutOfRangeException) but
	it does work under Mono and MS 2.0 (final). Tagged as "NotWorking".


svn path=/trunk/mcs/; revision=53930
2005-12-05 15:29:18 +00:00
Atsushi Eno caeaed1076 2005-11-22 Atsushi Enomoto <[email protected]>
* ASCIIEncoding.cs, Latin1Encoding.cs : added EncoderFallback support.
	* Encoding.cs : changed default fallback selection. Seems like only
	  ASCII and GB18030 uses '?' for replacement.
	* UTF8Encoding.cs : now that Fallback is read only by default, we
	  need special setter.

	* EncoderReplacementFallbackTest.cs :
	  Added Latin1 replacement test.
	  Updated some test results changed from beta2 to RTM.
	* DecoderReplacementFallbackTest.cs : the same updates.


svn path=/trunk/mcs/; revision=53350
2005-11-22 17:19:45 +00:00
Atsushi Eno e14f1bcad3 2005-11-16 Atsushi Enomoto <[email protected]>
* Decoder.cs : added FallbackBuffer property.
	* UTF8Encoding.cs : In NET_2_0, use DecoderFallbackBuffer instead of
	  "throwOnInvalid".

	* UTF8EncodingTest.cs : Simply replaced all ArgumentException with
	  switched alias (it is DecodefFallbackException in NET_2_0).


svn path=/trunk/mcs/; revision=53137
2005-11-16 18:37:52 +00:00
Atsushi Eno 15cc9902a1 2005-11-15 Atsushi Enomoto <[email protected]>
* corlib_test.dll.sources:
	  Added EncoderReplacementFallbackBudderTest.cs.

	* DecoderReplacementFallbackBuffer.cs : it does not have to preserve
	  byte buffer.
	* EncoderReplacementFallbackBuffer.cs : implemented.
	* DecoderReplacementFallback.cs, EncoderReplacementFallback.cs :
	  Removed MonoTODO.

	* EncoderReplacementFallbackBufferTest.cs : new test (it's weird, but
	  mostly identical to DecoderReplacementFallbackBufferTest...)



svn path=/trunk/mcs/; revision=53092
2005-11-15 22:13:03 +00:00
Atsushi Eno 957860013b 2005-11-15 Atsushi Enomoto <[email protected]>
* corlib_test.dll.sources:
	  Added DecoderReplacementFallbackBudderTest.cs.

	* DecoderFallbackBuffer.cs : Reset() does nothing here.
	* DecoderReplacementFallbackBuffer.cs : implemented, but no idea how
	  bytesUnknown is used.

	* DecoderReplacementFallbackBufferTest.cs : new test.


svn path=/trunk/mcs/; revision=53077
2005-11-15 17:34:20 +00:00
Atsushi Eno 86544b0077 2005-11-15 Atsushi Enomoto <[email protected]>
* corlib_test.dll.sources: added new tests for
	  DecoderReplacementFallback and EncoderReplacementFallback.

	* Encoding.cs : Added IsReadOnly, DecoderFallback and EncoderFallback.
	* Encoder.cs : Added Fallback property.
	* Decoder.cs : Added Fallback property.

	* TestEncoding.cs,
	  DecoderReplacementFallbackTest.cs,
	  EncoderReplacementFallbackTest.cs : new 2.0 tests.


svn path=/trunk/mcs/; revision=53050
2005-11-15 12:12:12 +00:00
Atsushi Eno 8b1efba385 2005-08-25 Atsushi Enomoto <[email protected]>
in mcs:
	* driver.cs : Use default encoding on the environment.
	  Removed (now that) extra parameter for SeekableStreamReader.
	* support.cs : (SeekableStreamReader) third .ctor() argument for
	  StreamReader is not required (always true). preamble size could
	  be acquired in simpler and safe way.

in tests:
	* test-444.cs :
	  UTF-8 BOM autodetect test (for encoding detection patch).

in class/corlib/System.Text:
	* UTF8Encoding.cs : (InternalGetChars/InternalGetCharCount):
	  Don't exclude FEFF in the resulting text.

in class/corlib/Test/System.Text:
	* UTF8EncodingTest.cs : added GetCharsFEFF().

in class/Managed.Windows.Forms:
	* Makefile : added /codepage:65001 (otherwise the build gets broken
	  on KeyboardLayout.cs on some non-iso-8859-1 environment).


svn path=/trunk/mcs/; revision=48826
2005-08-25 10:41:47 +00:00
Ben Maurer 0301dca423 In Test/System.Text:
2005-06-21  Ben Maurer  <[email protected]>

	* StringBuilderTest.cs: Test replacing with a longer string.

In System.Text:
2005-06-21  Ben Maurer  <[email protected]>

	* StringBuilder.cs (Replace): Do the correct thing when we replace
	with a longer string. Thanks to Vorobiev Maksim
	<[email protected]>.


svn path=/trunk/mcs/; revision=46333
2005-06-21 22:42:39 +00:00
Ben Maurer dcd2d2d7d1 In Test/System.Text:
2005-05-06  Ben Maurer  <[email protected]>

	* StringBuilderTest.cs (MaxCapacity_Overflow3): Test for #72244.

In System.Text:
2005-05-06  Ben Maurer  <[email protected]>

	* StringBuilder.cs (InternalEnsureCapacity): It is possible that
	the size we attempt to grow to is more than the max capacity, but
	that a smaller size will do. In this case, don't throw an
	exception. Fixes #72244


svn path=/trunk/mcs/; revision=44166
2005-05-06 20:33:08 +00:00
Ben Maurer 6569a214bb 2005-01-21 Ben Maurer <[email protected]>
* StringBuilderTest.cs (CapacityFromString): This relies on impl
	specific behavior. Rewrite the test.


svn path=/trunk/mcs/; revision=39338
2005-01-22 01:13:45 +00:00
Gonzalo Paniagua Javier 7eadde80f1 2005-01-11 Gonzalo Paniagua Javier <[email protected]>
* System.Text/StringBuilder.cs: when creating the StringBuilder from a
	string, the maximum capacity remains Int32.MaxValue.

	* Test/System.Text/StringBuilderTest.cs: new tests for capacity when
	the StringBuilder is created from a string.


svn path=/trunk/mcs/; revision=38734
2005-01-11 22:03:34 +00:00
Gonzalo Paniagua Javier ba804c8242 2005-01-10 Gonzalo Paniagua Javier <[email protected]>
* System.Text/StringBuilder.cs: throw if the new size is greater than
	the maximum capacity for the StringBuilder. Patch by [email protected].
	Fixes bug #62422.

	* Test/System.Text/StringBuilderTest.cs: patch to test for capacity
	being exceeded.


svn path=/trunk/mcs/; revision=38640
2005-01-10 19:50:21 +00:00
Sebastien Pouliot 4f4f9d7e08 2004-06-23 Sebastien Pouliot <[email protected]>
* UTF7EncodingTest.cs: Added 3 more test cases from RFC1642 to decode
	and re-encode UTF7 from/to unicode.

svn path=/trunk/mcs/; revision=30257
2004-06-24 02:10:12 +00:00
Atsushi Eno 8dcd4adc79 2004-06-07 Atsushi Enomoto <[email protected]>
* UTF8EncodingTest.cs : Added TestThrowOnInvalid().

svn path=/trunk/mcs/; revision=28979
2004-06-07 17:53:40 +00:00
Sebastien Pouliot d1f4ff909a 2004-05-26 Sebastien Pouliot <[email protected]>
* StringBuilderTest.cs: Added unit tests to be sure integer overflows
	are catched.

svn path=/trunk/mcs/; revision=28154
2004-05-26 13:24:16 +00:00
Sebastien Pouliot cfd312dfb2 2004-05-20 Sebastien Pouliot <[email protected]>
* UTF7EncodingTest.cs, UnicodeEncodingTest.cs: Removed unused SetUp
	and TearDown to facilitate searches.

svn path=/trunk/mcs/; revision=27798
2004-05-21 01:24:26 +00:00
Sebastien Pouliot 9993e4e210 2004-05-14 Sebastien Pouliot <[email protected]>
* UTF8EncodingTest.cs: Test both characters in test 2.1.4.

svn path=/trunk/mcs/; revision=27404
2004-05-14 13:33:10 +00:00
Sebastien Pouliot 124190248e 2004-04-14 Sebastien Pouliot <[email protected]>
* UTF8EncodingTest.cs: Ajusted test 3.3.6 and 3.3.7 because MS accept
	invalid UTF8 (when it shouldn't) and Mono doesn't. Both case are now
	accepted by the unit tests.

svn path=/trunk/mcs/; revision=25486
2004-04-14 16:09:29 +00:00