From: James Ko Date: Wed, 6 Jul 2016 03:48:58 +0000 (-0400) Subject: Add more test coverage for dotnet/coreclrdotnet/corefx#6119 (dotnet/corefx#9844) X-Git-Tag: submit/tizen/20210909.063632~11031^2~11808 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3425d927911521dbd8f263c35cab86f6513e1f43;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Add more test coverage for dotnet/coreclrdotnet/corefx#6119 (dotnet/corefx#9844) * Add more test coverage for dotnet/coreclrdotnet/corefx#6119 Commit migrated from https://github.com/dotnet/corefx/commit/860d28cbb752a7a5ccd191b6f784c4f4d15909e2 --- diff --git a/src/libraries/System.Runtime/tests/System/StringTests.cs b/src/libraries/System.Runtime/tests/System/StringTests.cs index a2785bd..e1e9b9b 100644 --- a/src/libraries/System.Runtime/tests/System/StringTests.cs +++ b/src/libraries/System.Runtime/tests/System/StringTests.cs @@ -482,6 +482,15 @@ namespace System.Tests [InlineData("aaaaaaaaaaaaaa", 1, "aaaxaaaaaaaaaa", 3, 100, StringComparison.Ordinal, -1)] // Different long alignment, abs of 4, one of them is 2, different at n=1 [InlineData("-aaaaaaaaaaaaa", 1, "++++aaaaaaaaaa", 4, 10, StringComparison.Ordinal, 0)] // Different long alignment, equal compare [InlineData("aaaaaaaaaaaaaa", 1, "aaaaaaaaaaaaax", 4, 100, StringComparison.Ordinal, -1)] // Different long alignment + [InlineData("\0", 0, "", 0, 1, StringComparison.Ordinal, 1)] // Same memory layout, except for m_stringLength (m_firstChars are both 0) + [InlineData("\0\0", 0, "", 0, 2, StringComparison.Ordinal, 1)] // Same as above, except m_stringLength for one is 2 + [InlineData("", 0, "\0b", 0, 2, StringComparison.Ordinal, -1)] // strA's second char != strB's second char codepath + [InlineData("", 0, "b", 0, 1, StringComparison.Ordinal, -1)] // Should hit strA.m_firstChar != strB.m_firstChar codepath + [InlineData("abcxxxxxxxxxxxxxxxxxxxxxx", 0, "abdxxxxxxxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1)] // 64-bit: first long compare is different + [InlineData("abcdefgxxxxxxxxxxxxxxxxxx", 0, "abcdefhxxxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1)] // 64-bit: second long compare is different + [InlineData("abcdefghijkxxxxxxxxxxxxxx", 0, "abcdefghijlxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1)] // 64-bit: third long compare is different + [InlineData("abcdexxxxxxxxxxxxxxxxxxxx", 0, "abcdfxxxxxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1)] // 32-bit: second int compare is different + [InlineData("abcdefghixxxxxxxxxxxxxxxx", 0, "abcdefghjxxxxxxxxx", 0, int.MaxValue, StringComparison.Ordinal, -1)] // 32-bit: fourth int compare is different [InlineData(null, 0, null, 0, 0, StringComparison.Ordinal, 0)] [InlineData("Hello", 0, null, 0, 5, StringComparison.Ordinal, 1)] [InlineData(null, 0, "Hello", 0, 5, StringComparison.Ordinal, -1)]