Skip to content

Commit 485b060

Browse files
committed
few more tests and missing export
1 parent 4044fd8 commit 485b060

File tree

2 files changed

+33
-25
lines changed

2 files changed

+33
-25
lines changed

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export
236236
# export ConvolutionObject
237237

238238
## CustomPrinting.jl
239-
export printFactor, printVariable
239+
export printFactor, printVariable, printNode
240240

241241
##==============================================================================
242242
## Files Includes

test/interfaceTests.jl

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,52 @@ end
2323
end
2424

2525

26+
@testset "Variables and Factors CRUD and SET" begin
27+
VariablesandFactorsCRUD_SET!(fg1, var1, var2, var3, fac0, fac1, fac2)
28+
end
29+
30+
2631
@testset "Custom Printing" begin
2732

28-
iobuf = IOBuffer()
29-
# for now just test the interface and a bit of output
30-
@test printVariable(var1) == nothing
31-
@test printFactor(fac1) == nothing
33+
iobuf = IOBuffer()
34+
# for now just test the interface and a bit of output
35+
@test printVariable(var1) == nothing
36+
@test printFactor(fac1) == nothing
3237

33-
@test printVariable(iobuf, var1, skipfields=[:timestamp, :solver, :ppe]) == nothing
34-
@test String(take!(iobuf)) == "DFGVariable{TestSofttype1}\nlabel:\n:a\ntags:\nSet([:VARIABLE, :POSE])\nsmallData:\nDict(\"small\"=>\"data\")\nbigData:\nDict{Symbol,AbstractBigDataEntry}()\n_dfgNodeParams:\nDFGNodeParams(0)\n"
38+
@test printVariable(iobuf, var1, skipfields=[:timestamp, :solver, :ppe]) == nothing
39+
@test String(take!(iobuf)) == "DFGVariable{TestSofttype1}\nlabel:\n:a\ntags:\nSet([:VARIABLE, :POSE])\nsmallData:\nDict(\"small\"=>\"data\")\nbigData:\nDict{Symbol,AbstractBigDataEntry}()\n_dfgNodeParams:\nDFGNodeParams(0)\n"
3540

36-
@test printVariable(iobuf, var1, short=true) == nothing
37-
@test String(take!(iobuf)) == "DFGVariable{TestSofttype1}\nlabel: a\ntags: Set([:VARIABLE, :POSE])\nsize marginal samples: (1, 1)\nkde bandwidths: [0.0]\nNo PPEs\n"
41+
@test printVariable(iobuf, var1, short=true) == nothing
42+
@test String(take!(iobuf)) == "DFGVariable{TestSofttype1}\nlabel: a\ntags: Set([:VARIABLE, :POSE])\nsize marginal samples: (1, 1)\nkde bandwidths: [0.0]\nNo PPEs\n"
3843

3944

40-
@test printFactor(iobuf, fac1, skipfields=[:timestamp, :solver]) == nothing
41-
@test occursin(r"DFGFactor.*\nlabel:\n:abf1", String(take!(iobuf)))
45+
@test printFactor(iobuf, fac1, skipfields=[:timestamp, :solver]) == nothing
46+
@test occursin(r"DFGFactor.*\nlabel:\n:abf1", String(take!(iobuf)))
4247

43-
String(take!(iobuf)) == "DFGFactor{TestCCW{TestFunctorInferenceType1}}\nlabel:\n:abf1\ntags:\nSet([:tag1, :tag2])\nsolvable:\n0\n_dfgNodeParams:\nDFGNodeParams(1)\n_variableOrderSymbols:\n[:a, :b]\n"
48+
String(take!(iobuf)) == "DFGFactor{TestCCW{TestFunctorInferenceType1}}\nlabel:\n:abf1\ntags:\nSet([:tag1, :tag2])\nsolvable:\n0\n_dfgNodeParams:\nDFGNodeParams(1)\n_variableOrderSymbols:\n[:a, :b]\n"
4449

45-
@test printFactor(iobuf, fac1, short=true) == nothing
46-
@test occursin(r"DFGFactor.*\nlabel.*\ntimestamp.*\ntags.*\nsolvable", String(take!(iobuf)))
50+
@test printFactor(iobuf, fac1, short=true) == nothing
51+
@test occursin(r"DFGFactor.*\nlabel.*\ntimestamp.*\ntags.*\nsolvable", String(take!(iobuf)))
4752

48-
# s = String(take!(iobuf))
53+
# s = String(take!(iobuf))
4954

50-
@test show(var1) == nothing
51-
@test show(fac1) == nothing
55+
@test show(var1) == nothing
56+
@test show(fac1) == nothing
5257

53-
@test show(iobuf, MIME("text/plain"), var1) == nothing
54-
isapprox(length(take!(iobuf)), 452, atol=10)
55-
@test show(iobuf, MIME("text/plain"), fac1) == nothing
56-
isapprox(length(take!(iobuf)), 301, atol=10)
58+
@test show(iobuf, MIME("text/plain"), var1) == nothing
59+
isapprox(length(take!(iobuf)), 452, atol=10)
60+
@test show(iobuf, MIME("text/plain"), fac1) == nothing
61+
isapprox(length(take!(iobuf)), 301, atol=10)
5762

58-
end
63+
@test printVariable(fg1, :a) == nothing
64+
@test printFactor(fg1, :abf1) == nothing
5965

60-
@testset "Variables and Factors CRUD and SET" begin
61-
VariablesandFactorsCRUD_SET!(fg1, var1, var2, var3, fac0, fac1, fac2)
62-
end
66+
@test printNode(fg1, :a) == nothing
67+
@test printNode(fg1, :abf1) == nothing
6368

69+
show(stdout, MIME("application/prs.juno.inline"), var1) == var1
70+
show(stdout, MIME("application/prs.juno.inline"), fac1) == fac1
71+
end
6472

6573
@testset "tags" begin
6674
tagsTestBlock!(fg1, var1, v1_tags)

0 commit comments

Comments
 (0)