Imported Upstream version 4.0.1.28

Former-commit-id: d8405b75d12c6845dab8fe08c1576f57a148d621
This commit is contained in:
Xamarin Public Jenkins
2015-05-14 10:55:10 -04:00
parent 7272927785
commit daac4dedd2
155 changed files with 2071 additions and 1163 deletions

View File

@@ -417,11 +417,12 @@ namespace System.Globalization
// The runtime returns a NULL in the first position of the array when
// 'neutral' is true. We fill it in with a clone of InvariantCulture
// since it must not be read-only
int i = 0;
if (neutral && infos.Length > 0 && infos [0] == null) {
infos [0] = (CultureInfo) InvariantCulture.Clone ();
infos [i++] = (CultureInfo) InvariantCulture.Clone ();
}
for (int i = 1; i < infos.Length; ++i) {
for (; i < infos.Length; ++i) {
var ci = infos [i];
infos [i].m_cultureData = CultureData.GetCultureData (ci.m_name, false, ci.datetime_index, ci.CalendarType, ci.iso2lang);
}

View File

@@ -225,6 +225,15 @@ namespace MonoTests.System.Globalization
Assert.Fail ("InvariantCulture not found in the array from GetCultures()");
}
[Test]
public void GetAllCultures_Specific ()
{
CultureInfo [] infos = CultureInfo.GetCultures (CultureTypes.SpecificCultures);
foreach (CultureInfo ci in infos) {
Assert.IsNotNull (ci.DateTimeFormat);
}
}
[Test]
#if !NET_4_0
[ExpectedException (typeof (NotSupportedException))]

View File

@@ -0,0 +1 @@
#include corlib.dll.sources