Add stack leak test to WriteReadCompare
PiperOrigin-RevId: 572953669 Change-Id: Id6cad3fc86777d68f218119f67c9dc473bdcfcc8
This commit is contained in:
committed by
Copybara-Service
parent
86859ad382
commit
493ae95d69
Vendored
+1
@@ -1,6 +1,7 @@
|
|||||||
<mujoco>
|
<mujoco>
|
||||||
<compiler autolimits="true" />
|
<compiler autolimits="true" />
|
||||||
<default>
|
<default>
|
||||||
|
<joint armature="0.1"/>
|
||||||
<default class="limited_false">
|
<default class="limited_false">
|
||||||
<joint limited="false"/>
|
<joint limited="false"/>
|
||||||
</default>
|
</default>
|
||||||
|
|||||||
@@ -1049,8 +1049,10 @@ mjtNum CompareModel(const mjModel* m1, const mjModel* m2,
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(PluginTest, WriteReadCompare) {
|
TEST_F(PluginTest, WriteReadCompare) {
|
||||||
|
// full precision float printing
|
||||||
FullFloatPrecision increase_precision;
|
FullFloatPrecision increase_precision;
|
||||||
// Loop over all xml files in data
|
|
||||||
|
// loop over all xml files in data
|
||||||
std::vector<std::string> paths = {GetTestDataFilePath("."),
|
std::vector<std::string> paths = {GetTestDataFilePath("."),
|
||||||
GetModelPath(".")};
|
GetModelPath(".")};
|
||||||
std::string ext(".xml");
|
std::string ext(".xml");
|
||||||
@@ -1101,6 +1103,11 @@ TEST_F(PluginTest, WriteReadCompare) {
|
|||||||
mj_deleteModel(mtemp);
|
mj_deleteModel(mtemp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for stack memory leak
|
||||||
|
mj_step(m, d);
|
||||||
|
EXPECT_EQ(d->pstack, 0) << "mjData stack memory leak detected in " <<
|
||||||
|
p.path().string() << '\n';
|
||||||
|
|
||||||
// delete original structures
|
// delete original structures
|
||||||
mj_deleteData(d);
|
mj_deleteData(d);
|
||||||
mj_deleteModel(m);
|
mj_deleteModel(m);
|
||||||
|
|||||||
Reference in New Issue
Block a user