Change the type of state signature arguments from unsigned int to int

PiperOrigin-RevId: 843162492
Change-Id: I51d3324f088e8055898e115bdd32267c5950a412
This commit is contained in:
Yuval Tassa
2025-12-11 04:33:33 -08:00
committed by Copybara-Service
parent fe0a11d58d
commit 1ff74ba810
9 changed files with 92 additions and 46 deletions
+9 -1
View File
@@ -844,14 +844,22 @@ TEST_F(SupportTest, ExtractState) {
std::strncpy(last_error_msg, msg, sizeof(last_error_msg));
++error_count;
};
auto* old_mju_user_error = mju_user_error;
mju_user_error = error_handler;
mj_extractState(model, nullptr, srcsig, nullptr, mjSTATE_QFRC_APPLIED);
mju_user_error = old_mju_user_error;
EXPECT_EQ(error_count, 1);
EXPECT_EQ(std::string_view(last_error_msg),
"mj_extractState: dstsig is not a subset of srcsig");
mj_extractState(model, nullptr, -1, nullptr, mjSTATE_QFRC_APPLIED);
EXPECT_EQ(error_count, 2);
EXPECT_EQ(std::string_view(last_error_msg),
"mj_extractState: invalid srcsig -1 < 0");
mju_user_error = old_mju_user_error;
mj_deleteData(data);
mj_deleteModel(model);
}