Skip to content

Commit b4556a0

Browse files
committed
Updated and added test to iifInterfaceTests.jl
1 parent 2e5c331 commit b4556a0

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

test/iifInterfaceTests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,13 @@ end
405405
# Only returns x1 and x2
406406
@test symdiff([:x1, :x1x2f1, :x2], [ls(dfgSubgraph)..., lsf(dfgSubgraph)...]) == []
407407

408+
# DFG issue #201 Test include orphan factors with filtering - should only return x7 with solvable=1
409+
dfgSubgraph = getSubgraphAroundNode(dfg, getFactor(dfg, :x7x8f1), 1, true, solvable=0)
410+
@test symdiff([:x7, :x8, :x7x8f1], [ls(dfgSubgraph)..., lsf(dfgSubgraph)...]) == []
411+
# Filter - always returns the node you start at but filters around that.
412+
dfgSubgraph = getSubgraphAroundNode(dfg, getFactor(dfg, :x7x8f1), 1, true, solvable=1)
413+
@test symdiff([:x7x8f1, :x7], [ls(dfgSubgraph)..., lsf(dfgSubgraph)...]) == []
414+
408415
# DFG issue #95 - confirming that getSubgraphAroundNode retains order
409416
# REF: https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues/95
410417
for fId in getVariableIds(dfg)

test/interfaceTests.jl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# using DistributedFactorGraphs, Test
2-
# testDFGAPI = LightDFG
31
dfg = testDFGAPI{NoSolverParams}()
42

53
#add types for softtypes
@@ -357,12 +355,11 @@ end
357355
@test symdiff([:x1, :x1x2f1, :x2], [ls(dfgSubgraph)..., lsf(dfgSubgraph)...]) == []
358356

359357
# DFG issue #201 Test include orphan factors with filtering - should only return x7 with solvable=1
360-
dfgSubgraph = getSubgraphAroundNode(dfg, getFactor(dfg, :x6x7f1), 1, true, solvable=0)
361-
@test symdiff([:x6, :x7, :x6x7f1], [ls(dfgSubgraph)..., lsf(dfgSubgraph)...]) == []
358+
dfgSubgraph = getSubgraphAroundNode(dfg, getFactor(dfg, :x7x8f1), 1, true, solvable=0)
359+
@test symdiff([:x7, :x8, :x7x8f1], [ls(dfgSubgraph)..., lsf(dfgSubgraph)...]) == []
362360
# Filter - always returns the node you start at but filters around that.
363-
dfgSubgraph = getSubgraphAroundNode(dfg, getFactor(dfg, :x6x7f1), 1, true, solvable=1)
364-
@test symdiff([:x6x7f1, :x7], [ls(dfgSubgraph)..., lsf(dfgSubgraph)...]) == []
365-
361+
dfgSubgraph = getSubgraphAroundNode(dfg, getFactor(dfg, :x7x8f1), 1, true, solvable=1)
362+
@test symdiff([:x7x8f1, :x7], [ls(dfgSubgraph)..., lsf(dfgSubgraph)...]) == []
366363

367364
# DFG issue #95 - confirming that getSubgraphAroundNode retains order
368365
# REF: https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues/95

0 commit comments

Comments
 (0)