From edc5a73d87c1aa6650c0ea54a3964f2e17215fc4 Mon Sep 17 00:00:00 2001 From: kirillgarbar Date: Mon, 16 Oct 2023 23:49:33 +0300 Subject: [PATCH] Vector.create tests --- .../Vector/{ZeroCreate.fs => Create.fs} | 20 +++++++++++-------- .../GraphBLAS-sharp.Tests.fsproj | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) rename tests/GraphBLAS-sharp.Tests/Backend/Vector/{ZeroCreate.fs => Create.fs} (81%) diff --git a/tests/GraphBLAS-sharp.Tests/Backend/Vector/ZeroCreate.fs b/tests/GraphBLAS-sharp.Tests/Backend/Vector/Create.fs similarity index 81% rename from tests/GraphBLAS-sharp.Tests/Backend/Vector/ZeroCreate.fs rename to tests/GraphBLAS-sharp.Tests/Backend/Vector/Create.fs index 79c1e4d9..145731d5 100644 --- a/tests/GraphBLAS-sharp.Tests/Backend/Vector/ZeroCreate.fs +++ b/tests/GraphBLAS-sharp.Tests/Backend/Vector/Create.fs @@ -35,19 +35,23 @@ let correctnessGenericTest<'a when 'a: struct and 'a: equality> (vectorSize: int) = - let vectorSize = abs vectorSize + try + let vectorSize = abs vectorSize - if vectorSize > 0 then - let q = case.TestContext.Queue + if vectorSize > 0 then + let q = case.TestContext.Queue - let clVector = - zeroCreate q HostInterop vectorSize case.Format + let clVector = + zeroCreate q HostInterop vectorSize case.Format - let hostVector = clVector.ToHost q + let hostVector = clVector.ToHost q - clVector.Dispose q + clVector.Dispose q - checkResult vectorSize hostVector + checkResult vectorSize hostVector + with + | ex when ex.Message = "Attempting to create full sparse vector" -> () + | ex -> raise ex let createTest<'a> case = let getCorrectnessTestName dataType = diff --git a/tests/GraphBLAS-sharp.Tests/GraphBLAS-sharp.Tests.fsproj b/tests/GraphBLAS-sharp.Tests/GraphBLAS-sharp.Tests.fsproj index 870cf599..80f70253 100644 --- a/tests/GraphBLAS-sharp.Tests/GraphBLAS-sharp.Tests.fsproj +++ b/tests/GraphBLAS-sharp.Tests/GraphBLAS-sharp.Tests.fsproj @@ -63,7 +63,7 @@ - +