66#include < gmock/gmock.h>
77#include < gtest/gtest.h>
88#include < string>
9- #include < utility >
9+ #include < type_traits >
1010
1111namespace cucumber_cpp ::library
1212{
@@ -32,39 +32,39 @@ namespace cucumber_cpp::library
3232
3333 const std::array args{ " application" };
3434
35- RunWithArgs (args, std::to_underlying (CLI::ExitCodes::RequiredError));
35+ RunWithArgs (args, static_cast < std::underlying_type_t <CLI::ExitCodes>> (CLI::ExitCodes::RequiredError));
3636 }
3737
3838 TEST_F (TestApplication, RunCommandWithoutArguments)
3939 {
4040
4141 const std::array args{ " application" , " run" };
4242
43- RunWithArgs (args, std::to_underlying (CLI::ExitCodes::RequiredError));
43+ RunWithArgs (args, static_cast < std::underlying_type_t <CLI::ExitCodes>> (CLI::ExitCodes::RequiredError));
4444 }
4545
4646 TEST_F (TestApplication, RunCommand)
4747 {
4848
4949 const std::array args{ " application" , " run" , " --feature" , " ./" , " --report" , " console" };
5050
51- RunWithArgs (args, std::to_underlying (CLI::ExitCodes::Success));
51+ RunWithArgs (args, static_cast < std::underlying_type_t <CLI::ExitCodes>> (CLI::ExitCodes::Success));
5252 }
5353
5454 TEST_F (TestApplication, DryRunCommand)
5555 {
5656
5757 const std::array args{ " application" , " run" , " --feature" , " ./" , " --report" , " console" , " --dry" };
5858
59- RunWithArgs (args, std::to_underlying (CLI::ExitCodes::Success));
59+ RunWithArgs (args, static_cast < std::underlying_type_t <CLI::ExitCodes>> (CLI::ExitCodes::Success));
6060 }
6161
6262 TEST_F (TestApplication, InvalidArgument)
6363 {
6464
6565 const std::array args{ " application" , " run" , " --feature" , " ./" , " --report" , " console" , " --doesntexist" };
6666
67- RunWithArgs (args, std::to_underlying (CLI::ExitCodes::ExtrasError));
67+ RunWithArgs (args, static_cast < std::underlying_type_t <CLI::ExitCodes>> (CLI::ExitCodes::ExtrasError));
6868 }
6969
7070 TEST_F (TestApplication, DryRunFeatureFile)
@@ -79,7 +79,7 @@ namespace cucumber_cpp::library
7979
8080 const std::array args{ " application" , " run" , " --feature" , path.c_str (), " --report" , " console" , " --dry" };
8181
82- std::string stdoutString = RunWithArgs (args, std::to_underlying (CLI::ExitCodes::Success));
82+ std::string stdoutString = RunWithArgs (args, static_cast < std::underlying_type_t <CLI::ExitCodes>> (CLI::ExitCodes::Success));
8383
8484 EXPECT_THAT (stdoutString, testing::HasSubstr (" 1/1 passed" ));
8585 }
@@ -96,7 +96,7 @@ namespace cucumber_cpp::library
9696
9797 const std::array args{ " application" , " run" , " --feature" , path.c_str (), " --report" , " console" };
9898
99- std::string stdoutString = RunWithArgs (args, std::to_underlying (CLI::ExitCodes::Success));
99+ std::string stdoutString = RunWithArgs (args, static_cast < std::underlying_type_t <CLI::ExitCodes>> (CLI::ExitCodes::Success));
100100
101101 EXPECT_THAT (stdoutString, testing::HasSubstr (" 1/1 passed" ));
102102 }
0 commit comments