Benchmark for execution test written

This commit is contained in:
2025-08-07 23:39:42 +03:00
parent 0f355b9df3
commit c29db73a0e
12 changed files with 237 additions and 28 deletions
+22
View File
@@ -0,0 +1,22 @@
using mROA.Benchmark;
namespace mROA.Test;
[TestFixture]
public class BenchmarkTest
{
[Test]
public void Benchmark()
{
var bench = new TaskWaiting();
var x = bench.DefaultJob();
var y = bench.DefaultJobAsync();
y.Wait();
if (x == y.Result)
{
Assert.Pass();
}
Assert.Fail();
}
}
-11
View File
@@ -18,17 +18,6 @@ public class ConcurrentTest
[Test]
public void ParallelAlloc()
{
Parallel.For(0, 100, i =>
{
var data = _cmm.AllocSlice(1);
data.Span[0] = 1;
});
var total = _cmm.AllocSlice(100).Span;
if (total.IndexOf((byte)0) == -1)
{
Assert.Pass();
}
Assert.Fail();
}
}
+1
View File
@@ -27,6 +27,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\mROA.Benchmark\mROA.Benchmark.csproj" />
<ProjectReference Include="..\mROA.Cbor\mROA.Cbor.csproj" />
<ProjectReference Include="..\mROA\mROA.csproj" />
</ItemGroup>