[Cryptech-Commits] [sw/libhal] 14/58: Doh, skip tests when we know core isn't present.

git at cryptech.is git at cryptech.is
Tue Jul 7 18:24:58 UTC 2015


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch master
in repository sw/libhal.

commit 75688e2f713956fcd1e78cb95cf78bc624552345
Author: Rob Austein <sra at hactrn.net>
Date:   Mon May 25 15:52:50 2015 -0400

    Doh, skip tests when we know core isn't present.
---
 tests/test-aes-key-wrap.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/tests/test-aes-key-wrap.c b/tests/test-aes-key-wrap.c
index 79bace6..b956ba0 100644
--- a/tests/test-aes-key-wrap.c
+++ b/tests/test-aes-key-wrap.c
@@ -136,16 +136,17 @@ int main (int argc, char *argv[])
   int failures = 0;
 
   printf("Testing whether AES core reports present...");
-  if (hal_io_expected(AES_ADDR_NAME0, (const uint8_t *) (AES_CORE_NAME0 AES_CORE_NAME1), 8) == HAL_OK)
-    printf("yes\n");
-  else
-    printf("no\n");
-
-  if (!run_test(K_128, sizeof(K_128), C_128, sizeof(C_128)))
-    failures++;
+  if (hal_io_expected(AES_ADDR_NAME0, (const uint8_t *) (AES_CORE_NAME0 AES_CORE_NAME1), 8) != HAL_OK) {
+    printf("no, skipping keywrap tests\n");
+  }
 
-  if (!run_test(K_256, sizeof(K_256), C_256, sizeof(C_256)))
-    failures++;
+  else {
+    printf("yes\n");
+    if (!run_test(K_128, sizeof(K_128), C_128, sizeof(C_128)))
+      failures++;
+    if (!run_test(K_256, sizeof(K_256), C_256, sizeof(C_256)))
+      failures++;
+  }
 
   return failures;
 }



More information about the Commits mailing list