From e71df20a423a3463c782223e46e7487f3bc2cbb2 Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Tue, 6 Oct 2015 13:03:33 +0700 Subject: [PATCH] Tests: re-enable decryption tests with invalid passwords --- test/taoensso/nippy/tests/main.clj | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/taoensso/nippy/tests/main.clj b/test/taoensso/nippy/tests/main.clj index 964c99e..e7cd462 100644 --- a/test/taoensso/nippy/tests/main.clj +++ b/test/taoensso/nippy/tests/main.clj @@ -41,11 +41,14 @@ (check-props/for-all [val check-gen/any] (= val (thaw (freeze val))))))) -;;; Trying to decrypt random (invalid) data can actually crash JVM -;; (expect Exception (thaw (freeze test-data {:password "malformed"}))) -;; (expect Exception (thaw (freeze test-data {:password [:salted "p"]}))) -;; (expect Exception (thaw (freeze test-data {:password [:salted "p"]}) -;; {:compressor nil})) +(expect Exception (thaw (freeze test-data {:password "malformed"}))) +(expect Exception (thaw (freeze test-data {:password [:salted "p"]}) + {;; Necessary to prevent against JVM segfault due to + ;; https://goo.gl/t0OUIo: + :v1-compatibility? false})) +(expect Exception (thaw (freeze test-data {:password [:salted "p"]}) + {:v1-compatibility? false ; Ref. https://goo.gl/t0OUIo + :compressor nil})) (expect ; Snappy lib compatibility (for legacy versions of Nippy) (let [^bytes raw-ba (freeze test-data {:compressor nil})