From 331303fe03d99002934ae575fa6026490078d2e6 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Fri, 29 Sep 2017 10:19:56 +0100 Subject: [PATCH] [functional-tests] Add thin_repair test for accidental XML input. Was segfaulting. --- functional-tests/thin-functional-tests.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/functional-tests/thin-functional-tests.scm b/functional-tests/thin-functional-tests.scm index b4b1f49..aa0e2d7 100644 --- a/functional-tests/thin-functional-tests.scm +++ b/functional-tests/thin-functional-tests.scm @@ -20,6 +20,7 @@ (define-tool thin-dump) (define-tool thin-restore) (define-tool thin-rmap) + (define-tool thin-repair) (define-syntax with-thin-xml (syntax-rules () @@ -303,4 +304,13 @@ (receive (_ stderr) (run-fail "thin_delta --snap1 45 --snap2 46") (assert-starts-with "No input device provided." stderr))) + ;;;----------------------------------------------------------- + ;;; thin_repair scenarios + ;;;----------------------------------------------------------- + (define-scenario (thin-repair dont-repair-xml) + "Fails gracefully if run on XML rather than metadata" + (with-thin-xml (xml) + (with-empty-metadata (md) + (receive (_ stderr) (run-fail "thin_repair -i " xml "-o" md) + #t)))) )