This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=f579b8ca61d18c72ccbd26b67885b10de3bb2b93

commit f579b8ca61d18c72ccbd26b67885b10de3bb2b93
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Jul 8 04:57:46 2020 +0200

    test: Only print Dpkg::Path::check_directory_traversal() error on failure
    
    Using diag() unconditionally clutters the output, when we should only
    use it when the unit test fails. Switch that into a note(), and add a
    diag() for the passing case.
---
 debian/changelog      | 2 ++
 scripts/t/Dpkg_Path.t | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7abb0513e..17e149518 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ dpkg (1.20.5) UNRELEASED; urgency=medium
     apparently fixed the issue at hand because gcc started parsing it as
     the «[SUFFIX]:» case, completely disabling the PIE handling.
     Thanks to Thorsten Glaser <[email protected]>.
+  * Test suite:
+    - Only print the Dpkg::Path::check_directory_traversal() error on failure.
 
   [ Updated scripts translations ]
   * German (Helge Kreutzmann).
diff --git a/scripts/t/Dpkg_Path.t b/scripts/t/Dpkg_Path.t
index 667afff21..b626a8de2 100644
--- a/scripts/t/Dpkg_Path.t
+++ b/scripts/t/Dpkg_Path.t
@@ -217,12 +217,13 @@ foreach my $travtype (sort keys %travtype) {
         1;
     } or do {
         $catch = $@;
-        diag("error from check_directory_traversal => $catch");
     };
     if ($travtype{$travtype}->{fail}) {
-        ok($catch, "directory traversal type $travtype detected: $catch");
+        ok($catch, "directory traversal type $travtype detected");
+        note("traversal reason: $catch") if $catch;
     } else {
         ok(! $catch, "no directory traversal type $travtype");
+        diag("error from check_directory_traversal => $catch") if $catch;
     }
 }
 

-- 
Dpkg.Org's dpkg

Reply via email to