Skip to content

Commit 97432bf

Browse files
committed
refine alloc tests
1 parent 92843de commit 97432bf

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

test/symbolicindexing_test.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -534,14 +534,20 @@ end
534534
# @b SII.observed($nw, $(VIndex(2,:θ))) # 7
535535

536536
b = @b SII.observed($nw, $idxs1) # 69 36 42
537-
@test b.allocs <= 42
537+
if version v"1.11"
538+
@test b.allocs <= 42
539+
end
538540
b = @b SII.observed($nw, $idxs2) # 12 7 10
539-
@test b.allocs <= 10
541+
if version v"1.11"
542+
@test b.allocs <= 10
543+
end
540544

541-
# obsf1 = SII.observed(nw, idxs1)
542-
# obsf2 = SII.observed(nw, idxs2)
545+
obsf1 = SII.observed(nw, idxs1)
546+
obsf2 = SII.observed(nw, idxs2)
543547
# @b $obsf1($(rand(dim(nw))), $(rand(pdim(nw))), NaN) # 81ns 2 allocs
544548
# @b $obsf2($(rand(dim(nw))), $(rand(pdim(nw))), NaN) # 34ns 2 allocs
545-
# @b $obsf1($(rand(dim(nw))), $(rand(pdim(nw))), NaN, $(zeros(length(idxs1)))) # 64ns 0 allocs
546-
# @b $obsf2($(rand(dim(nw))), $(rand(pdim(nw))), NaN, $(zeros(length(idxs2)))) # 17ns 0 allocs
549+
b = @b $obsf1($(rand(dim(nw))), $(rand(pdim(nw))), NaN, $(zeros(length(idxs1)))) # 64ns 0 allocs
550+
@test b.allocs == 0
551+
b = @b $obsf2($(rand(dim(nw))), $(rand(pdim(nw))), NaN, $(zeros(length(idxs2)))) # 17ns 0 allocs
552+
@test b.allocs == 0
547553
end

0 commit comments

Comments
 (0)