From 8613225f314e2524d9178e232940059a8687cc69 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 31 Mar 2021 15:25:18 +0200 Subject: 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. --- test/libapt/authconf_test.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/libapt/authconf_test.cc') 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 +#include #include #include #include @@ -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"); -- cgit v1.2.3-70-g09d2