Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef CARTOGRAPHER_IO_TESTING_TEST_HELPERS_H_
00018 #define CARTOGRAPHER_IO_TESTING_TEST_HELPERS_H_
00019
00020 #include <memory>
00021
00022 #include "cartographer/io/internal/in_memory_proto_stream.h"
00023 #include "glog/logging.h"
00024 #include "google/protobuf/text_format.h"
00025
00026 namespace cartographer {
00027 namespace io {
00028 namespace testing {
00029
00030 template <typename T>
00031 T ProtoFromStringOrDie(const std::string &proto_string) {
00032 T msg;
00033 CHECK(google::protobuf::TextFormat::ParseFromString(proto_string, &msg));
00034 return msg;
00035 }
00036
00037 std::unique_ptr<InMemoryProtoStreamReader> ProtoReaderFromStrings(
00038 const std::string &header_textpb,
00039 const std::initializer_list<std::string> &data_textpbs);
00040
00041 }
00042 }
00043 }
00044
00045 #endif // CARTOGRAPHER_IO_TESTING_TEST_HELPERS_H_