Exclude nbuffer from CompareModel.

This will give more informative errors when the test fails.

PiperOrigin-RevId: 653571444
Change-Id: I78b0a2bfc7794dae81607a9dbbdb91439af48b0c
This commit is contained in:
Alessio Quaglino
2024-07-18 04:49:33 -07:00
committed by Copybara-Service
parent dd9dd295ba
commit 67922f41b9
+6 -2
View File
@@ -218,9 +218,13 @@ mjtNum CompareModel(const mjModel* m1, const mjModel* m2,
// (needed in MJMODEL_POINTERS)
MJMODEL_POINTERS_PREAMBLE(m1);
// compare ints
// compare ints, exclude nbuffer because it hides the actual difference
#define X(name) \
if (m1->name != m2->name) {maxdif = m1->name - m2->name; field = #name;}
if (strncmp(#name, "nbuffer", 7)) { \
if (m1->name != m2->name) { \
maxdif = mju_abs(m1->name - m2->name); field = #name; \
} \
}
MJMODEL_INTS
#undef X
if (maxdif > 0) return maxdif;