diff options
author | Alexander Köplinger <alex.koeplinger@outlook.com> | 2015-11-06 17:42:51 +0100 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2015-11-16 20:47:23 +0100 |
commit | 0e327fc624651e15805d988b7d5aae0459ff3638 (patch) | |
tree | bcaef9702dd54024edccf6d40222b99abed4cc27 | |
parent | 1aad667d92f340cbff8d7a1c3d8252278a8537e4 (diff) | |
download | coreclr-0e327fc624651e15805d988b7d5aae0459ff3638.tar.gz coreclr-0e327fc624651e15805d988b7d5aae0459ff3638.tar.bz2 coreclr-0e327fc624651e15805d988b7d5aae0459ff3638.zip |
Use InvariantCulture for parsing float arguments in GC stress tests
Otherwise they'd fail on cultures where '.' isn't used as a decimal separator.
-rw-r--r-- | tests/src/GC/Stress/Tests/GCSimulator.cs | 4 | ||||
-rw-r--r-- | tests/src/GC/Stress/Tests/StressAllocator.cs | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/src/GC/Stress/Tests/GCSimulator.cs b/tests/src/GC/Stress/Tests/GCSimulator.cs index b5564bf34d..ad62c69286 100644 --- a/tests/src/GC/Stress/Tests/GCSimulator.cs +++ b/tests/src/GC/Stress/Tests/GCSimulator.cs @@ -825,7 +825,7 @@ namespace GCSimulator else if (currentArg.StartsWith("datapinned") || currentArg.StartsWith("dp")) // percentage data pinned { currentArgValue = args[++i]; - s_percentPinned = float.Parse(currentArgValue); + s_percentPinned = float.Parse(currentArgValue, System.Globalization.CultureInfo.InvariantCulture); if (s_percentPinned < 0 || s_percentPinned > 1) { Console.WriteLine("Error! datapinned should be a number from 0 to 1"); @@ -848,7 +848,7 @@ namespace GCSimulator else if (currentArg.StartsWith("dataweak") || currentArg.StartsWith("dw")) { currentArgValue = args[++i]; - s_percentWeak = float.Parse(currentArgValue); + s_percentWeak = float.Parse(currentArgValue, System.Globalization.CultureInfo.InvariantCulture); if (s_percentWeak < 0 || s_percentWeak > 1) { Console.WriteLine("Error! dataweak should be a number from 0 to 1"); diff --git a/tests/src/GC/Stress/Tests/StressAllocator.cs b/tests/src/GC/Stress/Tests/StressAllocator.cs index 2e0ec1a0fb..2c3c89e568 100644 --- a/tests/src/GC/Stress/Tests/StressAllocator.cs +++ b/tests/src/GC/Stress/Tests/StressAllocator.cs @@ -518,7 +518,7 @@ namespace StressAllocator else if (String.Compare(currentArg.ToLower(), "pinned") == 0) { currentArgValue = args[++i]; - percentPinned = float.Parse(currentArgValue); + percentPinned = float.Parse(currentArgValue, System.Globalization.CultureInfo.InvariantCulture); } else if (String.Compare(currentArg.ToLower(), "lohpin") == 0) //for LOH compacting testing, this is the option to apply the pinning percentage to LOH { @@ -527,22 +527,22 @@ namespace StressAllocator else if (String.Compare(currentArg.ToLower(), "bucket1") == 0) { currentArgValue = args[++i]; - percentBucket1 = float.Parse(currentArgValue); + percentBucket1 = float.Parse(currentArgValue, System.Globalization.CultureInfo.InvariantCulture); } else if (String.Compare(currentArg.ToLower(), "bucket2") == 0) { currentArgValue = args[++i]; - percentBucket2 = float.Parse(currentArgValue); + percentBucket2 = float.Parse(currentArgValue, System.Globalization.CultureInfo.InvariantCulture); } else if (String.Compare(currentArg.ToLower(), "bucket3") == 0) { currentArgValue = args[++i]; - percentBucket3 = float.Parse(currentArgValue); + percentBucket3 = float.Parse(currentArgValue, System.Globalization.CultureInfo.InvariantCulture); } else if (String.Compare(currentArg.ToLower(), "bucket4") == 0) { currentArgValue = args[++i]; - percentBucket4 = float.Parse(currentArgValue); + percentBucket4 = float.Parse(currentArgValue, System.Globalization.CultureInfo.InvariantCulture); } else if (String.Compare(currentArg.ToLower(), "nolocks") == 0) { |