summaryrefslogtreecommitdiff
path: root/test/libapt/authconf_test.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2020-05-18 11:55:54 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2020-05-18 15:55:36 +0200
commitc470d92366d7c3c239a689f0a10d6d0d9daafbff (patch)
tree955534f65524c3f81f36119012b6cd995a9619d0 /test/libapt/authconf_test.cc
parent37cc8dcda9e97e0b9420d37bb886081fa629847d (diff)
Allow prefix to be a complete filename for GetTempFile
Our testcases had their own implementation of GetTempFile with the feature of a temporary file with a choosen suffix. Merging this into GetTempFile lets us drop this duplicate and hence test more our code rather than testing our helpers for test implementation. And then hashsums_test had another implementationā€¦ and extracttar wasn't even trying to use a real tempfileā€¦ one GetTempFile to rule them all! That also ensures that these tempfiles are created in a temporary directory rather than the current directory which is a nice touch and tries a little harder to clean up those tempfiles.
Diffstat (limited to 'test/libapt/authconf_test.cc')
-rw-r--r--test/libapt/authconf_test.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/libapt/authconf_test.cc b/test/libapt/authconf_test.cc
index 04d54e9be..f703351cc 100644
--- a/test/libapt/authconf_test.cc
+++ b/test/libapt/authconf_test.cc
@@ -20,7 +20,7 @@ TEST(NetRCTest, Parsing)
EXPECT_EQ("file.not", U.Host);
EXPECT_EQ("/open", U.Path);
- createTemporaryFile("doublesignedfile", fd, nullptr, R"apt(
+ openTemporaryFile("doublesignedfile", fd, R"apt(
machine example.netter login bar password foo
machine example.net login foo password bar
@@ -138,7 +138,7 @@ machine socks5h://example.last/debian login debian password rules)apt");
TEST(NetRCTest, BadFileNoMachine)
{
FileFd fd;
- createTemporaryFile("doublesignedfile", fd, nullptr, R"apt(
+ openTemporaryFile("doublesignedfile", fd, R"apt(
foo example.org login foo1 password bar
machin example.org login foo2 password bar
machine2 example.org login foo3 password bar
@@ -152,7 +152,7 @@ machine2 example.org login foo3 password bar
TEST(NetRCTest, BadFileEndsMachine)
{
FileFd fd;
- createTemporaryFile("doublesignedfile", fd, nullptr, R"apt(
+ openTemporaryFile("doublesignedfile", fd, R"apt(
machine example.org login foo1 password bar
machine)apt");
@@ -176,7 +176,7 @@ machine)apt");
TEST(NetRCTest, BadFileEndsLogin)
{
FileFd fd;
- createTemporaryFile("doublesignedfile", fd, nullptr, R"apt(
+ openTemporaryFile("doublesignedfile", fd, R"apt(
machine example.org login foo1 password bar
machine example.net login)apt");
@@ -200,7 +200,7 @@ machine example.net login)apt");
TEST(NetRCTest, BadFileEndsPassword)
{
FileFd fd;
- createTemporaryFile("doublesignedfile", fd, nullptr, R"apt(
+ openTemporaryFile("doublesignedfile", fd, R"apt(
machine example.org login foo1 password bar
machine example.net password)apt");
@@ -225,7 +225,7 @@ machine example.net password)apt");
TEST(NetRCTest, MatchesOnlyHTTPS)
{
FileFd fd;
- createTemporaryFile("doublesignedfile", fd, nullptr, R"apt(
+ openTemporaryFile("doublesignedfile", fd, R"apt(
machine https.example login foo1 password bar
machine http://http.example login foo1 password bar
)apt");