blob: 8343dd6a2e2bfc065fef34cc7dffa1fb37c8e40a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
public class Test
{
public static int Main()
{
bool retVal = true;
TestLibrary.TestFramework.BeginTestCase("SZArray");
TestLibrary.TestFramework.BeginScenario("SZArray is used when casting T[] to IList<T>");
int[] szArray = new int[100];
IList<int> list = szArray;
for (int i = 0; i < 100; i++)
{
list[i] = 100-i;
}
for (int i = 0; i < 100; i++)
{
if (100-i != szArray[i])
{
TestLibrary.TestFramework.LogError("000", "Incorrect value: Expected("+ (100-i) +") Actual("+ szArray[i] +")");
retVal = false;
}
}
TestLibrary.TestFramework.EndTestCase();
if (retVal)
{
TestLibrary.TestFramework.LogInformation("PASS");
return 100;
}
else
{
TestLibrary.TestFramework.LogInformation("FAIL");
return 0;
}
}
}
|