Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of deprecated functions #253

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading