1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

New test suite: net

A place to put tests for the net_sockets module (MBEDTLS_NET_C feature).

Start with a context smoke test.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2021-02-24 18:37:46 +01:00
parent 2ac5f8c04b
commit 1c0e48a2ce
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,28 @@
/* BEGIN_HEADER */
#include "mbedtls/net_sockets.h"
/* END_HEADER */
/* BEGIN_DEPENDENCIES
* depends_on:MBEDTLS_NET_C
* END_DEPENDENCIES
*/
/* BEGIN_CASE */
void context_init_free( int reinit )
{
mbedtls_net_context ctx;
mbedtls_net_init( &ctx );
mbedtls_net_free( &ctx );
if( reinit )
mbedtls_net_init( &ctx );
mbedtls_net_free( &ctx );
/* This test case always succeeds, functionally speaking. A plausible
* bug might trigger an invalid pointer dereference or a memory leak. */
goto exit;
}
/* END_CASE */