Skip to content

Commit

Permalink
Remove use of deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
alxbilger committed Dec 18, 2023
1 parent d97cee8 commit 91ea3b0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 31 deletions.
3 changes: 0 additions & 3 deletions tests/component/constraint/SurfacePressureConstraintTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ namespace softrobots {
using SurfacePressureConstraint<_DataTypes>::d_componentState;

sofa::simulation::Node::SPtr m_root; ///< Root of the scene graph, created by the constructor an re-used in the tests
sofa::simulation::Simulation* m_simulation; ///< created by the constructor an re-used in the tests

typedef _DataTypes DataTypes;
typedef typename DataTypes::Deriv Deriv;
Expand All @@ -83,8 +82,6 @@ namespace softrobots {
{
sofa::simpleapi::importPlugin("Sofa.Component");

sofa::simulation::setSimulation(m_simulation = new sofa::simulation::graph::DAGSimulation());

/// Load the scene
string sceneName = "SurfacePressureConstraint.scn";

Expand Down
8 changes: 3 additions & 5 deletions tests/component/constraint/UnilateralPlaneConstraintTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,9 @@ struct UnilateralPlaneConstraintTest : public sofa::testing::BaseTest,
/////////////////////////////////////////////////////////////////////


void normalTests(){
Simulation* simu;
setSimulation(simu = new sofa::simulation::graph::DAGSimulation());

Node::SPtr node = simu->createNewGraph("root");
void normalTests()
{
const Node::SPtr node = sofa::simulation::getSimulation()->createNewGraph("root");
typename MechanicalObject<DataTypes>::SPtr mecaobject = New<MechanicalObject<DataTypes> >() ;
typename ThisClass::SPtr thisobject = New<ThisClass >() ;

Expand Down
4 changes: 1 addition & 3 deletions tests/component/controller/DataVariationLimiterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,11 @@ struct DataVariationLimiterTest : public sofa::testing::BaseTest, DataVariationL
///////////////////////////////////////////////////////////////


Simulation* m_simu;
Node::SPtr m_node;

void SetUp()
{
setSimulation(m_simu = new sofa::simulation::graph::DAGSimulation());
m_node = m_simu->createNewGraph("root");
m_node = sofa::simulation::getSimulation()->createNewGraph("root");
}

void normalTests(){
Expand Down
4 changes: 1 addition & 3 deletions tests/component/controller/SerialPortBridgeGenericTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,11 @@ struct SerialPortBridgeGenericTest : public sofa::testing::BaseTest, SerialPortB
///////////////////////////////////////////////////////////////


Simulation* m_simu;
Node::SPtr m_node;

void SetUp()
{
setSimulation(m_simu = new sofa::simulation::graph::DAGSimulation());
m_node = m_simu->createNewGraph("root");
m_node = sofa::simulation::getSimulation()->createNewGraph("root");
}

void normalTests(){
Expand Down
13 changes: 4 additions & 9 deletions tests/component/engine/VolumeFromTetrahedronsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,9 @@ struct VolumeFromTetrahedronsTest : public sofa::testing::BaseTest, VolumeFromTe
///////////////////////////////////////////////////////////////


void normalTests(){
Simulation* simu;
setSimulation(simu = new sofa::simulation::graph::DAGSimulation());

Node::SPtr node = simu->createNewGraph("root");
void normalTests()
{
const Node::SPtr node = sofa::simulation::getSimulation()->createNewGraph("root");
typename MechanicalObject<DataTypes>::SPtr mecaobject = New<MechanicalObject<DataTypes> >() ;
typename ThisClass::SPtr thisobject = New<ThisClass >() ;
mecaobject->init() ;
Expand Down Expand Up @@ -126,10 +124,7 @@ struct VolumeFromTetrahedronsTest : public sofa::testing::BaseTest, VolumeFromTe
{
DataRepository.addFirstPath(SOFTROBOTS_TEST_DIR);

Simulation* simu;
setSimulation(simu = new sofa::simulation::graph::DAGSimulation());

Node::SPtr node = simu->createNewGraph("root");
const Node::SPtr node = sofa::simulation::getSimulation()->createNewGraph("root");

typename TetrahedronSetTopologyContainer::SPtr mesh = New< TetrahedronSetTopologyContainer >() ;
typename MechanicalObject<DataTypes>::SPtr mecaobject = New< MechanicalObject<DataTypes> >() ;
Expand Down
10 changes: 2 additions & 8 deletions tests/component/engine/VolumeFromTrianglesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ struct VolumeFromTrianglesTest : public sofa::testing::BaseTest, VolumeFromTrian

void normalTests()
{
Simulation* simu;
setSimulation(simu = new sofa::simulation::graph::DAGSimulation());

Node::SPtr node = simu->createNewGraph("root");
Node::SPtr node = sofa::simulation::getSimulation()->createNewGraph("root");
typename MechanicalObject<DataTypes>::SPtr mecaobject = New<MechanicalObject<DataTypes> >() ;
typename ThisClass::SPtr thisobject = New<ThisClass >() ;
mecaobject->init() ;
Expand Down Expand Up @@ -129,10 +126,7 @@ struct VolumeFromTrianglesTest : public sofa::testing::BaseTest, VolumeFromTrian
{
DataRepository.addFirstPath(SOFTROBOTS_TEST_DIR);

Simulation* simu;
setSimulation(simu = new sofa::simulation::graph::DAGSimulation());

Node::SPtr node = simu->createNewGraph("root");
Node::SPtr node = sofa::simulation::getSimulation()->createNewGraph("root");

typename MeshTopology::SPtr mesh = New< MeshTopology >() ;
typename MechanicalObject<DataTypes>::SPtr mecaobject = New< MechanicalObject<DataTypes> >() ;
Expand Down

0 comments on commit 91ea3b0

Please sign in to comment.