diff --git a/src/FMI2/md.jl b/src/FMI2/md.jl index 0a4d955..4e303ce 100644 --- a/src/FMI2/md.jl +++ b/src/FMI2/md.jl @@ -407,6 +407,8 @@ function parseUnknown(md::fmi2ModelDescription, node::EzXML.Node) if length(dependenciesSplit) > 0 varDep.dependencies = collect(parse(UInt, e) for e in dependenciesSplit) end + else + varDep.dependencies = UInt[] end end @@ -419,6 +421,8 @@ function parseUnknown(md::fmi2ModelDescription, node::EzXML.Node) stringToDependencyKind(md, e) for e in dependenciesKindSplit ) end + else + varDep.dependenciesKind = fmi2DependencyKind[] end end diff --git a/src/FMI3/md.jl b/src/FMI3/md.jl index 1f931db..ddaf225 100644 --- a/src/FMI3/md.jl +++ b/src/FMI3/md.jl @@ -464,6 +464,8 @@ function parseDependencies(md::fmi3ModelDescription, node::EzXML.Node) if length(dependenciesSplit) > 0 varDep.dependencies = collect(parse(UInt, e) for e in dependenciesSplit) end + else + varDep.dependencies = UInt[] end end @@ -475,6 +477,8 @@ function parseDependencies(md::fmi3ModelDescription, node::EzXML.Node) varDep.dependenciesKind = collect(stringToDependencyKind(md, e) for e in dependenciesKindSplit) end + else + varDep.dependenciesKind = fmi3DependencyKind[] end end diff --git a/test/FMI2/model_description.jl b/test/FMI2/model_description.jl index 4a08a02..7d52c00 100644 --- a/test/FMI2/model_description.jl +++ b/test/FMI2/model_description.jl @@ -134,3 +134,17 @@ for sv in myFMU.modelDescription.modelVariables end unloadFMU(myFMU) + +myFMU = loadFMU("BouncingBall", "ModelicaReferenceFMUs", "0.0.30", "2.0") +@test isnothing(myFMU.modelDescription.modelStructure.derivatives[1].dependencies) + +info(myFMU) # check if there is an error thrown + +unloadFMU(myFMU) + +myFMU = loadFMU("Dahlquist", "ModelicaReferenceFMUs", "0.0.30", "2.0") +@test !isnothing(myFMU.modelDescription.modelStructure.outputs[1].dependencies) + +info(myFMU) # check if there is an error thrown + +unloadFMU(myFMU) diff --git a/test/FMI3/model_description.jl b/test/FMI3/model_description.jl index 23eb7cc..2544770 100644 --- a/test/FMI3/model_description.jl +++ b/test/FMI3/model_description.jl @@ -34,7 +34,17 @@ myFMU = loadFMU("BouncingBall", "ModelicaReferenceFMUs", "0.0.30", "3.0") @test myFMU.modelDescription.eventIndicatorValueReferences == [1] @test typeof(myFMU.modelDescription.modelStructure.eventIndicators[1]) == fmi3VariableDependency +@test isnothing(myFMU.modelDescription.modelStructure.continuousStateDerivatives[1].dependencies) + info(myFMU) # check if there is an error thrown unloadFMU(myFMU) + +# Sadly there are no FMI3-Reference-FMUs with dependencies="" +# myFMU = loadFMU("Dahlquist", "ModelicaReferenceFMUs", "0.0.30", "3.0") +# @test !isnothing(myFMU.modelDescription.modelStructure.outputs[1].dependencies) + +# info(myFMU) # check if there is an error thrown + +# unloadFMU(myFMU)