|
23 | 23 | end
|
24 | 24 |
|
25 | 25 |
|
| 26 | +@testset "Variables and Factors CRUD and SET" begin |
| 27 | + VariablesandFactorsCRUD_SET!(fg1, var1, var2, var3, fac0, fac1, fac2) |
| 28 | +end |
| 29 | + |
| 30 | + |
26 | 31 | @testset "Custom Printing" begin
|
27 | 32 |
|
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 |
32 | 37 |
|
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" |
35 | 40 |
|
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" |
38 | 43 |
|
39 | 44 |
|
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))) |
42 | 47 |
|
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" |
44 | 49 |
|
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))) |
47 | 52 |
|
48 |
| -# s = String(take!(iobuf)) |
| 53 | + # s = String(take!(iobuf)) |
49 | 54 |
|
50 |
| -@test show(var1) == nothing |
51 |
| -@test show(fac1) == nothing |
| 55 | + @test show(var1) == nothing |
| 56 | + @test show(fac1) == nothing |
52 | 57 |
|
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) |
57 | 62 |
|
58 |
| -end |
| 63 | + @test printVariable(fg1, :a) == nothing |
| 64 | + @test printFactor(fg1, :abf1) == nothing |
59 | 65 |
|
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 |
63 | 68 |
|
| 69 | + show(stdout, MIME("application/prs.juno.inline"), var1) == var1 |
| 70 | + show(stdout, MIME("application/prs.juno.inline"), fac1) == fac1 |
| 71 | +end |
64 | 72 |
|
65 | 73 | @testset "tags" begin
|
66 | 74 | tagsTestBlock!(fg1, var1, v1_tags)
|
|
0 commit comments