From 9e85eb1b37a280b2c45889a2705b42c522a303b8 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Mon, 6 May 2024 17:19:57 +0200 Subject: [PATCH] Found an empty module name --- BeamAdapter_test/CMakeLists.txt | 1 + .../AdaptiveBeamController_test.cpp | 38 +++++++++++++++++++ .../controller/AdaptiveBeamController.cpp | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 BeamAdapter_test/component/controller/AdaptiveBeamController_test.cpp diff --git a/BeamAdapter_test/CMakeLists.txt b/BeamAdapter_test/CMakeLists.txt index 60ee3438b..701022474 100644 --- a/BeamAdapter_test/CMakeLists.txt +++ b/BeamAdapter_test/CMakeLists.txt @@ -7,6 +7,7 @@ find_package(Threads REQUIRED) set(SOURCE_FILES BeamInterpolation_test.cpp + component/controller/AdaptiveBeamController_test.cpp component/controller/InterventionalRadiologyController_test.cpp component/constraint/AdaptiveBeamSlidingConstraintTest.cpp component/forcefield/AdaptiveBeamForceFieldAndMassTest.cpp diff --git a/BeamAdapter_test/component/controller/AdaptiveBeamController_test.cpp b/BeamAdapter_test/component/controller/AdaptiveBeamController_test.cpp new file mode 100644 index 000000000..65e14285e --- /dev/null +++ b/BeamAdapter_test/component/controller/AdaptiveBeamController_test.cpp @@ -0,0 +1,38 @@ +/****************************************************************************** +* BeamAdapter plugin * +* (c) 2006 Inria, University of Lille, CNRS * +* * +* This program is free software; you can redistribute it and/or modify it * +* under the terms of the GNU Lesser General Public License as published by * +* the Free Software Foundation; either version 2.1 of the License, or (at * +* your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * +* for more details. * +* * +* You should have received a copy of the GNU Lesser General Public License * +* along with this program. If not, see . * +******************************************************************************* +* Authors: see Authors.md * +* * +* Contact information: contact@sofa-framework.org * +******************************************************************************/ +#include +#include +#include +#include + +TEST(AdaptiveBeamController, target) +{ + const auto node = sofa::simpleapi::createNode("node"); + const auto controller = sofa::simpleapi::createObject(node, "AdaptiveBeamController"); + + const auto& creators = sofa::core::ObjectFactory::getInstance()->getEntry("AdaptiveBeamController").creatorMap; + + const auto it = creators.find(sofa::defaulttype::Rigid3Types::Name()); + EXPECT_NE(it, creators.end()); + + EXPECT_EQ(std::string(it->second->getTarget()), std::string("BeamAdapter")); +} diff --git a/src/BeamAdapter/component/controller/AdaptiveBeamController.cpp b/src/BeamAdapter/component/controller/AdaptiveBeamController.cpp index a6e634d4e..8a2c10a77 100644 --- a/src/BeamAdapter/component/controller/AdaptiveBeamController.cpp +++ b/src/BeamAdapter/component/controller/AdaptiveBeamController.cpp @@ -58,7 +58,7 @@ using core::RegisterObject; //////////////////////////////////////////////////////////////////////////////////////////////////// //TODO(dmarchal 2017-06-01): Il faut remplacer les descriptions dans RegisterObject par un vrai description -static int AdaptiveBeamControllerClass = RegisterObject("") +static int AdaptiveBeamControllerClass = RegisterObject("Adaptive beam controller") .add< AdaptiveBeamController >() ;