X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=test%2Fwpackettest.c;h=773eef052525188b6e3f035ec7a33956b36c5d7c;hb=26ec943e020c0db6a25e6d155ba318270eff0fd7;hp=a37fab7a3b6035069febedbfba51e90e390f015e;hpb=edd689efbfa26a657a5d8310f43a4f11d29a460e;p=openssl.git diff --git a/test/wpackettest.c b/test/wpackettest.c index a37fab7a3b..773eef0525 100644 --- a/test/wpackettest.c +++ b/test/wpackettest.c @@ -1,5 +1,5 @@ /* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -22,17 +22,16 @@ #endif #include "testutil.h" -#include "test_main_custom.h" - -const static unsigned char simple1[] = { 0xff }; -const static unsigned char simple2[] = { 0x01, 0xff }; -const static unsigned char simple3[] = { 0x00, 0x00, 0x00, 0x01, 0xff }; -const static unsigned char nestedsub[] = { 0x03, 0xff, 0x01, 0xff }; -const static unsigned char seqsub[] = { 0x01, 0xff, 0x01, 0xff }; -const static unsigned char empty[] = { 0x00 }; -const static unsigned char alloc[] = { 0x02, 0xfe, 0xff }; -const static unsigned char submem[] = { 0x03, 0x02, 0xfe, 0xff }; -const static unsigned char fixed[] = { 0xff, 0xff, 0xff }; + +static const unsigned char simple1[] = { 0xff }; +static const unsigned char simple2[] = { 0x01, 0xff }; +static const unsigned char simple3[] = { 0x00, 0x00, 0x00, 0x01, 0xff }; +static const unsigned char nestedsub[] = { 0x03, 0xff, 0x01, 0xff }; +static const unsigned char seqsub[] = { 0x01, 0xff, 0x01, 0xff }; +static const unsigned char empty[] = { 0x00 }; +static const unsigned char alloc[] = { 0x02, 0xfe, 0xff }; +static const unsigned char submem[] = { 0x03, 0x02, 0xfe, 0xff }; +static const unsigned char fixed[] = { 0xff, 0xff, 0xff }; static BUF_MEM *buf; @@ -361,10 +360,8 @@ static int test_WPACKET_memcpy(void) return 1; } -int test_main(int argc, char *argv[]) +int setup_tests(void) { - int testresult = 0; - if (!TEST_ptr(buf = BUF_MEM_new())) return 0; @@ -374,8 +371,10 @@ int test_main(int argc, char *argv[]) ADD_TEST(test_WPACKET_set_flags); ADD_TEST(test_WPACKET_allocate_bytes); ADD_TEST(test_WPACKET_memcpy); - testresult = run_tests(argv[0]); + return 1; +} +void cleanup_tests(void) +{ BUF_MEM_free(buf); - return testresult; }