Add mjmDef to C API.

PiperOrigin-RevId: 607310534
Change-Id: I530f32c8fd4340dc1006585259a5e05cb4aa62b8
This commit is contained in:
Alessio Quaglino
2024-02-15 06:16:56 -08:00
committed by Copybara-Service
parent 6f958bc404
commit 414a67640a
10 changed files with 405 additions and 263 deletions
+25
View File
@@ -437,6 +437,31 @@ TEST_F(XMLReaderTest, InvalidDoubleOrientation) {
}
}
}
TEST_F(XMLReaderTest, RepeatedDefaultName) {
static constexpr char xml[] = R"(
<mujoco>
<default>
<default class="sphere">
<geom type="sphere" size="1"/>
</default>
<default class="sphere">
<geom type="capsule" size="1 1"/>
</default>
</default>
<worldbody>
<body>
<geom class="sphere"/>
</body>
</worldbody>
</mujoco>
)";
std::array<char, 1024> error;
mjModel* model = LoadModelFromString(xml, error.data(), error.size());
ASSERT_THAT(model, IsNull()) << error.data();
EXPECT_THAT(error.data(), HasSubstr("repeated default class name"));
}
// ------------------------ test including -------------------------------------
TEST_F(XMLReaderTest, IncludeTest) {