Add XML parsing test case for large memory specification without suffix.

Startblock:
   diffbase is submitted
PiperOrigin-RevId: 479914967
Change-Id: I574612bf875c929803cf5abc3b1885e9855dee29
This commit is contained in:
Saran Tunyasuvunakool
2022-10-09 06:39:12 -07:00
committed by Copybara-Service
parent b2159a8e35
commit 5af11ca083
+11
View File
@@ -96,6 +96,17 @@ TEST_F(XMLReaderTest, MemorySize) {
EXPECT_EQ(model->nstack, 1024*1024*1024 / sizeof(mjtNum));
mj_deleteModel(model);
}
{
static constexpr char xml[] = R"(
<mujoco>
<size memory="1073741824"/>
</mujoco>
)";
mjModel* model = LoadModelFromString(xml, error.data(), error.size());
ASSERT_THAT(model, NotNull());
EXPECT_EQ(model->nstack, 1024*1024*1024 / sizeof(mjtNum));
mj_deleteModel(model);
}
}
TEST_F(XMLReaderTest, InvalidMemorySize) {