Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Sep 18, 2023
1 parent 126814b commit c51548a
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions common/global_parameter_loader/test/test_global_params_launch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,31 @@
// limitations under the License.

#include <gtest/gtest.h>

#include <cstdlib>
#include <iostream>
#include <string>

TEST(TestLaunchFile, test_launch_file)
{
// Define the path of Python launch file
std::string global_params_launch_path = "global_params.launch.py";
// Define the parameters you want to pass to the launch file
std::string use_sim_time_param = "false";
std::string vehicle_model_param = "sample_vehicle";
// Construct the command to run the Python launch script with parameters
std::string command = "ros2 launch global_parameter_loader " + global_params_launch_path +
" use_sim_time:=" + use_sim_time_param +
" vehicle_model:=" + vehicle_model_param;
// Define the path of Python launch file
std::string global_params_launch_path = "global_params.launch.py";
// Define the parameters you want to pass to the launch file
std::string use_sim_time_param = "false";
std::string vehicle_model_param = "sample_vehicle";
// Construct the command to run the Python launch script with parameters
std::string command = "ros2 launch global_parameter_loader " + global_params_launch_path +
" use_sim_time:=" + use_sim_time_param +
" vehicle_model:=" + vehicle_model_param;

// Use the system() function to execute the command
int result = std::system(command.c_str());
// Check the result of running the launch file
EXPECT_EQ(result, 0);
// Use the system() function to execute the command
int result = std::system(command.c_str());
// Check the result of running the launch file
EXPECT_EQ(result, 0);
}

int main(int argc, char * argv[])
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

0 comments on commit c51548a

Please sign in to comment.