Skip to content

Commit edc5a73

Browse files
committed
Vector.create tests
1 parent f1a6f24 commit edc5a73

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

tests/GraphBLAS-sharp.Tests/Backend/Vector/ZeroCreate.fs renamed to tests/GraphBLAS-sharp.Tests/Backend/Vector/Create.fs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,23 @@ let correctnessGenericTest<'a when 'a: struct and 'a: equality>
3535
(vectorSize: int)
3636
=
3737

38-
let vectorSize = abs vectorSize
38+
try
39+
let vectorSize = abs vectorSize
3940

40-
if vectorSize > 0 then
41-
let q = case.TestContext.Queue
41+
if vectorSize > 0 then
42+
let q = case.TestContext.Queue
4243

43-
let clVector =
44-
zeroCreate q HostInterop vectorSize case.Format
44+
let clVector =
45+
zeroCreate q HostInterop vectorSize case.Format
4546

46-
let hostVector = clVector.ToHost q
47+
let hostVector = clVector.ToHost q
4748

48-
clVector.Dispose q
49+
clVector.Dispose q
4950

50-
checkResult vectorSize hostVector
51+
checkResult vectorSize hostVector
52+
with
53+
| ex when ex.Message = "Attempting to create full sparse vector" -> ()
54+
| ex -> raise ex
5155

5256
let createTest<'a> case =
5357
let getCorrectnessTestName dataType =

tests/GraphBLAS-sharp.Tests/GraphBLAS-sharp.Tests.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<Compile Include="Backend/Vector/OfList.fs" />
6464
<Compile Include="Backend/Vector/Reduce.fs" />
6565
<Compile Include="Backend/Vector/SpMV.fs" />
66-
<Compile Include="Backend/Vector/ZeroCreate.fs" />
66+
<Compile Include="Backend/Vector/Create.fs" />
6767
<Compile Include="Backend/Vector/Merge.fs" />
6868
<Compile Include="Backend/Vector/SpMSpV.fs" />
6969
<Compile Include="Backend/Vector/Map.fs" />

0 commit comments

Comments
 (0)