From 605838855fe84c30b788c884a419aaa509493cad Mon Sep 17 00:00:00 2001 From: Wolfgang Hess Date: Wed, 18 Nov 2020 16:06:53 +0100 Subject: [PATCH] Removed unused code. (#1781) Signed-off-by: Wolfgang Hess --- .../cloud/internal/testing/handler_test.h | 4 +- cartographer/testing/test_helpers.h | 51 ------------------- 2 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 cartographer/testing/test_helpers.h diff --git a/cartographer/cloud/internal/testing/handler_test.h b/cartographer/cloud/internal/testing/handler_test.h index 189a70d..b114a6a 100644 --- a/cartographer/cloud/internal/testing/handler_test.h +++ b/cartographer/cloud/internal/testing/handler_test.h @@ -19,11 +19,11 @@ #include "absl/memory/memory.h" #include "async_grpc/testing/rpc_handler_test_server.h" +#include "cartographer/cloud/internal/testing/mock_local_trajectory_uploader.h" +#include "cartographer/cloud/internal/testing/mock_map_builder_context.h" #include "cartographer/mapping/internal/testing/mock_map_builder.h" #include "cartographer/mapping/internal/testing/mock_pose_graph.h" #include "gtest/gtest.h" -#include "mock_local_trajectory_uploader.h" -#include "mock_map_builder_context.h" namespace cartographer { namespace cloud { diff --git a/cartographer/testing/test_helpers.h b/cartographer/testing/test_helpers.h deleted file mode 100644 index 4a7dbdf..0000000 --- a/cartographer/testing/test_helpers.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2018 The Cartographer Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CARTOGRAPHER_TESTING_TEST_HELPERS_H_ -#define CARTOGRAPHER_TESTING_TEST_HELPERS_H_ - -#include "gmock/gmock.h" -#include "google/protobuf/text_format.h" -#include "google/protobuf/util/message_differencer.h" - -namespace cartographer { -namespace testing { - -template -ProtoType ParseProto(const std::string& proto_string) { - ProtoType proto; - EXPECT_TRUE( - ::google::protobuf::TextFormat::ParseFromString(proto_string, &proto)); - return proto; -} - -MATCHER_P(EqualsProto, expected_proto_string, "") { - using ConstProtoType = typename std::remove_reference::type; - using ProtoType = typename std::remove_cv::type; - - return google::protobuf::util::MessageDifferencer::Equals( - arg, ParseProto(expected_proto_string)); -} - -::testing::Matcher Near(double expected) { - constexpr double kPrecision = 1e-05; - return ::testing::DoubleNear(expected, kPrecision); -} - -} // namespace testing -} // namespace cartographer - -#endif // CARTOGRAPHER_TESTING_TEST_HELPERS_H_