From 4d0cfe80eaea7ca4e21de7a584b0004ab489bb1f Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Thu, 10 Jul 2014 14:37:36 +0200
Subject: [PATCH] Split assert() with side effects in test suite helper
---
tests/suites/helpers.function | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/suites/helpers.function b/tests/suites/helpers.function
index d656519a14..b006429463 100644
--- a/tests/suites/helpers.function
+++ b/tests/suites/helpers.function
@@ -113,7 +113,8 @@ static unsigned char *zero_alloc( size_t len )
void *p;
size_t actual_len = len != 0 ? len : 1;
- assert( ( p = polarssl_malloc( actual_len ) ) != NULL );
+ p = polarssl_malloc( actual_len );
+ assert( p != NULL );
memset( p, 0x00, actual_len );
@@ -139,7 +140,8 @@ static unsigned char *unhexify_alloc( const char *ibuf, size_t *olen )
if( *olen == 0 )
return( zero_alloc( *olen ) );
- assert( ( obuf = polarssl_malloc( *olen ) ) != NULL );
+ obuf = polarssl_malloc( *olen );
+ assert( obuf != NULL );
(void) unhexify( obuf, ibuf );