Skip to content

Commit 0c26996

Browse files
Support Windows 22H2 in OsBrandStringHelper
1 parent 86f212b commit 0c26996

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/BenchmarkDotNet/Environments/OsBrandStringHelper.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ public class OsBrandStringHelper
102102
{ "10.0.19042", "10 20H2 [20H2, October 2020 Update]" },
103103
{ "10.0.19043", "10 21H1 [21H1, May 2021 Update]" },
104104
{ "10.0.19044", "10 21H2 [21H2, November 2021 Update]" },
105-
{ "10.0.22000", "11 21H2 [21H2]" },
105+
{ "10.0.19045", "10 22H2 [22H2, 2022 Update]" },
106+
{ "10.0.22000", "11 21H2 [21H2, Sun Valley]" },
107+
{ "10.0.22621", "11 22H2 [22H2, Sun Valley 2]" },
106108
};
107109

108110
private class Windows1XVersion
@@ -155,9 +157,10 @@ public string ToPrettifiedString(int? ubr)
155157
new Windows1XVersion("20H2", "20H2", "October 2020 Update", 19042),
156158
new Windows1XVersion("21H1", "21H1", "May 2021 Update", 19043),
157159
new Windows1XVersion("21H2", "21H2", "November 2021 Update", 19044),
158-
new Windows1XVersion("21H2", "21H2", "November 2021 Update", 19044),
160+
new Windows1XVersion("22H2", "22H2", "2022 Update", 19045),
159161
// Windows 11
160-
new Windows1XVersion("21H2", "21H2", null, 22000),
162+
new Windows1XVersion("21H2", "Sun Valley", null, 22000),
163+
new Windows1XVersion("22H2", "Sun Valley 2", "2022 Update", 22621),
161164
};
162165

163166
public static Windows1XVersion? Resolve(string osVersionString)

tests/BenchmarkDotNet.Tests/Environments/OsBrandStringTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ public void WindowsIsPrettified(string originalVersion, string prettifiedName)
4747
[InlineData("10.0.19043", 964, "Windows 10 (10.0.19043.964/21H1/May2021Update)")]
4848
[InlineData("10.0.19044", 1147, "Windows 10 (10.0.19044.1147/21H2/November2021Update)")]
4949
[InlineData("10.0.19099", 1729, "Windows 10 (10.0.19099.1729)")]
50-
[InlineData("10.0.22000", 348, "Windows 11 (10.0.22000.348/21H2)")]
50+
[InlineData("10.0.19045", 0, "Windows 10 (10.0.19045.0/22H2/2022Update)")]
51+
[InlineData("10.0.22000", 348, "Windows 11 (10.0.22000.348/21H2/SunValley)")]
5152
[InlineData("10.0.22518", 1012, "Windows 11 (10.0.22518.1012)")]
53+
[InlineData("10.0.22621", 0, "Windows 11 (10.0.22621.0/22H2/2022Update/SunValley2)")]
5254
public void WindowsWithUbrIsPrettified(string originalVersion, int ubr, string prettifiedName)
5355
=> Check(OsBrandStringHelper.Prettify("Windows", originalVersion, ubr), prettifiedName);
5456

0 commit comments

Comments
 (0)