Add error reporting to model loading in engine tests, where missing

PiperOrigin-RevId: 795844607
Change-Id: I4163c53c05796c2e3036af28a98f58c15bb1c99c
This commit is contained in:
Yuval Tassa
2025-08-16 08:11:11 -07:00
committed by Copybara-Service
parent bbb70d98a4
commit 5a24eb2d34
16 changed files with 220 additions and 98 deletions
+6 -2
View File
@@ -78,7 +78,9 @@ TEST_F(SensorTest, DisableSensors) {
</sensor>
</mujoco>
)";
mjModel* model = LoadModelFromString(xml);
char error[1024];
mjModel* model = LoadModelFromString(xml, error, sizeof(error));
ASSERT_THAT(model, NotNull()) << error;
mjData* data = mj_makeData(model);
// before calling anything, check that sensors are initialised to 0
@@ -128,7 +130,9 @@ TEST_F(RelativeFrameSensorTest, ReferencePosMat) {
</sensor>
</mujoco>
)";
mjModel* model = LoadModelFromString(xml);
char error[1024];
mjModel* model = LoadModelFromString(xml, error, sizeof(error));
ASSERT_THAT(model, NotNull()) << error;
mjData* data = mj_makeData(model);
mj_forward(model, data);