Create test/testutil.h for unit test helper macros
[openssl.git] / ssl / heartbeat_test.c
index eddadbe695a6b6f33b34bf7ceb67f73ea6bcee6c..a0a3690096d504e74881c062852f3a6cdfa065c6 100644 (file)
@@ -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>
@@ -190,7 +191,7 @@ static void print_payload(const char* const prefix,
                else printf("\\x%02x", c);
                }
        printf("\"\n");
-}
+       }
 
 static int execute_heartbeat(HEARTBEAT_TEST_FIXTURE fixture)
        {
@@ -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()
        {