Avoid out-of-bounds access when checking file extensions.
Include the '.' in the file extension check. PiperOrigin-RevId: 474866478 Change-Id: I809ae975e4c8b00f17278735975a7d07e0748643
This commit is contained in:
committed by
Copybara-Service
parent
68718e76b1
commit
f556d4d94f
@@ -265,6 +265,22 @@ TEST_F(MjCGeomTest, CapsuleInertiaX) {
|
||||
mj_deleteModel(model);
|
||||
}
|
||||
|
||||
// ------------- test height fields --------------------------------------------
|
||||
|
||||
using MjCHFieldTest = MujocoTest;
|
||||
|
||||
TEST_F(MjCHFieldTest, PngMap) {
|
||||
const std::string xml_path =
|
||||
GetTestDataFilePath("user/testdata/png_hfield.xml");
|
||||
std::array<char, 1024> error;
|
||||
mjModel* model =
|
||||
mj_loadXML(xml_path.c_str(), nullptr, error.data(), error.size());
|
||||
ASSERT_THAT(model, ::testing::NotNull()) << error.data();
|
||||
EXPECT_EQ(model->nhfield, 1);
|
||||
EXPECT_EQ(model->geom_type[0], mjGEOM_HFIELD);
|
||||
mj_deleteModel(model);
|
||||
}
|
||||
|
||||
// ------------- test quaternion normalization----------------------------------
|
||||
|
||||
using QuatNorm = MujocoTest;
|
||||
|
||||
Reference in New Issue
Block a user