summaryrefslogtreecommitdiff
path: root/test/libapt/configuration_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/libapt/configuration_test.cc')
-rw-r--r--test/libapt/configuration_test.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/libapt/configuration_test.cc b/test/libapt/configuration_test.cc
index 8d6c404b3..4d297a9f2 100644
--- a/test/libapt/configuration_test.cc
+++ b/test/libapt/configuration_test.cc
@@ -198,9 +198,8 @@ TEST(ConfigurationTest,Merge)
TEST(ConfigurationTest, Parsing)
{
Configuration Cnf;
- std::string tempfile;
- FileFd fd;
- createTemporaryFile("doublesignedfile", fd, &tempfile, R"apt(
+ {
+ auto const file = createTemporaryFile("doublesignedfile", R"apt(
SimpleOption "true";
/* SimpleOption "false"; */
Answer::Simple "42";
@@ -213,9 +212,8 @@ List::Option2 { "Multi";
}; Trailing "true";
/* Commented::Out "true"; */
)apt");
- EXPECT_TRUE(ReadConfigFile(Cnf, tempfile));
- if (tempfile.empty() == false)
- unlink(tempfile.c_str());
+ EXPECT_TRUE(ReadConfigFile(Cnf, file.Name()));
+ }
EXPECT_TRUE(Cnf.FindB("SimpleOption"));
EXPECT_EQ(42, Cnf.FindI("Answer::Simple"));
EXPECT_TRUE(Cnf.Exists("List::Option"));