test_helpers.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2018 The Cartographer Authors
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef CARTOGRAPHER_CLOUD_INTERNAL_TESTING_TEST_HELPERS_H
00018 #define CARTOGRAPHER_CLOUD_INTERNAL_TESTING_TEST_HELPERS_H
00019 
00020 #include "cartographer/cloud/proto/map_builder_service.pb.h"
00021 #include "cartographer/sensor/internal/dispatchable.h"
00022 #include "google/protobuf/util/message_differencer.h"
00023 
00024 namespace cartographer {
00025 namespace cloud {
00026 namespace testing {
00027 
00028 using DataPredicateType = std::function<bool(const sensor::Data &)>;
00029 using ProtoPredicateType =
00030     std::function<bool(const google::protobuf::Message &)>;
00031 
00032 template <typename T>
00033 DataPredicateType BuildDataPredicateEquals(const T &proto);
00034 
00035 template <>
00036 DataPredicateType BuildDataPredicateEquals<proto::AddImuDataRequest>(
00037     const proto::AddImuDataRequest &proto);
00038 template <>
00039 DataPredicateType BuildDataPredicateEquals<proto::AddFixedFramePoseDataRequest>(
00040     const proto::AddFixedFramePoseDataRequest &proto);
00041 template <>
00042 DataPredicateType BuildDataPredicateEquals<proto::AddOdometryDataRequest>(
00043     const proto::AddOdometryDataRequest &proto);
00044 template <>
00045 DataPredicateType BuildDataPredicateEquals<proto::AddLandmarkDataRequest>(
00046     const proto::AddLandmarkDataRequest &proto);
00047 template <>
00048 DataPredicateType BuildDataPredicateEquals<proto::AddRangefinderDataRequest>(
00049     const proto::AddRangefinderDataRequest &proto);
00050 
00051 ProtoPredicateType BuildProtoPredicateEquals(
00052     const google::protobuf::Message *proto);
00053 
00054 }  // namespace testing
00055 }  // namespace cloud
00056 }  // namespace cartographer
00057 
00058 #endif  // CARTOGRAPHER_CLOUD_INTERNAL_TESTING_TEST_HELPERS_H


cartographer
Author(s): The Cartographer Authors
autogenerated on Thu May 9 2019 02:27:36