diff options
author | Mike Bland <mbland@acm.org> | 2014-06-07 13:05:50 -0400 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2014-06-10 19:27:45 +0100 |
commit | 5a0d057e49a6f7b5ee5ff6f8af5ae395abc7b918 (patch) | |
tree | 713d67063b149bff434cb1303bf7db0540373805 /ssl | |
parent | aa59369b4ca279d9896d45085e229d9803ad45eb (diff) |
Create test/testutil.h for unit test helper macros
Defines SETUP_TEST_FIXTURE and EXECUTE_TEST, and updates ssl/heartbeat_test.c
using these macros. SETUP_TEST_FIXTURE makes use of the new TEST_CASE_NAME
macro, defined to use __func__ or __FUNCTION__ on platforms that support those
symbols, or to use the file name and line number otherwise. This should fix
several reported build problems related to lack of C99 support.
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/heartbeat_test.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ssl/heartbeat_test.c b/ssl/heartbeat_test.c index d8cc559981..a0a3690096 100644 --- a/ssl/heartbeat_test.c +++ b/ssl/heartbeat_test.c @@ -38,6 +38,7 @@ * http://mike-bland.com/tags/heartbleed.html */ +#include "../test/testutil.h" #include "../ssl/ssl_locl.h" #include <ctype.h> #include <stdio.h> @@ -263,13 +264,10 @@ static int honest_payload_size(unsigned char payload_buf[]) } #define SETUP_HEARTBEAT_TEST_FIXTURE(type)\ - HEARTBEAT_TEST_FIXTURE fixture = set_up_##type(__func__);\ - int result = 0 + SETUP_TEST_FIXTURE(HEARTBEAT_TEST_FIXTURE, set_up_##type) #define EXECUTE_HEARTBEAT_TEST()\ - if (execute_heartbeat(fixture) != 0) result = 1;\ - tear_down(fixture);\ - return result + EXECUTE_TEST(execute_heartbeat, tear_down) static int test_dtls1_not_bleeding() { |