From fac4831a091eda447780d5d1e1e572b14ebb0338 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 3 Sep 2016 20:13:35 +1000 Subject: Fix memory leak in remove_notify_needed_optdepends Also add pactest which captures this leak when run under valgrind. Reported-by: Sergey Petrenko Signed-off-by: Allan McRae --- test/pacman/tests/TESTS | 1 + .../pacman/tests/remove-optdepend-of-installed-package.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/pacman/tests/remove-optdepend-of-installed-package.py (limited to 'test') diff --git a/test/pacman/tests/TESTS b/test/pacman/tests/TESTS index bd5a0b64..2d877962 100644 --- a/test/pacman/tests/TESTS +++ b/test/pacman/tests/TESTS @@ -109,6 +109,7 @@ TESTS += test/pacman/tests/querycheck002.py TESTS += test/pacman/tests/querycheck_fast_file_type.py TESTS += test/pacman/tests/reason001.py TESTS += test/pacman/tests/remove-assumeinstalled.py +TESTS += test/pacman/tests/remove-optdepend-of-installed-package.py TESTS += test/pacman/tests/remove-recursive-cycle.py TESTS += test/pacman/tests/remove001.py TESTS += test/pacman/tests/remove002.py diff --git a/test/pacman/tests/remove-optdepend-of-installed-package.py b/test/pacman/tests/remove-optdepend-of-installed-package.py new file mode 100644 index 00000000..4973df5f --- /dev/null +++ b/test/pacman/tests/remove-optdepend-of-installed-package.py @@ -0,0 +1,15 @@ +self.description = "Remove packages which is an optdepend of another package" + +p1 = pmpkg("dep") +self.addpkg2db("local", p1) + +p2 = pmpkg("pkg") +p2.optdepends = ["dep: for foobar"] +self.addpkg2db("local", p2) + +self.args = "-R %s" % p1.name + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!PKG_EXIST=%s" % p1.name) +self.addrule("PKG_EXIST=%s" % p2.name) +self.addrule("PACMAN_OUTPUT=%s optionally requires %s" % (p2.name, p1.name)) -- cgit v1.2.3-70-g09d2