summaryrefslogtreecommitdiff
path: root/test/libapt/getlistoffilesindir_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/libapt/getlistoffilesindir_test.cc')
-rw-r--r--test/libapt/getlistoffilesindir_test.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/libapt/getlistoffilesindir_test.cc b/test/libapt/getlistoffilesindir_test.cc
index 2369c911a..8c5e56b1d 100644
--- a/test/libapt/getlistoffilesindir_test.cc
+++ b/test/libapt/getlistoffilesindir_test.cc
@@ -1,6 +1,7 @@
#include <config.h>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/error.h>
#include <string>
#include <vector>
@@ -49,6 +50,7 @@ TEST(FileUtlTest,GetListOfFilesInDir)
createLink(tempdir, "non-existing-file", "brokenlink.list");
// Files with no extension
+ _error->PushToStack();
std::vector<std::string> files = GetListOfFilesInDir(tempdir, "", true);
ASSERT_EQ(2, files.size());
EXPECT_EQ(P("01yet-anothernormalfile"), files[0]);
@@ -103,5 +105,10 @@ TEST(FileUtlTest,GetListOfFilesInDir)
EXPECT_EQ(P("disabledfile.disabled"), files[3]);
EXPECT_EQ(P("disabledfile.list.disabled"), files[4]);
+ // discard the unknown file extension messages
+ if (_error->PendingError())
+ _error->MergeWithStack();
+ else
+ _error->RevertToStack();
removeDirectory(tempdir);
}