Move AsVector utility to fixture.h

PiperOrigin-RevId: 690577546
Change-Id: I2cebcffa1f2e3b0789f43e772e364c4762719ab3
This commit is contained in:
Yuval Tassa
2024-10-28 05:51:05 -07:00
committed by Copybara-Service
parent d95befaddd
commit a4a6248a06
15 changed files with 8 additions and 67 deletions
+2 -6
View File
@@ -20,7 +20,6 @@
#include <cstring>
#include <memory>
#include <string>
#include <vector>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -34,10 +33,6 @@ namespace {
constexpr double kInertiaTol = 1e-6;
std::vector<mjtNum> AsVector(const mjtNum* array, int n) {
return std::vector<mjtNum>(array, array + n);
}
using std::string;
using ::testing::DoubleNear;
using ::testing::ElementsAre;
@@ -2402,7 +2397,8 @@ TEST_F(UserObjectsTest, BadWeld) {
int len = 4;
// good model using body semantic
string xml = base.replace(pos, len, "<weld body1='1' anchor='0 0 1' torquescale='2'/>");
string xml = base.replace(pos, len,
"<weld body1='1' anchor='0 0 1' torquescale='2'/>");
char error[1024];
mjModel* m = LoadModelFromString(xml.c_str(), error, sizeof(error));
ASSERT_THAT(m, NotNull()) << error;