File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ include("testPartialFactors.jl")
23
23
@testset " basic Bayes tree construction" begin
24
24
include (" testBayesTreeiSAM2Example.jl" )
25
25
end
26
+
27
+ include (" testTreeSaveLoad.jl" )
28
+
26
29
@testset " Ensure converter types can be run from extending namespaces..." begin
27
30
include (" saveconvertertypes.jl" )
28
31
end
Original file line number Diff line number Diff line change
1
+ # test saving and loading of trees
2
+
3
+ using Test
4
+ using IncrementalInference
5
+
6
+ @testset " Test loading and saving of Bayes (Junction) tree" begin
7
+
8
+ fg = loadCanonicalFG_Kaess (graphinit= false )
9
+ tree = wipeBuildNewTree! (fg)
10
+
11
+ # save and load tree
12
+ saveTree (tree)
13
+ tree2 = loadTree ()
14
+
15
+ # perform a few spot checks to see that the trees are similar
16
+ @test length (tree. cliques) == length (tree2. cliques)
17
+ @test getVariableOrder (tree) == getVariableOrder (tree2)
18
+
19
+ for (clid,cl) in tree. cliques
20
+ fsyms = getFrontals (cl)
21
+ cl2 = getCliq (tree2, fsyms[1 ])
22
+ fsyms2 = getFrontals (cl2)
23
+ @test fsyms == fsyms2
24
+ @test getCliqSeparatorVarIds (cl) == getCliqSeparatorVarIds (cl2)
25
+ @test typeof (cl) == typeof (cl2)
26
+ end
27
+
28
+ end
You can’t perform that action at this time.
0 commit comments