Skip to content

Commit b44f837

Browse files
authored
Merge pull request #158 from fredroy/fix_unittests_warn_register
Unit Tests: Fix loading plugins
2 parents 969bed3 + dd7c752 commit b44f837

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

BeamAdapter_test/BeamInterpolation_test.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ using sofa::core::objectmodel::New ;
4848
using sofa::core::objectmodel::BaseData ;
4949
using sofa::component::statecontainer::MechanicalObject ;
5050

51+
#include <sofa/simpleapi/SimpleApi.h>
52+
5153
#include <regex>
5254
#include <vector>
5355
#include <string>
@@ -61,17 +63,21 @@ namespace sofa
6163
struct BeamInterpolationTest : public sofa::testing::BaseSimulationTest,
6264
public ::testing::WithParamInterface<std::vector<std::string>>
6365
{
66+
void SetUp() override
67+
{
68+
sofa::simpleapi::importPlugin("Sofa.Component.ODESolver.Backward");
69+
sofa::simpleapi::importPlugin("Sofa.Component.LinearSolver.Iterative");
70+
sofa::simpleapi::importPlugin("Sofa.Component.StateContainer");
71+
sofa::simpleapi::importPlugin("Sofa.Component.Topology.Container.Constant");
72+
sofa::simpleapi::importPlugin("BeamAdapter");
73+
}
74+
6475
void simpleScene(const std::vector<std::string>& lines)
6576
{
6677
assert(lines.size()==3);
6778
string scene =
6879
"<?xml version='1.0'?>"
6980
"<Node name='Root' gravity='0 0 0' time='0' animate='0'>"
70-
" <RequiredPlugin name='Sofa.Component.ODESolver.Backward' />"
71-
" <RequiredPlugin name='Sofa.Component.LinearSolver.Iterative' />"
72-
" <RequiredPlugin name='Sofa.Component.StateContainer' />"
73-
" <RequiredPlugin name='Sofa.Component.Topology.Container.Constant' />"
74-
" <RequiredPlugin name='BeamAdapter' />"
7581
" <EulerImplicitSolver rayleighStiffness='0.08' rayleighMass='0.08' printLog='false' />"
7682
" <CGLinearSolver iterations='100' threshold='1e-10' tolerance='1e-15' />"
7783
" $line1"

0 commit comments

Comments
 (0)