make certain temporary test files are deleted

This commit is contained in:
Axel Kohlmeyer
2024-01-16 17:54:08 -05:00
parent f5cbef8b12
commit f23ba8fbad

View File

@ -147,7 +147,7 @@ protected:
fclose(fp); fclose(fp);
command(fmt::format("molecule {} {} {}", name, file, args)); command(fmt::format("molecule {} {} {}", name, file, args));
remove(file.c_str()); platform::unlink(file.c_str());
} }
}; };
@ -186,7 +186,7 @@ TEST_F(MoleculeFileTest, badargs)
TEST_FAILURE( TEST_FAILURE(
".*Illegal molecule command.*", ".*Illegal molecule command.*",
run_mol_cmd(test_name, "scale", "Comment\n1 atoms\n\n Coords\n\n 1 0.0 0.0 0.0\n");); run_mol_cmd(test_name, "scale", "Comment\n1 atoms\n\n Coords\n\n 1 0.0 0.0 0.0\n"););
remove("badargs.mol"); platform::unlink("moltest_badargs.mol");
} }
TEST_F(MoleculeFileTest, noatom) TEST_F(MoleculeFileTest, noatom)
@ -195,14 +195,14 @@ TEST_F(MoleculeFileTest, noatom)
run_mol_cmd(test_name, "", run_mol_cmd(test_name, "",
"Comment\n0 atoms\n1 bonds\n\n" "Comment\n0 atoms\n1 bonds\n\n"
" Coords\n\nBonds\n\n 1 1 2\n");); " Coords\n\nBonds\n\n 1 1 2\n"););
remove("noatom.mol"); platform::unlink("moltest_noatom.mol");
} }
TEST_F(MoleculeFileTest, empty) TEST_F(MoleculeFileTest, empty)
{ {
TEST_FAILURE(".*ERROR: Unexpected end of molecule file.*", TEST_FAILURE(".*ERROR: Unexpected end of molecule file.*",
run_mol_cmd(test_name, "", "Comment\n\n");); run_mol_cmd(test_name, "", "Comment\n\n"););
remove("empty.mol"); platform::unlink("moltest_empty.mol");
} }
TEST_F(MoleculeFileTest, nospecial) TEST_F(MoleculeFileTest, nospecial)
@ -212,7 +212,7 @@ TEST_F(MoleculeFileTest, nospecial)
"Comment\n3 atoms\n\n2 bonds\n\n" "Comment\n3 atoms\n\n2 bonds\n\n"
" Coords\n\n 1 1.0 1.0 1.0\n 2 1.0 1.0 0.0\n 3 1.0 0.0 1.0\n" " Coords\n\n 1 1.0 1.0 1.0\n 2 1.0 1.0 0.0\n 3 1.0 0.0 1.0\n"
" Bonds\n\n 1 1 1 2\n 2 1 1 3\n");); " Bonds\n\n 1 1 1 2\n 2 1 1 3\n"););
remove("nospecial.mol"); platform::unlink("moltest_nospecial.mol");
} }
TEST_F(MoleculeFileTest, minimal) TEST_F(MoleculeFileTest, minimal)