Correctly build argv with nullptr at the end

This commit is contained in:
Richard Berger
2023-11-06 23:18:42 -07:00
committed by Richard Berger
parent e655cda066
commit 46768d0ff3
22 changed files with 207 additions and 283 deletions

View File

@ -32,10 +32,11 @@ protected:
{
const char *args[] = {"LAMMPS_test", "-log", "none",
"-echo", "screen", "-nocite",
"-var", "input_dir", STRINGIFY(TEST_INPUT_FOLDER)};
"-var", "input_dir", STRINGIFY(TEST_INPUT_FOLDER),
nullptr};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
int argc = (sizeof(args) / sizeof(char *)) - 1;
::testing::internal::CaptureStdout();
lmp = lammps_open_no_mpi(argc, argv, nullptr);