From 8e5c2951be486db1432693205c58a55de70abb88 Mon Sep 17 00:00:00 2001 From: Emman Date: Wed, 26 Jan 2022 10:33:02 +0800 Subject: [PATCH] reduce test times for short mode --- sm4/cipher_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sm4/cipher_test.go b/sm4/cipher_test.go index 2ddeb64..10e6097 100644 --- a/sm4/cipher_test.go +++ b/sm4/cipher_test.go @@ -47,8 +47,12 @@ func Test_sample2(t *testing.T) { } dst := make([]byte, 16) copy(dst, src) - - for i := 0; i < 1000000; i++ { + n := 1000000 + if testing.Short() { + n = 1000 + expected = []byte{215, 53, 233, 28, 197, 104, 156, 243, 18, 188, 193, 239, 183, 64, 232, 19} + } + for i := 0; i < n; i++ { c.Encrypt(dst, dst) } if !reflect.DeepEqual(dst, expected) {