summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJustus Winter <justus@g10code.com>2017-02-17 10:43:20 +0100
committerJustus Winter <justus@g10code.com>2017-02-17 10:43:20 +0100
commitaab6ba0bb60528b9e816e430be51170cf39611b0 (patch)
tree9cbb3b6fab94559dcae1a18be7d54b65bdce7ace /tests
parentscd: Fix RESET command handling (more). (diff)
downloadgnupg2-aab6ba0bb60528b9e816e430be51170cf39611b0.tar.xz
gnupg2-aab6ba0bb60528b9e816e430be51170cf39611b0.zip
gpgscm: Guard use of tagged expressions.
* tests/gpgscm/init.scm (vm-history-print): Check that the tag added to expressions when parsing source files matches the expected format. * tests/gpgscm/lib.scm (assert): Likewise. -- This makes the error handling more robust. We saw the assumption about the format of the tags being violated on one build system, and it obscured the view on the underlying problem. Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/gpgscm/init.scm10
-rw-r--r--tests/gpgscm/lib.scm2
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/gpgscm/init.scm b/tests/gpgscm/init.scm
index 83261b001..87d3c8870 100644
--- a/tests/gpgscm/init.scm
+++ b/tests/gpgscm/init.scm
@@ -547,11 +547,11 @@
(display n)
(display ": ")
(let ((tag (get-tag f)))
- (unless (null? tag)
- (display (basename (car tag)))
- (display ":")
- (display (+ 1 (cdr tag)))
- (display ": ")))
+ (when (and (pair? tag) (string? (car tag)) (number? (cdr tag)))
+ (display (basename (car tag)))
+ (display ":")
+ (display (+ 1 (cdr tag)))
+ (display ": ")))
(write f))
(newline)
(loop (+ n 1) skip (cdr frames))))))
diff --git a/tests/gpgscm/lib.scm b/tests/gpgscm/lib.scm
index 6959aa4d0..2cfe725e9 100644
--- a/tests/gpgscm/lib.scm
+++ b/tests/gpgscm/lib.scm
@@ -20,7 +20,7 @@
(macro (assert form)
(let ((tag (get-tag form)))
`(if (not ,(cadr form))
- (throw ,(if (pair? tag)
+ (throw ,(if (and (pair? tag) (string? (car tag)) (number? (cdr tag)))
`(string-append ,(car tag) ":"
,(number->string (+ 1 (cdr tag)))
": Assertion failed: ")