@@ -200,12 +200,11 @@ function DFGVariableSCA()
200
200
@test setTags! (v3, testTags) == Set (testTags)
201
201
@test setTags! (v3, Set (testTags)) == Set (testTags)
202
202
203
- # TODO Document
204
203
# NOTE a variable's timestamp is considered similar to its label. setTimestamp! (not implemented) would create a new variable and call updateVariable!
205
204
v1ts = setTimestamp (v1, testTimestamp)
206
205
@test getTimestamp (v1ts) == testTimestamp
207
206
# follow with updateVariable!(fg, v1ts)
208
- # setTimestamp!(v1, testTimestamp) not implemented, we can do an setTimestamp() updateVariable!() for a setTimestamp!(dfg, v1, testTimestamp)
207
+
209
208
@test_throws MethodError setTimestamp! (v1, testTimestamp)
210
209
211
210
@test setSolvable! (v1, 1 ) == 1
@@ -257,7 +256,7 @@ function DFGFactorSCA()
257
256
f1 = DFGFactor {TestCCW{TestFunctorInferenceType1}, Symbol} (f1_lbl)
258
257
f1 = DFGFactor (f1_lbl, [:a ,:b ], gfnd, tags = f1_tags, solvable= 0 )
259
258
260
- f2 = DFGFactor {TestFunctorInferenceType1, Symbol} (:f2 )
259
+ f2 = DFGFactor {TestFunctorInferenceType1, Symbol} (:bcf1 )
261
260
262
261
@test getLabel (f1) == f1_lbl
263
262
@test getTags (f1) == f1_tags
@@ -291,7 +290,7 @@ function DFGFactorSCA()
291
290
f1ts = setTimestamp (f1, testTimestamp)
292
291
@test ! (f1ts === f1)
293
292
@test getTimestamp (f1ts) == testTimestamp
294
- # follow with updateVariable !(fg, v1ts)
293
+ # follow with updateFactor !(fg, v1ts)
295
294
@test setTimestamp! (f1, testTimestamp) == testTimestamp
296
295
# /TODO
297
296
@@ -341,11 +340,20 @@ function VariablesandFactorsCRUD_SET!(fg, v1, v2, v3, f0, f1, f2)
341
340
342
341
@test getAddHistory (fg) == [:a , :b , :c ]
343
342
343
+ # Extra timestamp functions https://github.com/JuliaRobotics/DistributedFactorGraphs.jl/issues/315
344
+ if ! (v1 isa SkeletonDFGVariable)
345
+ newtimestamp = now ()
346
+ @test ! (setTimestamp! (fg, :c , newtimestamp) === v3)
347
+ @test getVariable (fg, :c ) |> getTimestamp == newtimestamp
348
+
349
+ @test ! (setTimestamp! (fg, :bcf1 , newtimestamp) === f2)
350
+ @test getFactor (fg, :bcf1 ) |> getTimestamp == newtimestamp
351
+ end
344
352
# deletions
345
- @test deleteVariable! (fg, v3 ) == v3
353
+ @test getVariable (fg, :c ) === deleteVariable! (fg, v3)
346
354
@test_throws ErrorException deleteVariable! (fg, v3)
347
355
@test setdiff (ls (fg),[:a ,:b ]) == []
348
- @test deleteFactor! (fg, f2 ) === f2
356
+ @test getFactor (fg, :bcf1 ) === deleteFactor! (fg, f2)
349
357
@test_throws ErrorException deleteFactor! (fg, f2)
350
358
@test lsf (fg) == [:abf1 ]
351
359
@@ -365,14 +373,13 @@ function VariablesandFactorsCRUD_SET!(fg, v1, v2, v3, f0, f1, f2)
365
373
@test getFactor (fg, :abf1 ) === f1
366
374
367
375
@test_throws ErrorException getVariable (fg, :c )
368
- @test_throws ErrorException getFactor (fg, :f2 )
369
-
376
+ @test_throws ErrorException getFactor (fg, :bcf1 )
370
377
371
378
# Existence
372
379
@test exists (fg, :a )
373
380
@test ! exists (fg, :c )
374
381
@test exists (fg, :abf1 )
375
- @test ! exists (fg, :f2 )
382
+ @test ! exists (fg, :bcf1 )
376
383
377
384
@test exists (fg, v1)
378
385
@test ! exists (fg, v3)
0 commit comments