Rich Evans | 77d3638 | 2015-01-30 12:12:11 +0000 | [diff] [blame] | 1 | #include <string.h> |
| 2 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3 | #if defined(MBEDTLS_PLATFORM_C) |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 4 | #include "mbedtls/platform.h" |
Rich Evans | 77d3638 | 2015-01-30 12:12:11 +0000 | [diff] [blame] | 5 | #else |
Rich Evans | 012acfc | 2015-01-30 12:12:11 +0000 | [diff] [blame] | 6 | #include <stdio.h> |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 7 | #include <stdlib.h> |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8 | #define mbedtls_exit exit |
| 9 | #define mbedtls_free free |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 10 | #define mbedtls_calloc calloc |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 11 | #define mbedtls_fprintf fprintf |
| 12 | #define mbedtls_printf printf |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 13 | #define mbedtls_snprintf snprintf |
Rich Evans | 77d3638 | 2015-01-30 12:12:11 +0000 | [diff] [blame] | 14 | #endif |
| 15 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 16 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 17 | #include "mbedtls/memory_buffer_alloc.h" |
Manuel Pégourié-Gonnard | 0ac1d2d | 2015-01-26 14:58:04 +0100 | [diff] [blame] | 18 | #endif |
| 19 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 20 | static int test_errors = 0; |
| 21 | |
Paul Bakker | de56ca1 | 2013-09-15 17:05:21 +0200 | [diff] [blame] | 22 | SUITE_PRE_DEP |
| 23 | #define TEST_SUITE_ACTIVE |
| 24 | |
Manuel Pégourié-Gonnard | e91e21c | 2015-06-22 18:47:07 +0200 | [diff] [blame] | 25 | static void test_fail( const char *test ) |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 26 | { |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 27 | test_errors++; |
Paul Bakker | 55a7e90 | 2013-08-19 14:02:10 +0200 | [diff] [blame] | 28 | if( test_errors == 1 ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 29 | mbedtls_printf( "FAILED\n" ); |
| 30 | mbedtls_printf( " %s\n", test ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 31 | } |
| 32 | |
Paul Bakker | bb20f4b | 2013-08-20 12:41:33 +0200 | [diff] [blame] | 33 | #define TEST_ASSERT( TEST ) \ |
Manuel Pégourié-Gonnard | e91e21c | 2015-06-22 18:47:07 +0200 | [diff] [blame] | 34 | do { \ |
| 35 | if( ! (TEST) ) \ |
| 36 | { \ |
| 37 | test_fail( #TEST ); \ |
| 38 | goto exit; \ |
| 39 | } \ |
| 40 | } while( 0 ) |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 41 | |
| 42 | int verify_string( char **str ) |
| 43 | { |
| 44 | if( (*str)[0] != '"' || |
| 45 | (*str)[strlen( *str ) - 1] != '"' ) |
| 46 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 47 | mbedtls_printf( "Expected string (with \"\") for parameter and got: %s\n", *str ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 48 | return( -1 ); |
| 49 | } |
| 50 | |
| 51 | (*str)++; |
| 52 | (*str)[strlen( *str ) - 1] = '\0'; |
| 53 | |
| 54 | return( 0 ); |
| 55 | } |
| 56 | |
| 57 | int verify_int( char *str, int *value ) |
| 58 | { |
| 59 | size_t i; |
| 60 | int minus = 0; |
| 61 | int digits = 1; |
| 62 | int hex = 0; |
| 63 | |
| 64 | for( i = 0; i < strlen( str ); i++ ) |
| 65 | { |
| 66 | if( i == 0 && str[i] == '-' ) |
| 67 | { |
| 68 | minus = 1; |
| 69 | continue; |
| 70 | } |
| 71 | |
| 72 | if( ( ( minus && i == 2 ) || ( !minus && i == 1 ) ) && |
| 73 | str[i - 1] == '0' && str[i] == 'x' ) |
| 74 | { |
| 75 | hex = 1; |
| 76 | continue; |
| 77 | } |
| 78 | |
Manuel Pégourié-Gonnard | 725afd8 | 2014-02-01 11:54:28 +0100 | [diff] [blame] | 79 | if( ! ( ( str[i] >= '0' && str[i] <= '9' ) || |
| 80 | ( hex && ( ( str[i] >= 'a' && str[i] <= 'f' ) || |
| 81 | ( str[i] >= 'A' && str[i] <= 'F' ) ) ) ) ) |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 82 | { |
| 83 | digits = 0; |
| 84 | break; |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | if( digits ) |
| 89 | { |
| 90 | if( hex ) |
| 91 | *value = strtol( str, NULL, 16 ); |
| 92 | else |
| 93 | *value = strtol( str, NULL, 10 ); |
| 94 | |
| 95 | return( 0 ); |
| 96 | } |
| 97 | |
| 98 | MAPPING_CODE |
| 99 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 100 | mbedtls_printf( "Expected integer for parameter and got: %s\n", str ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 101 | return( -1 ); |
| 102 | } |
| 103 | |
Paul Bakker | de56ca1 | 2013-09-15 17:05:21 +0200 | [diff] [blame] | 104 | FUNCTION_CODE |
| 105 | SUITE_POST_DEP |
| 106 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 107 | int dep_check( char *str ) |
| 108 | { |
| 109 | if( str == NULL ) |
| 110 | return( 1 ); |
| 111 | |
| 112 | DEP_CHECK_CODE |
| 113 | |
| 114 | return( 1 ); |
| 115 | } |
| 116 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 117 | int dispatch_test(int cnt, char *params[50]) |
| 118 | { |
| 119 | int ret; |
Paul Bakker | b34fef2 | 2013-08-20 12:06:33 +0200 | [diff] [blame] | 120 | ((void) cnt); |
| 121 | ((void) params); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 122 | |
Paul Bakker | b34fef2 | 2013-08-20 12:06:33 +0200 | [diff] [blame] | 123 | #if defined(TEST_SUITE_ACTIVE) |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 124 | DISPATCH_FUNCTION |
| 125 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 126 | mbedtls_fprintf( stdout, "FAILED\nSkipping unknown test function '%s'\n", params[0] ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 127 | fflush( stdout ); |
| 128 | return( 1 ); |
| 129 | } |
Paul Bakker | b34fef2 | 2013-08-20 12:06:33 +0200 | [diff] [blame] | 130 | #else |
| 131 | return( 3 ); |
| 132 | #endif |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 133 | return( ret ); |
| 134 | } |
| 135 | |
| 136 | int get_line( FILE *f, char *buf, size_t len ) |
| 137 | { |
| 138 | char *ret; |
| 139 | |
| 140 | ret = fgets( buf, len, f ); |
| 141 | if( ret == NULL ) |
| 142 | return( -1 ); |
| 143 | |
| 144 | if( strlen( buf ) && buf[strlen(buf) - 1] == '\n' ) |
| 145 | buf[strlen(buf) - 1] = '\0'; |
| 146 | if( strlen( buf ) && buf[strlen(buf) - 1] == '\r' ) |
| 147 | buf[strlen(buf) - 1] = '\0'; |
| 148 | |
| 149 | return( 0 ); |
| 150 | } |
| 151 | |
| 152 | int parse_arguments( char *buf, size_t len, char *params[50] ) |
| 153 | { |
| 154 | int cnt = 0, i; |
| 155 | char *cur = buf; |
| 156 | char *p = buf, *q; |
| 157 | |
| 158 | params[cnt++] = cur; |
| 159 | |
| 160 | while( *p != '\0' && p < buf + len ) |
| 161 | { |
| 162 | if( *p == '\\' ) |
| 163 | { |
Manuel Pégourié-Gonnard | 2d5f142 | 2014-01-22 16:01:17 +0100 | [diff] [blame] | 164 | p++; |
| 165 | p++; |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 166 | continue; |
| 167 | } |
| 168 | if( *p == ':' ) |
| 169 | { |
| 170 | if( p + 1 < buf + len ) |
| 171 | { |
| 172 | cur = p + 1; |
| 173 | params[cnt++] = cur; |
| 174 | } |
| 175 | *p = '\0'; |
| 176 | } |
| 177 | |
Manuel Pégourié-Gonnard | 2d5f142 | 2014-01-22 16:01:17 +0100 | [diff] [blame] | 178 | p++; |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 179 | } |
| 180 | |
| 181 | // Replace newlines, question marks and colons in strings |
| 182 | for( i = 0; i < cnt; i++ ) |
| 183 | { |
| 184 | p = params[i]; |
| 185 | q = params[i]; |
| 186 | |
| 187 | while( *p != '\0' ) |
| 188 | { |
| 189 | if( *p == '\\' && *(p + 1) == 'n' ) |
| 190 | { |
| 191 | p += 2; |
| 192 | *(q++) = '\n'; |
| 193 | } |
| 194 | else if( *p == '\\' && *(p + 1) == ':' ) |
| 195 | { |
| 196 | p += 2; |
| 197 | *(q++) = ':'; |
| 198 | } |
| 199 | else if( *p == '\\' && *(p + 1) == '?' ) |
| 200 | { |
| 201 | p += 2; |
| 202 | *(q++) = '?'; |
| 203 | } |
| 204 | else |
| 205 | *(q++) = *(p++); |
| 206 | } |
| 207 | *q = '\0'; |
| 208 | } |
| 209 | |
| 210 | return( cnt ); |
| 211 | } |
| 212 | |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 213 | static int test_snprintf( size_t n, const char ref_buf[10], int ref_ret ) |
| 214 | { |
| 215 | int ret; |
| 216 | char buf[10] = "xxxxxxxxx"; |
Manuel Pégourié-Gonnard | 4b00f08 | 2015-06-26 11:24:32 +0200 | [diff] [blame] | 217 | const char ref[10] = "xxxxxxxxx"; |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 218 | |
| 219 | ret = mbedtls_snprintf( buf, n, "%s", "123" ); |
| 220 | if( ret < 0 || (size_t) ret >= n ) |
| 221 | ret = -1; |
| 222 | |
Manuel Pégourié-Gonnard | 4b00f08 | 2015-06-26 11:24:32 +0200 | [diff] [blame] | 223 | if( strncmp( ref_buf, buf, sizeof( buf ) ) != 0 || |
| 224 | ref_ret != ret || |
| 225 | memcmp( buf + n, ref + n, sizeof( buf ) - n ) != 0 ) |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 226 | { |
| 227 | return( 1 ); |
| 228 | } |
| 229 | |
| 230 | return( 0 ); |
| 231 | } |
| 232 | |
| 233 | static int run_test_snprintf( void ) |
| 234 | { |
| 235 | return( test_snprintf( 0, "xxxxxxxxx", -1 ) != 0 || |
Manuel Pégourié-Gonnard | 4b00f08 | 2015-06-26 11:24:32 +0200 | [diff] [blame] | 236 | test_snprintf( 1, "", -1 ) != 0 || |
| 237 | test_snprintf( 2, "1", -1 ) != 0 || |
| 238 | test_snprintf( 3, "12", -1 ) != 0 || |
| 239 | test_snprintf( 4, "123", 3 ) != 0 || |
| 240 | test_snprintf( 5, "123", 3 ) != 0 ); |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 241 | } |
| 242 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 243 | int main() |
| 244 | { |
| 245 | int ret, i, cnt, total_errors = 0, total_tests = 0, total_skipped = 0; |
| 246 | const char *filename = "TEST_FILENAME"; |
| 247 | FILE *file; |
| 248 | char buf[5000]; |
| 249 | char *params[50]; |
Manuel Pégourié-Gonnard | d14acbc | 2015-05-29 11:26:37 +0200 | [diff] [blame] | 250 | void *pointer; |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 251 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 252 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \ |
Manuel Pégourié-Gonnard | 765bb31 | 2014-11-27 11:55:27 +0100 | [diff] [blame] | 253 | !defined(TEST_SUITE_MEMORY_BUFFER_ALLOC) |
Paul Bakker | 1337aff | 2013-09-29 14:45:34 +0200 | [diff] [blame] | 254 | unsigned char alloc_buf[1000000]; |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 255 | mbedtls_memory_buffer_alloc_init( alloc_buf, sizeof(alloc_buf) ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 256 | #endif |
| 257 | |
Manuel Pégourié-Gonnard | d14acbc | 2015-05-29 11:26:37 +0200 | [diff] [blame] | 258 | /* |
| 259 | * The C standard doesn't guarantee that all-bits-0 is the representation |
| 260 | * of a NULL pointer. We do however use that in our code for initializing |
| 261 | * structures, which should work on every modern platform. Let's be sure. |
| 262 | */ |
| 263 | memset( &pointer, 0, sizeof( void * ) ); |
| 264 | if( pointer != NULL ) |
| 265 | { |
| 266 | mbedtls_fprintf( stderr, "all-bits-zero is not a NULL pointer\n" ); |
| 267 | return( 1 ); |
| 268 | } |
| 269 | |
Manuel Pégourié-Gonnard | 7b6dcbe | 2015-06-22 10:48:01 +0200 | [diff] [blame] | 270 | /* |
| 271 | * Make sure we have a snprintf that correctly zero-terminates |
| 272 | */ |
| 273 | if( run_test_snprintf() != 0 ) |
| 274 | { |
| 275 | mbedtls_fprintf( stderr, "the snprintf implementation is broken\n" ); |
| 276 | return( 0 ); |
| 277 | } |
| 278 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 279 | file = fopen( filename, "r" ); |
| 280 | if( file == NULL ) |
| 281 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 282 | mbedtls_fprintf( stderr, "Failed to open\n" ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 283 | return( 1 ); |
| 284 | } |
| 285 | |
| 286 | while( !feof( file ) ) |
| 287 | { |
| 288 | int skip = 0; |
| 289 | |
| 290 | if( ( ret = get_line( file, buf, sizeof(buf) ) ) != 0 ) |
| 291 | break; |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 292 | mbedtls_fprintf( stdout, "%s%.66s", test_errors ? "\n" : "", buf ); |
| 293 | mbedtls_fprintf( stdout, " " ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 294 | for( i = strlen( buf ) + 1; i < 67; i++ ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 295 | mbedtls_fprintf( stdout, "." ); |
| 296 | mbedtls_fprintf( stdout, " " ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 297 | fflush( stdout ); |
| 298 | |
| 299 | total_tests++; |
| 300 | |
| 301 | if( ( ret = get_line( file, buf, sizeof(buf) ) ) != 0 ) |
| 302 | break; |
| 303 | cnt = parse_arguments( buf, strlen(buf), params ); |
| 304 | |
| 305 | if( strcmp( params[0], "depends_on" ) == 0 ) |
| 306 | { |
| 307 | for( i = 1; i < cnt; i++ ) |
| 308 | if( dep_check( params[i] ) != 0 ) |
| 309 | skip = 1; |
| 310 | |
| 311 | if( ( ret = get_line( file, buf, sizeof(buf) ) ) != 0 ) |
| 312 | break; |
| 313 | cnt = parse_arguments( buf, strlen(buf), params ); |
| 314 | } |
| 315 | |
| 316 | if( skip == 0 ) |
| 317 | { |
| 318 | test_errors = 0; |
| 319 | ret = dispatch_test( cnt, params ); |
| 320 | } |
| 321 | |
| 322 | if( skip == 1 || ret == 3 ) |
| 323 | { |
| 324 | total_skipped++; |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 325 | mbedtls_fprintf( stdout, "----\n" ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 326 | fflush( stdout ); |
| 327 | } |
Paul Bakker | 33b43f1 | 2013-08-20 11:48:36 +0200 | [diff] [blame] | 328 | else if( ret == 0 && test_errors == 0 ) |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 329 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 330 | mbedtls_fprintf( stdout, "PASS\n" ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 331 | fflush( stdout ); |
| 332 | } |
| 333 | else if( ret == 2 ) |
| 334 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 335 | mbedtls_fprintf( stderr, "FAILED: FATAL PARSE ERROR\n" ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 336 | fclose(file); |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 337 | mbedtls_exit( 2 ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 338 | } |
| 339 | else |
| 340 | total_errors++; |
| 341 | |
| 342 | if( ( ret = get_line( file, buf, sizeof(buf) ) ) != 0 ) |
| 343 | break; |
| 344 | if( strlen(buf) != 0 ) |
| 345 | { |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 346 | mbedtls_fprintf( stderr, "Should be empty %d\n", (int) strlen(buf) ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 347 | return( 1 ); |
| 348 | } |
| 349 | } |
| 350 | fclose(file); |
| 351 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 352 | mbedtls_fprintf( stdout, "\n----------------------------------------------------------------------------\n\n"); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 353 | if( total_errors == 0 ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 354 | mbedtls_fprintf( stdout, "PASSED" ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 355 | else |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 356 | mbedtls_fprintf( stdout, "FAILED" ); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 357 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 358 | mbedtls_fprintf( stdout, " (%d / %d tests (%d skipped))\n", |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 359 | total_tests - total_errors, total_tests, total_skipped ); |
| 360 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 361 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \ |
Manuel Pégourié-Gonnard | 765bb31 | 2014-11-27 11:55:27 +0100 | [diff] [blame] | 362 | !defined(TEST_SUITE_MEMORY_BUFFER_ALLOC) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 363 | #if defined(MBEDTLS_MEMORY_DEBUG) |
| 364 | mbedtls_memory_buffer_alloc_status(); |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 365 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 366 | mbedtls_memory_buffer_alloc_free(); |
Paul Bakker | 1337aff | 2013-09-29 14:45:34 +0200 | [diff] [blame] | 367 | #endif |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame] | 368 | |
| 369 | return( total_errors != 0 ); |
| 370 | } |
| 371 | |