mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
Add array copy test.
This commit is contained in:
parent
afdc5a31bf
commit
04ca044e34
3 changed files with 25 additions and 0 deletions
|
|
@ -83,6 +83,7 @@
|
|||
<Compile Include="CSharp\WhileLoopTests.cs" />
|
||||
<Compile Include="Kernel.cs" />
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="System\ArrayTests.cs" />
|
||||
<Compile Include="System\BitConverterTest.cs" />
|
||||
<Compile Include="System\BooleanTest.cs" />
|
||||
<Compile Include="System\ByteTest.cs" />
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ namespace Cosmos.Compiler.Tests.Bcl
|
|||
CSharp.WhileLoopTests.Execute();
|
||||
|
||||
//ObjectTests.Execute(); Stack corruption on method Clone()
|
||||
ArrayTests.Execute();
|
||||
StringTest.Execute();
|
||||
ByteTest.Execute();
|
||||
SByteTest.Execute();
|
||||
|
|
|
|||
23
Tests/Cosmos.Compiler.Tests.Bcl/System/ArrayTests.cs
Normal file
23
Tests/Cosmos.Compiler.Tests.Bcl/System/ArrayTests.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Cosmos.TestRunner;
|
||||
|
||||
namespace Cosmos.Compiler.Tests.Bcl.System
|
||||
{
|
||||
class ArrayTests
|
||||
{
|
||||
public static void Execute()
|
||||
{
|
||||
byte[] xResult = { 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
byte[] xExpectedResult = { 1, 2, 3, 4, 5, 6, 7, 1 };
|
||||
byte[] xSource = { 1 };
|
||||
|
||||
Array.Copy(xSource, 0, xResult, 7, 1);
|
||||
|
||||
Assert.IsTrue((xResult[7] == xExpectedResult[7]), "Array.Copy doesn't work: xResult[7] " + (uint)xResult[7] + " != " + (uint)xExpectedResult[7]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue