diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2021-03-31 15:25:18 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2021-03-31 15:29:09 +0200 |
commit | 8613225f314e2524d9178e232940059a8687cc69 (patch) | |
tree | 77ac06e9b9b12f3a5467e5ecf49bcfc0edd86cf7 /test/libapt/authconf_test.cc | |
parent | 0d25ce3d466ecddea02d171981f011f7dbf95e08 (diff) |
Check for and discard expected warning from MaybeAddAuth
MaybeAddAuth() here tells us that it refused to use the credentials
for an http source; but that caused the test suite to fail at a later
stage because we checked if there were any errors/warning. Strangely,
this is only triggered with LTO enabled.
Actually check that the warning is being set and then reject it.
Diffstat (limited to 'test/libapt/authconf_test.cc')
-rw-r--r-- | test/libapt/authconf_test.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/libapt/authconf_test.cc b/test/libapt/authconf_test.cc index f703351cc..3a7b149a9 100644 --- a/test/libapt/authconf_test.cc +++ b/test/libapt/authconf_test.cc @@ -1,5 +1,6 @@ #include <config.h> +#include <apt-pkg/error.h> #include <apt-pkg/fileutl.h> #include <apt-pkg/netrc.h> #include <apt-pkg/strutl.h> @@ -235,11 +236,15 @@ machine http://http.example login foo1 password bar EXPECT_EQ("foo1", U.User); EXPECT_EQ("bar", U.Password); + _error->PushToStack(); EXPECT_TRUE(fd.Seek(0)); U = URI("http://https.example/foo"); EXPECT_TRUE(MaybeAddAuth(fd, U)); EXPECT_TRUE(U.User.empty()); EXPECT_TRUE(U.Password.empty()); + EXPECT_FALSE(_error->empty()); + EXPECT_TRUE(U.Password.empty()); + _error->RevertToStack(); EXPECT_TRUE(fd.Seek(0)); U = URI("http://http.example/foo"); |