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

@ -33,11 +33,9 @@ protected:
void SetUp() override
{
const char *args[] = {testbinary, "-log", "none", "-echo", "screen", "-nocite"};
char **argv = (char **)args;
int argc = sizeof(args) / sizeof(char *);
LAMMPS::argv args = {testbinary, "-log", "none", "-echo", "screen", "-nocite"};
if (!verbose) ::testing::internal::CaptureStdout();
lmp = new LAMMPS(argc, argv, MPI_COMM_WORLD);
lmp = new LAMMPS(args, MPI_COMM_WORLD);
InitSystem();
if (!verbose) ::testing::internal::GetCapturedStdout();
}