forked from bit/DotRecastNetSim
remove Parallelizable in UnitTest
This commit is contained in:
parent
4cb4f16096
commit
0d4344dabb
|
@ -22,31 +22,38 @@ public class RcRentedArrayTest
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void Test()
|
||||
public void TestRentedArray()
|
||||
{
|
||||
var rand = new RcRand();
|
||||
for (int loop = 0; loop < 1024; ++loop)
|
||||
{
|
||||
int length = (int)(rand.Next() * 2048);
|
||||
var values = RandomValues(length);
|
||||
using var array = RcRentedArray.RentDisposableArray<int>(length);
|
||||
|
||||
for (int i = 0; i < array.Length; ++i)
|
||||
RcRentedArray<int> rentedArray;
|
||||
{
|
||||
array[i] = values[i];
|
||||
}
|
||||
int length = (int)(rand.Next() * 2048);
|
||||
var values = RandomValues(length);
|
||||
using var array = RcRentedArray.RentDisposableArray<int>(length);
|
||||
|
||||
for (int i = 0; i < array.Length; ++i)
|
||||
{
|
||||
Assert.That(array[i], Is.EqualTo(values[i]));
|
||||
for (int i = 0; i < array.Length; ++i)
|
||||
{
|
||||
array[i] = values[i];
|
||||
}
|
||||
|
||||
for (int i = 0; i < array.Length; ++i)
|
||||
{
|
||||
Assert.That(array[i], Is.EqualTo(values[i]));
|
||||
}
|
||||
|
||||
Assert.That(array[^1], Is.EqualTo(values[^1]));
|
||||
|
||||
Assert.Throws<IndexOutOfRangeException>(() => array[-1] = 0);
|
||||
Assert.Throws<IndexOutOfRangeException>(() => array[array.Length + 1] = 0);
|
||||
Assert.Throws<IndexOutOfRangeException>(() => _ = array[-1]);
|
||||
Assert.Throws<IndexOutOfRangeException>(() => _ = array[array.Length + 1]);
|
||||
|
||||
// danger
|
||||
rentedArray = array;
|
||||
}
|
||||
|
||||
Assert.That(array[^1], Is.EqualTo(values[^1]));
|
||||
|
||||
Assert.Throws<IndexOutOfRangeException>(() => array[-1] = 0);
|
||||
Assert.Throws<IndexOutOfRangeException>(() => array[array.Length + 1] = 0);
|
||||
Assert.Throws<IndexOutOfRangeException>(() => _ = array[-1]);
|
||||
Assert.Throws<IndexOutOfRangeException>(() => _ = array[array.Length + 1]);
|
||||
Assert.Throws<NullReferenceException>(() => rentedArray[^1] = 0);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Core.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class RcStackArrayTest
|
||||
{
|
||||
public List<int> RandomValues(int size)
|
||||
|
|
|
@ -25,7 +25,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Crowd.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class AbstractCrowdTest
|
||||
{
|
||||
protected readonly long[] startRefs =
|
||||
|
|
|
@ -22,7 +22,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Crowd.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class Crowd1Test : AbstractCrowdTest
|
||||
{
|
||||
static readonly float[][] EXPECTED_A1Q0TVTA =
|
||||
|
|
|
@ -24,7 +24,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Crowd.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class Crowd4Test : AbstractCrowdTest
|
||||
{
|
||||
static readonly float[][] EXPECTED_A1Q2TVTA =
|
||||
|
|
|
@ -22,7 +22,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Crowd.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class Crowd4VelocityTest : AbstractCrowdTest
|
||||
{
|
||||
static readonly float[][] EXPECTED_A1Q3TVTA =
|
||||
|
|
|
@ -25,7 +25,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Crowd.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class PathCorridorTest
|
||||
{
|
||||
private readonly DtPathCorridor corridor = new DtPathCorridor();
|
||||
|
|
|
@ -10,7 +10,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Dynamic.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class DynamicNavMeshTest
|
||||
{
|
||||
private static readonly RcVec3f START_POS = new RcVec3f(70.87453f, 0.0010070801f, 86.69021f);
|
||||
|
|
|
@ -25,7 +25,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Dynamic.Test.Io;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class VoxelFileReaderTest
|
||||
{
|
||||
[Test]
|
||||
|
|
|
@ -25,7 +25,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Dynamic.Test.Io;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class VoxelFileReaderWriterTest
|
||||
{
|
||||
[TestCase(false)]
|
||||
|
|
|
@ -31,7 +31,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Dynamic.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class VoxelQueryTest
|
||||
{
|
||||
private const int TILE_WIDTH = 100;
|
||||
|
|
|
@ -26,7 +26,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Extras.Test.Unity.Astar;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class UnityAStarPathfindingImporterTest
|
||||
{
|
||||
[Test]
|
||||
|
|
|
@ -21,7 +21,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public abstract class AbstractDetourTest
|
||||
{
|
||||
protected static readonly long[] startRefs =
|
||||
|
|
|
@ -21,7 +21,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class ConvexConvexIntersectionTest
|
||||
{
|
||||
[Test]
|
||||
|
|
|
@ -22,7 +22,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class FindDistanceToWallTest : AbstractDetourTest
|
||||
{
|
||||
private static readonly float[] DISTANCES_TO_WALL = { 0.597511f, 3.201085f, 0.603713f, 2.791475f, 2.815544f };
|
||||
|
|
|
@ -22,7 +22,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class FindLocalNeighbourhoodTest : AbstractDetourTest
|
||||
{
|
||||
private static readonly long[][] REFS =
|
||||
|
|
|
@ -21,7 +21,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class FindNearestPolyTest : AbstractDetourTest
|
||||
{
|
||||
private static readonly long[] POLY_REFS = { 281474976710696L, 281474976710773L, 281474976710680L, 281474976710753L, 281474976710733L };
|
||||
|
|
|
@ -22,7 +22,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class FindPathTest : AbstractDetourTest
|
||||
{
|
||||
private static readonly DtStatus[] STATUSES =
|
||||
|
|
|
@ -22,7 +22,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class FindPolysAroundCircleTest : AbstractDetourTest
|
||||
{
|
||||
private static readonly long[][] REFS =
|
||||
|
|
|
@ -22,7 +22,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class FindPolysAroundShapeTest : AbstractDetourTest
|
||||
{
|
||||
private static readonly long[][] REFS =
|
||||
|
|
|
@ -22,7 +22,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class GetPolyWallSegmentsTest : AbstractDetourTest
|
||||
{
|
||||
private static readonly RcSegmentVert[][] VERTICES =
|
||||
|
|
|
@ -23,7 +23,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test.Io;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class MeshDataReaderWriterTest
|
||||
{
|
||||
private const int VERTS_PER_POLYGON = 6;
|
||||
|
|
|
@ -24,7 +24,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test.Io;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class MeshSetReaderTest
|
||||
{
|
||||
private readonly DtMeshSetReader reader = new DtMeshSetReader();
|
||||
|
|
|
@ -28,7 +28,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test.Io;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class MeshSetReaderWriterTest
|
||||
{
|
||||
private readonly DtMeshSetWriter writer = new DtMeshSetWriter();
|
||||
|
|
|
@ -22,7 +22,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class MoveAlongSurfaceTest : AbstractDetourTest
|
||||
{
|
||||
private static readonly long[][] VISITED =
|
||||
|
|
|
@ -21,7 +21,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class NavMeshBuilderTest
|
||||
{
|
||||
private DtMeshData nmd;
|
||||
|
|
|
@ -22,7 +22,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class PolygonByCircleConstraintTest
|
||||
{
|
||||
private readonly IDtPolygonByCircleConstraint _constraint = DtStrictDtPolygonByCircleConstraint.Shared;
|
||||
|
|
|
@ -25,7 +25,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class RandomPointTest : AbstractDetourTest
|
||||
{
|
||||
[Test]
|
||||
|
|
|
@ -23,7 +23,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class TiledFindPathTest
|
||||
{
|
||||
private static readonly DtStatus[] STATUSES = { DtStatus.DT_SUCCESS };
|
||||
|
|
|
@ -27,7 +27,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.TileCache.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class AbstractTileCacheTest
|
||||
{
|
||||
private const int EXPECTED_LAYERS_PER_TILE = 4;
|
||||
|
|
|
@ -27,7 +27,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.TileCache.Test.Io;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class TileCacheReaderTest
|
||||
{
|
||||
private readonly DtTileCacheReader reader = new DtTileCacheReader(DtTileCacheCompressorFactory.Shared);
|
||||
|
|
|
@ -28,7 +28,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.TileCache.Test.Io;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class TileCacheReaderWriterTest : AbstractTileCacheTest
|
||||
{
|
||||
private readonly DtTileCacheReader reader = new DtTileCacheReader(DtTileCacheCompressorFactory.Shared);
|
||||
|
|
|
@ -26,7 +26,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.TileCache.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class TempObstaclesTest : AbstractTileCacheTest
|
||||
{
|
||||
[Test]
|
||||
|
|
|
@ -29,7 +29,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.TileCache.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class TileCacheFindPathTest : AbstractTileCacheTest
|
||||
{
|
||||
private readonly RcVec3f start = new RcVec3f(39.44734f, 9.998177f, -0.784811f);
|
||||
|
|
|
@ -26,7 +26,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.TileCache.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class TileCacheNavigationTest : AbstractTileCacheTest
|
||||
{
|
||||
protected readonly long[] startRefs = { 281475006070787L };
|
||||
|
|
|
@ -26,7 +26,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Detour.TileCache.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class TileCacheTest : AbstractTileCacheTest
|
||||
{
|
||||
[Test]
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace DotRecast.Recast.Test;
|
|||
|
||||
using static RcConstants;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class RecastLayersTest
|
||||
{
|
||||
private const float m_cellSize = 0.3f;
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace DotRecast.Recast.Test;
|
|||
using static RcConstants;
|
||||
using static RcAreas;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class RecastSoloMeshTest
|
||||
{
|
||||
private const float m_cellSize = 0.3f;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace DotRecast.Recast.Test;
|
|||
|
||||
using static RcConstants;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class RecastTest
|
||||
{
|
||||
[Test]
|
||||
|
|
|
@ -27,7 +27,7 @@ using NUnit.Framework;
|
|||
|
||||
namespace DotRecast.Recast.Test;
|
||||
|
||||
[Parallelizable]
|
||||
|
||||
public class RecastTileMeshTest
|
||||
{
|
||||
private const float m_cellSize = 0.3f;
|
||||
|
|
Loading…
Reference in New Issue