Remove deprecated mju_{error,warning}_{i,s} functions.
PiperOrigin-RevId: 925204136 Change-Id: Ia877d08a135092db8037d04e6a237e81325a1d7c
This commit is contained in:
committed by
Copybara-Service
parent
ad23db5942
commit
062b0f1ea6
@@ -68,70 +68,6 @@ class MujocoErrorAndWarningTest : public ::testing::Test {
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(MujocoErrorAndWarningTest, MjuErrorI) {
|
||||
std::string format_string = "%010d";
|
||||
while (format_string.length() < 2 * kBufferSize) {
|
||||
format_string += 'x';
|
||||
}
|
||||
|
||||
std::string expected_message = "0123456789";
|
||||
while (expected_message.length() < kBufferSize - 1) {
|
||||
expected_message += 'x';
|
||||
}
|
||||
|
||||
ClearErrorMessage();
|
||||
mju_error_i(format_string.c_str(), 123456789);
|
||||
EXPECT_EQ(std::string(ErrorMessageBuffer()), expected_message);
|
||||
}
|
||||
|
||||
TEST_F(MujocoErrorAndWarningTest, MjuWarningI) {
|
||||
std::string format_string = "%010d";
|
||||
while (format_string.length() < 2 * kBufferSize) {
|
||||
format_string += 'x';
|
||||
}
|
||||
|
||||
std::string expected_message = "0123456789";
|
||||
while (expected_message.length() < kBufferSize - 1) {
|
||||
expected_message += 'x';
|
||||
}
|
||||
|
||||
ClearWarningMessage();
|
||||
mju_warning_i(format_string.c_str(), 123456789);
|
||||
EXPECT_EQ(std::string(WarningMessageBuffer()), expected_message);
|
||||
}
|
||||
|
||||
TEST_F(MujocoErrorAndWarningTest, MjuErrorS) {
|
||||
std::string format_string = "% 9s";
|
||||
while (format_string.length() < 2 * kBufferSize) {
|
||||
format_string += 'z';
|
||||
}
|
||||
|
||||
std::string expected_message = " foobar";
|
||||
while (expected_message.length() < kBufferSize - 1) {
|
||||
expected_message += 'z';
|
||||
}
|
||||
|
||||
ClearErrorMessage();
|
||||
mju_error_s(format_string.c_str(), "foobar");
|
||||
EXPECT_EQ(std::string(ErrorMessageBuffer()), expected_message);
|
||||
}
|
||||
|
||||
TEST_F(MujocoErrorAndWarningTest, MjuWarningS) {
|
||||
std::string format_string = "% 9s";
|
||||
while (format_string.length() < 2 * kBufferSize) {
|
||||
format_string += 'z';
|
||||
}
|
||||
|
||||
std::string expected_message = " foobar";
|
||||
while (expected_message.length() < kBufferSize - 1) {
|
||||
expected_message += 'z';
|
||||
}
|
||||
|
||||
ClearWarningMessage();
|
||||
mju_warning_s(format_string.c_str(), "foobar");
|
||||
EXPECT_EQ(std::string(WarningMessageBuffer()), expected_message);
|
||||
}
|
||||
|
||||
TEST_F(MujocoErrorAndWarningTest, MjuErrorInternal) {
|
||||
ClearErrorMessage();
|
||||
mjERROR("foobar %d", 123);
|
||||
|
||||
Reference in New Issue
Block a user