X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Fcommandline%2Ftests%2Fpargs.cpp;h=a7f4362732f3bf758af4569d8e6a4f4e93cc865f;hb=df876d6c7b594ded534d9b888e84141a054da11d;hp=c11259b77d3e2c4fec3f3c8ded75dec6b8836fd6;hpb=e4bc541ba5c3224f242c9d251d19c01c9e6c3037;p=alexxy%2Fgromacs.git diff --git a/src/gromacs/commandline/tests/pargs.cpp b/src/gromacs/commandline/tests/pargs.cpp index c11259b77d..a7f4362732 100644 --- a/src/gromacs/commandline/tests/pargs.cpp +++ b/src/gromacs/commandline/tests/pargs.cpp @@ -378,6 +378,23 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgsWithDefaultFileName) done_filenms(nfile(), fnm); } +TEST_F(ParseCommonArgsTest, ParseFileArgsWithCustomDefaultExtension) +{ + t_filenm fnm[] = { + { efTRX, "-o1", "conf1.gro", ffWRITE }, + { efTRX, "-o2", "conf2.pdb", ffWRITE }, + { efTRX, "-o3", "conf3.gro", ffWRITE } + }; + const char *const cmdline[] = { + "test", "-o2", "-o3", "test" + }; + parseFromArray(cmdline, PCA_CAN_SET_DEFFNM, fnm, gmx::EmptyArrayRef()); + EXPECT_STREQ("conf1.gro", opt2fn("-o1", nfile(), fnm)); + EXPECT_STREQ("conf2.pdb", opt2fn("-o2", nfile(), fnm)); + EXPECT_STREQ("test.gro", opt2fn("-o3", nfile(), fnm)); + done_filenms(nfile(), fnm); +} + /******************************************************************** * Tests for file name options (input files, dependent on file system contents) */