Skip to content

Commit 6ef9ac8

Browse files
committed
Fix tests
1 parent 3d6c96d commit 6ef9ac8

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/services/CompareUtils.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ const GeneratedCompareUnion = Union{
3030
FactorDFG,
3131
FactorSummary,
3232
FactorSkeleton,
33+
FactorState,
3334
}
3435

3536
@generated function ==(x::T, y::T) where {T <: GeneratedCompareUnion}
36-
ignored = []
37+
ignored = [:computeMem]
3738
return mapreduce(
3839
n -> :(x.$n == y.$n),
3940
(a, b) -> :($a && $b),

src/services/DFGFactor.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Return user factor type from factor graph identified by label `::Symbol`.
3232
Notes
3333
- Replaces older `getfnctype`.
3434
"""
35-
getFactorType(data::GenericFunctionNodeData) = data.fnc.usrfnc!
35+
getFactorType(data::GenericFunctionNodeData{<:FactorOperationalMemory}) = data.fnc.usrfnc!
36+
getFactorType(data::GenericFunctionNodeData{<:AbstractFactor}) = data.fnc
3637
getFactorType(fct::FactorCompute) = getFactorType(getSolverData(fct))
3738
getFactorType(f::FactorDFG) = getTypeFromSerializationModule(f.fnctype)() # TODO find a better way to do this that does not rely on empty constructor
3839
getFactorType(dfg::AbstractDFG, lbl::Symbol) = getFactorType(getFactor(dfg, lbl))

test/testBlocks.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,13 @@ function DFGFactorSCA()
395395

396396
gfnd = GenericFunctionNodeData(; fnc = TestCCW(TestFunctorInferenceType1()))
397397

398-
f1 = FactorCompute{TestCCW{TestFunctorInferenceType1}}(f1_lbl, [:a, :b])
399398
f1 = FactorCompute(f1_lbl, [:a, :b], gfnd; tags = f1_tags, solvable = 0)
400399

401-
f2 = FactorCompute{TestCCW{TestFunctorInferenceType1}}(
400+
f2 = FactorCompute(
402401
:bcf1,
403402
[:b, :c],
404-
ZonedDateTime("2020-08-11T00:12:03.000-05:00"),
403+
GenericFunctionNodeData(; fnc=TestCCW{TestFunctorInferenceType1}());
404+
timestamp = ZonedDateTime("2020-08-11T00:12:03.000-05:00"),
405405
)
406406
#TODO add tests for mutating vos in updateFactor and orphan related checks.
407407
# we should perhaps prevent an empty vos
@@ -473,7 +473,7 @@ function VariablesandFactorsCRUD_SET!(fg, v1, v2, v3, f0, f1, f2)
473473
@test getLabel(fg[getLabel(v1)]) == getLabel(v1)
474474

475475
#TODO standardize this error and res also for that matter
476-
fnope = FactorCompute{TestCCW{TestFunctorInferenceType1}}(:broken, [:a, :nope])
476+
fnope = FactorCompute(:broken, [:a, :nope], GenericFunctionNodeData(; fnc=TestCCW{TestFunctorInferenceType1}()))
477477
@test_throws KeyError addFactor!(fg, fnope)
478478

479479
@test addFactor!(fg, f1) == f1
@@ -1683,7 +1683,7 @@ function ProducingDotFiles(
16831683
end
16841684
if f1 === nothing
16851685
if (FACTYPE == FactorCompute)
1686-
f1 = FactorCompute{TestFunctorInferenceType1}(:abf1, [:a, :b])
1686+
f1 = FactorCompute(:abf1, [:a, :b], GenericFunctionNodeData(;fnc = TestFunctorInferenceType1()))
16871687
else
16881688
f1 = FACTYPE(:abf1, [:a, :b])
16891689
end

0 commit comments

Comments
 (0)