guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/01: Fix crypt-on-glibc test error


From: Andy Wingo
Subject: [Guile-commits] 01/01: Fix crypt-on-glibc test error
Date: Fri, 1 Feb 2019 12:01:05 -0500 (EST)

wingo pushed a commit to branch master
in repository guile.

commit 667e511dc39c1a2151e6308f2cab7ffd184e4cda
Author: Andy Wingo <address@hidden>
Date:   Fri Feb 1 17:18:50 2019 +0100

    Fix crypt-on-glibc test error
    
    * test-suite/tests/posix.test ("crypt"): Allow for the given salt being
      valid.  Thanks to Jonathan Brielmaier for the report and debugging!
---
 test-suite/tests/posix.test | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test
index 4dadd77..1765206 100644
--- a/test-suite/tests/posix.test
+++ b/test-suite/tests/posix.test
@@ -1,7 +1,7 @@
 ;;;; posix.test --- Test suite for Guile POSIX functions. -*- scheme -*-
 ;;;;
 ;;;; Copyright 2003, 2004, 2006, 2007, 2010, 2012,
-;;;;   2015, 2017 Free Software Foundation, Inc.
+;;;;   2015, 2017, 2019 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -232,10 +232,17 @@
   (pass-if "basic usage"
     (string? (crypt "pass" "abcdefg")))
 
-  (pass-if-exception "glibc EINVAL" exception:system-error
-    ;; This used to deadlock while trying to throw to 'system-error'.
-    ;; This test uses the special interpretation of the salt that glibc
-    ;; does; specifically, we pass a syntactically invalid salt here.
-    (if (string-contains %host-type "-gnu")
-        (crypt "pass" "$X$abc")                   ;EINVAL
-        (throw 'unresolved))))
+  (pass-if "crypt invalid salt on glibc"
+    (begin
+      (unless (string-contains %host-type "-gnu")
+        (throw 'unresolved))
+      (catch 'system-error
+             (lambda ()
+               ;; This used to deadlock on glibc while trying to throw to
+               ;; 'system-error'.  This test uses the special
+               ;; interpretation of the salt that glibc does;
+               ;; specifically, we pass a salt that's probably
+               ;; syntactically invalid here.  Note, whether it's invalid
+               ;; or not is system-defined, so it's possible it just works.
+               (string? (crypt "pass" "$X$abc")))
+             (lambda _ #t)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]