summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/conf_clear.cc23
-rw-r--r--test/makefile6
2 files changed, 29 insertions, 0 deletions
diff --git a/test/conf_clear.cc b/test/conf_clear.cc
new file mode 100644
index 000000000..259aa0f39
--- /dev/null
+++ b/test/conf_clear.cc
@@ -0,0 +1,23 @@
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
+
+using namespace std;
+
+int main(int argc,const char *argv[])
+{
+ Configuration Cnf;
+
+ cout << "adding elements" << endl;
+ Cnf.Set("APT::Keep-Fds::",28);
+ Cnf.Set("APT::Keep-Fds::",17);
+ Cnf.Set("APT::Keep-Fds::",47);
+ Cnf.Dump();
+
+ cout << "Removing elements" << endl;
+ Cnf.Clear("APT::Keep-Fds",17);
+ Cnf.Clear("APT::Keep-Fds",28);
+ Cnf.Clear("APT::Keep-Fds",47);
+ Cnf.Dump();
+
+ return 0;
+}
diff --git a/test/makefile b/test/makefile
index 9ad6233c2..a9dbdc34d 100644
--- a/test/makefile
+++ b/test/makefile
@@ -39,6 +39,12 @@ SOURCE = testextract.cc
include $(PROGRAM_H)
# Program for testing the config file parser
+PROGRAM=conftest_clear
+SLIBS = -lapt-pkg
+SOURCE = conf_clear.cc
+include $(PROGRAM_H)
+
+# Program for testing the config file parser
PROGRAM=conftest
SLIBS = -lapt-pkg
SOURCE = conf.cc