summaryrefslogtreecommitdiffstats
path: root/ssl/heartbeat_test.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2014-07-23 13:18:06 +0100
committerDr. Stephen Henson <steve@openssl.org>2014-07-24 19:41:29 +0100
commite0fc7961c4fbd27577fb519d9aea2dc788742715 (patch)
treed6ecb99ae473b7ffaeaab0fcaf6204e7067862ab /ssl/heartbeat_test.c
parent8e55e6de45f715d4a2e0b31775c1c739ce90c1d5 (diff)
Add conditional unit testing interface.
Don't call internal functions directly call them through SSL_test_functions(). This also makes unit testing work on Windows and platforms that don't export internal functions from shared libraries. By default unit testing is not enabled: it requires the compile time option "enable-unit-test". Reviewed-by: Geoff Thorpe <geoff@openssl.org>
Diffstat (limited to 'ssl/heartbeat_test.c')
-rw-r--r--ssl/heartbeat_test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ssl/heartbeat_test.c b/ssl/heartbeat_test.c
index 4030034d8b..fc19259b43 100644
--- a/ssl/heartbeat_test.c
+++ b/ssl/heartbeat_test.c
@@ -38,6 +38,8 @@
* http://mike-bland.com/tags/heartbleed.html
*/
+#define OPENSSL_UNIT_TEST
+
#include "../ssl/ssl_locl.h"
#include "testutil.h"
@@ -46,7 +48,7 @@
#include <stdlib.h>
#include <string.h>
-#if !defined(OPENSSL_NO_HEARTBEATS) && !defined(OPENSSL_SYS_WINDOWS)
+#if !defined(OPENSSL_NO_HEARTBEATS) && !defined(OPENSSL_NO_UNIT_TEST)
/* As per https://tools.ietf.org/html/rfc6520#section-4 */
#define MIN_PADDING_SIZE 16