From 667275479d3272e4f2391e591a1138fecaad1162 Mon Sep 17 00:00:00 2001 From: gvolfing <gabor.volfinger@memgraph.io> Date: Fri, 19 Aug 2022 10:20:47 +0200 Subject: [PATCH] Rename folly command line argument injection related stuff --- tests/unit/{coward_the_cowardly_dog.h => cla_helper.hpp} | 6 ++++-- tests/unit/main.cpp | 4 ++-- tests/unit/thrift_transport_echo.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) rename tests/unit/{coward_the_cowardly_dog.h => cla_helper.hpp} (77%) diff --git a/tests/unit/coward_the_cowardly_dog.h b/tests/unit/cla_helper.hpp similarity index 77% rename from tests/unit/coward_the_cowardly_dog.h rename to tests/unit/cla_helper.hpp index 31eaf2c36..b4d5bc2cf 100644 --- a/tests/unit/coward_the_cowardly_dog.h +++ b/tests/unit/cla_helper.hpp @@ -16,7 +16,9 @@ namespace clahelper { inline std::string g_command_line_arg; } -class MyTestEnvironment : public testing::Environment { +class InjectedClaEnvironment : public testing::Environment { public: - explicit MyTestEnvironment(const std::string &command_line_arg) { clahelper::g_command_line_arg = command_line_arg; } + explicit InjectedClaEnvironment(const std::string &command_line_arg) { + clahelper::g_command_line_arg = command_line_arg; + } }; diff --git a/tests/unit/main.cpp b/tests/unit/main.cpp index 0b23dfbd2..3850ab692 100644 --- a/tests/unit/main.cpp +++ b/tests/unit/main.cpp @@ -12,14 +12,14 @@ #include <gtest/gtest.h> #include <utils/logging.hpp> -#include "coward_the_cowardly_dog.h" +#include "cla_helper.hpp" int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); std::string command_line_arg(argv[0]); testing::InitGoogleTest(&argc, argv); - testing::AddGlobalTestEnvironment(new MyTestEnvironment(command_line_arg)); + testing::AddGlobalTestEnvironment(new InjectedClaEnvironment(command_line_arg)); memgraph::logging::RedirectToStderr(); spdlog::set_level(spdlog::level::trace); diff --git a/tests/unit/thrift_transport_echo.cpp b/tests/unit/thrift_transport_echo.cpp index d849edc6f..297e976e3 100644 --- a/tests/unit/thrift_transport_echo.cpp +++ b/tests/unit/thrift_transport_echo.cpp @@ -25,7 +25,7 @@ #include "io/thrift/thrift_transport.hpp" -#include "coward_the_cowardly_dog.h" +#include "cla_helper.hpp" using namespace memgraph::io;