Skip to content

Commit

Permalink
Fixed windows build (testing.cpp)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanming-hu committed Mar 7, 2019
1 parent 1d5b211 commit 86bbf2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/testing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ TC_NAMESPACE_BEGIN

int run_tests(std::vector<std::string> argv) {
char arg[] = "test";
char *argv_[1 + argv.size()];
std::vector<char *> argv_(1 + argv.size(), nullptr);
argv_[0] = arg;
for (int i = 0; i < (int)argv.size(); i++) {
argv_[i + 1] = const_cast<char *>(argv[i].c_str());
}
Catch::Session session;
int returnCode = session.applyCommandLine(1 + argv.size(), argv_);
int returnCode = session.applyCommandLine(1 + argv.size(), argv_.data());
if (returnCode != 0)
return returnCode;
return session.run();
Expand Down

0 comments on commit 86bbf2f

Please sign in to comment.