Move schema definition validation from runtime to a test.

PiperOrigin-RevId: 606280564
Change-Id: I9fec9eb3538f63f84e1982f21e1a93f16342d540
This commit is contained in:
Kyle Bayes
2024-02-12 09:48:44 -08:00
committed by Copybara-Service
parent b6873ec8a2
commit eabd4c06f9
5 changed files with 157 additions and 79 deletions
+1 -8
View File
@@ -81,8 +81,7 @@ void ReadPluginConfigs(tinyxml2::XMLElement* elem, mjCPlugin* pp) {
//---------------------------------- MJCF schema ---------------------------------------------------
static const int nMJCF = 227;
static const char* MJCF[nMJCF][mjXATTRNUM] = {
const char* MJCF[nMJCF][mjXATTRNUM] = {
{"mujoco", "!", "1", "model"},
{"<"},
{"compiler", "*", "20", "autolimits", "boundmass", "boundinertia", "settotalmass",
@@ -774,12 +773,6 @@ const mjMap flexself_map[5] = {
// constructor
mjXReader::mjXReader() : schema(MJCF, nMJCF) {
// check for schema construction error
if (!schema.GetError().empty()) {
throw mjXError(0, "Schema construction error: %s",
schema.GetError().c_str());
}
readingdefaults = false;
}