From b162b690ba4b1edb528dbf017d83e47c0d6d8d3e Mon Sep 17 00:00:00 2001
From: Guillaume Endignoux <guillaumee@google.com>
Date: Thu, 6 Feb 2020 13:41:18 +0100
Subject: [PATCH] Decrease the number of tests in debug mode, to account for
 slower CI on Travis.

---
 libraries/crypto/src/ec/point.rs | 2 ++
 libraries/crypto/src/ecdh.rs     | 2 +-
 libraries/crypto/src/ecdsa.rs    | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libraries/crypto/src/ec/point.rs b/libraries/crypto/src/ec/point.rs
index d9a6a76..99b32ed 100644
--- a/libraries/crypto/src/ec/point.rs
+++ b/libraries/crypto/src/ec/point.rs
@@ -912,6 +912,8 @@ pub mod test {
         }
     }
 
+    // Due to the 3 nested loops, this test is super slow with debug assertions enabled.
+    #[cfg(not(debug_assertions))]
     #[test]
     fn test_add_is_associative() {
         for x in &get_test_values_projective() {
diff --git a/libraries/crypto/src/ecdh.rs b/libraries/crypto/src/ecdh.rs
index 7a4b250..c735d11 100644
--- a/libraries/crypto/src/ecdh.rs
+++ b/libraries/crypto/src/ecdh.rs
@@ -103,7 +103,7 @@ mod test {
     #[cfg(not(debug_assertions))]
     const ITERATIONS: u32 = 10000;
     #[cfg(debug_assertions)]
-    const ITERATIONS: u32 = 1000;
+    const ITERATIONS: u32 = 500;
 
     /** Test that key generation creates valid keys **/
     #[test]
diff --git a/libraries/crypto/src/ecdsa.rs b/libraries/crypto/src/ecdsa.rs
index 2d39311..9fe0580 100644
--- a/libraries/crypto/src/ecdsa.rs
+++ b/libraries/crypto/src/ecdsa.rs
@@ -357,7 +357,7 @@ mod test {
     #[cfg(not(debug_assertions))]
     const ITERATIONS: u32 = 10000;
     #[cfg(debug_assertions)]
-    const ITERATIONS: u32 = 1000;
+    const ITERATIONS: u32 = 500;
 
     /** Test that key generation creates valid keys **/
     #[test]
-- 
GitLab