diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3c70fce1..046bdadf 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -57,7 +57,6 @@ target_compile_definitions(fixture PUBLIC MJSTATIC) target_link_libraries( fixture PUBLIC absl::core_headers - absl::strings absl::synchronization gtest gmock diff --git a/test/fixture.cc b/test/fixture.cc index 4c451b65..4fdad189 100644 --- a/test/fixture.cc +++ b/test/fixture.cc @@ -14,11 +14,14 @@ #include "test/fixture.h" +#include #include #include #include -#include +#include +#include #include +#include #include #include @@ -107,7 +110,7 @@ mjModel* LoadModelFromPath(const char* model_path) { return model; } -const std::string GetFileContents(const char* path) { +std::string GetFileContents(const char* path) { std::ifstream ifs; ifs.open(path, std::ifstream::in); EXPECT_FALSE(ifs.fail()); @@ -116,7 +119,7 @@ const std::string GetFileContents(const char* path) { return sstream.str(); } -const std::string SaveAndReadXml(const mjModel* model) { +std::string SaveAndReadXml(const mjModel* model) { EXPECT_THAT(model, testing::NotNull()); constexpr int kMaxPathLen = 1024; diff --git a/test/fixture.h b/test/fixture.h index cdf097ec..6091a2a5 100644 --- a/test/fixture.h +++ b/test/fixture.h @@ -17,13 +17,11 @@ #include #include -#include #include +#include #include #include -#include -#include #include #include @@ -80,14 +78,14 @@ auto MjuErrorMessageFrom(Return (*func)(Args...)) { } // Returns a path to a data file, under the mujoco/test directory. -const std::string GetTestDataFilePath(absl::string_view path); +const std::string GetTestDataFilePath(std::string_view path); // Returns a path to a data file, under the mujoco/model directory. -const std::string GetModelPath(absl::string_view path); +const std::string GetModelPath(std::string_view path); // Returns a newly-allocated mjModel, loaded from the contents of xml. // On failure returns nullptr and populates the error array if present. -mjModel* LoadModelFromString(absl::string_view xml, char* error = nullptr, +mjModel* LoadModelFromString(std::string_view xml, char* error = nullptr, int error_size = 0, mjVFS* vfs = nullptr); // Returns a newly-allocated mjModel, loaded from the contents in model_path. @@ -95,7 +93,7 @@ mjModel* LoadModelFromString(absl::string_view xml, char* error = nullptr, mjModel* LoadModelFromPath(const char* model_path); // Returns a string loaded from first saving the model given an input. -const std::string SaveAndReadXml(const mjModel* model); +std::string SaveAndReadXml(const mjModel* model); // Adds control noise. std::vector GetCtrlNoise(const mjModel* m, int nsteps,