From 4e86097861d2b73d1ab788cdec5635116c017b44 Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Wed, 13 Nov 2024 09:31:26 +0900 Subject: [PATCH] add test with a bogus link path --- Sofa/framework/SimpleApi/test/SimpleApi_test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Sofa/framework/SimpleApi/test/SimpleApi_test.cpp b/Sofa/framework/SimpleApi/test/SimpleApi_test.cpp index a1226dc8614..f9c26dfccd7 100644 --- a/Sofa/framework/SimpleApi/test/SimpleApi_test.cpp +++ b/Sofa/framework/SimpleApi/test/SimpleApi_test.cpp @@ -130,5 +130,15 @@ TEST(SimpleApi_test_solo, testIsSetWithDataLink) }); auto* objdata4 = obj4->findData("printLog"); ASSERT_TRUE(objdata4->isSet()); + + // test link with a wrong path (or non existent parent) + const auto obj6 = createObject(root, "DefaultAnimationLoop", { + {"name", "loop6"}, + {"printLog", "@/loop7.printLog"} + }); + + auto* objdata6 = obj6->findData("printLog"); + ASSERT_TRUE(objdata6->isSet()); + ASSERT_EQ(objdata6->getParent(), nullptr); }