Created
July 1, 2015 18:41
-
-
Save user-none/6c627e97f65a31c5bc1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "s2n_test.h" | |
#include <unistd.h> | |
#include <stdint.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <s2n.h> | |
#include "tls/s2n_connection.h" | |
int main(int argc, char **argv) | |
{ | |
struct s2n_config *server_config; | |
size_t i; | |
BEGIN_TEST(); | |
EXPECT_SUCCESS(setenv("S2N_ENABLE_CLIENT_MODE", "1", 0)); | |
EXPECT_SUCCESS(s2n_init()); | |
for (i=0; i<10000; i++) { | |
server_config = s2n_config_new(); | |
if (server_config == NULL) { | |
printf("i=%zu, %s\n", i, strerror(errno)); | |
break; | |
} | |
} | |
EXPECT_NOT_NULL(server_config); | |
END_TEST(); | |
return 0; | |
} | |
Output on Ubuntu 14.04.2 | |
Running s2n_mlock_fail.c ... i=916, Cannot allocate memory | |
FAILED | |
Valgrind shows: | |
==25588== HEAP SUMMARY: | |
==25588== in use at exit: 26,336 bytes in 533 blocks | |
==25588== total heap usage: 600 allocs, 67 frees, 34,977 bytes allocated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment