Skip to content

Commit 7369a42

Browse files
committed
Following results of CI build.
Results are inconsistent: Windows 7 maintained its previous behaviour, but Windows 8.1 and Nano Server behaved differently, failing with the same inputs. It seems like we're hitting undefined behaviour in Windows' underlying ber_scanf, when processing two consecutive zero-length octet strings with the "v" and "V" specifiers. This isn't the point of the test though - changed the test inputs to supply well-formed BER data so that we can move on to actually testing the format specifier.
1 parent ad33377 commit 7369a42

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/libraries/System.DirectoryServices.Protocols/tests/BerConverterTests.cs

+2-8
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,7 @@ public static IEnumerable<object[]> Decode_TestData()
159159

160160
// Content: sequence containing three octet strings
161161
// Parsed as two sequences of octet strings
162-
// This is parsed differently between Windows 7 and later versions: the first element returned by Windows 7 will be an array of length 2,
163-
// while this will be an array of length 3 in later versions.
164-
yield return new object[] { "vv", new byte[] { 48, 132, 0, 0, 0, 9, 4, 3, 97, 98, 99, 4, 0, 4, 0 },
165-
Environment.OSVersion.Version <= new Version(6, 1) ? new object[] { new string[] { "abc", "" }, null } : new object[] { new string[] { "abc", "", "" }, null } };
162+
yield return new object[] { "vv", new byte[] { 48, 132, 0, 0, 0, 12, 4, 3, 97, 98, 99, 4, 2, 100, 101, 4, 1, 102 }, new object[] { new string[] { "abc", "de", "f" }, null } };
166163

167164
// Content: sequence containing two sequences of octet strings
168165
// Parsed as such
@@ -182,10 +179,7 @@ public static IEnumerable<object[]> Decode_TestData()
182179

183180
// Content: sequence of octet strings
184181
// Parsed as two sequences of octet strings (returned as bytes)
185-
// This is parsed differently between Windows 7 and later versions: the first element returned by Windows 7 will be an array of length 2,
186-
// while this will be an array of length 3 in later versions.
187-
yield return new object[] { "VV", new byte[] { 48, 132, 0, 0, 0, 9, 4, 3, 97, 98, 99, 4, 0, 4, 0 },
188-
Environment.OSVersion.Version <= new Version(6, 1) ? new object[] { new byte[][] { [97, 98, 99], [] }, null } : new object[]{ new byte[][] { [97, 98, 99], [], [] }, null } };
182+
yield return new object[] { "VV", new byte[] { 48, 132, 0, 0, 0, 12, 4, 3, 97, 98, 99, 4, 2, 100, 101, 4, 1, 102 },new object[]{ new byte[][] { [97, 98, 99], [100, 101], [102] }, null } };
189183

190184
// Content: sequence containing two booleans
191185
// Parsed as a sequence containing two sequences of octet strings (returned as bytes)

0 commit comments

Comments
 (0)