From 230e45d609df963ac2ed9628191a9db148de4ff1 Mon Sep 17 00:00:00 2001 From: Jonas Schumacher Date: Wed, 8 Apr 2026 11:12:50 +0200 Subject: [PATCH] Fix self-creating in-memory MDFs --- src/MDFInMemory.jl | 1 + test/MDFInMemory.jl | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/MDFInMemory.jl b/src/MDFInMemory.jl index 63437df8..9141a827 100644 --- a/src/MDFInMemory.jl +++ b/src/MDFInMemory.jl @@ -604,6 +604,7 @@ mutable struct MDFv2InMemory <: MPIFile # TODO: Not sure, if MPIFile is a good f end end +MDFv2InMemory(mdfFile::MDFv2InMemory) = deepcopy(mdffile) MDFv2InMemory(mdfFile::MDFFileV2) = inMemoryMDFFromMDFFileV2(mdfFile) MDFv2InMemory(dict::Dict) = inMemoryMDFFromDict(dict) diff --git a/test/MDFInMemory.jl b/test/MDFInMemory.jl index 27769499..ccb9857d 100644 --- a/test/MDFInMemory.jl +++ b/test/MDFInMemory.jl @@ -226,6 +226,13 @@ end @test rxUnit(mdf) == "V" end + @testset "Self-creation" begin + mdf = defaultMDFv2InMemory() + mdf_self = MDFv2InMemory(mdf) + + @test typeof(mdf_self) == MDFv2InMemory + end + @testset "Dict" begin @testset "String keys" begin dict = Dict{String, Any}()