configuration_files_test.cc
Go to the documentation of this file.
1 /*
2  * Copyright 2016 The Cartographer Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <string>
18 #include <vector>
19 
23 #include "gtest/gtest.h"
24 #include "ros/package.h"
25 
26 namespace cartographer_ros {
27 namespace {
28 
29 class ConfigurationFilesTest : public ::testing::TestWithParam<const char*> {};
30 
31 TEST_P(ConfigurationFilesTest, ValidateNodeOptions) {
32  EXPECT_NO_FATAL_FAILURE({
33  auto file_resolver = ::cartographer::common::make_unique<
35  ::ros::package::getPath("cartographer_ros") + "/configuration_files"});
36  const string code = file_resolver->GetFileContentOrDie(GetParam());
37  ::cartographer::common::LuaParameterDictionary lua_parameter_dictionary(
38  code, std::move(file_resolver));
39  ::cartographer_ros::CreateNodeOptions(&lua_parameter_dictionary);
40  ::cartographer_ros::CreateTrajectoryOptions(&lua_parameter_dictionary);
41  });
42 }
43 
44 INSTANTIATE_TEST_CASE_P(ValidateAllNodeOptions, ConfigurationFilesTest,
45  ::testing::Values("backpack_2d.lua", "backpack_3d.lua",
46  "pr2.lua", "revo_lds.lua",
47  "taurob_tracker.lua"));
48 
49 } // namespace
50 } // namespace cartographer_ros
NodeOptions CreateNodeOptions(::cartographer::common::LuaParameterDictionary *const lua_parameter_dictionary)
Definition: node_options.cc:23
std::string GetFileContentOrDie(const std::string &basename) override
TrajectoryOptions CreateTrajectoryOptions(::cartographer::common::LuaParameterDictionary *const lua_parameter_dictionary)


cartographer_ros
Author(s):
autogenerated on Mon Jun 10 2019 12:59:40