Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ if (BUILD_TESTING)
-Wshadow -Wcast-align -Wwrite-strings -Wformat-security
-Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-deprecated -std=gnu99
)
if (UNSAFE_TREAT_WARNINGS_AS_ERRORS)
target_compile_options(${test_case_name} PRIVATE -Werror)
endif()
if (S2N_LTO)
target_compile_options(${test_case_name} PRIVATE -flto)
endif()
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/s2n_fork_generation_number_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ static int s2n_unit_test_fork_check_threads_first(uint64_t parent_process_fgn)
return S2N_SUCCESS;
}

#if S2N_CLONE_SUPPORTED
static int s2n_unit_test_clone_child_process(void *parent_process_fgn)
{
/* In child */
Expand All @@ -191,6 +192,7 @@ static int s2n_unit_test_clone_child_process(void *parent_process_fgn)

exit(EXIT_SUCCESS);
}
#endif

#define PROCESS_CHILD_STACK_SIZE (1024 * 1024) /* Suggested by clone() man page... */
static int s2n_unit_test_clone(uint64_t parent_process_fgn)
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/s2n_handshake_type_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

#include <sys/param.h>
#include <stdint.h>

#include "s2n_test.h"
#include "tls/s2n_connection.h"
Expand All @@ -36,7 +37,7 @@ int main(int argc, char **argv)
EXPECT_TRUE(S2N_FIRST_TLS12_HANDSHAKE_FLAG < S2N_LAST_TLS12_HANDSHAKE_FLAG);
EXPECT_EQUAL(S2N_FIRST_TLS13_HANDSHAKE_FLAG, S2N_LAST_COMMON_HANDSHAKE_FLAG * 2);
EXPECT_TRUE(S2N_FIRST_TLS13_HANDSHAKE_FLAG < S2N_LAST_TLS13_HANDSHAKE_FLAG);
EXPECT_EQUAL(MAX(S2N_LAST_TLS12_HANDSHAKE_FLAG, S2N_LAST_TLS13_HANDSHAKE_FLAG), S2N_HANDSHAKES_COUNT / 2);
EXPECT_EQUAL(MAX((uint32_t) S2N_LAST_TLS12_HANDSHAKE_FLAG, (uint32_t) S2N_LAST_TLS13_HANDSHAKE_FLAG), S2N_HANDSHAKES_COUNT / 2);

/* Test s2n_handshake_type_reset */
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/s2n_safety_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static int success_memcpy()

static int failure_memcpy()
{
char src[1024];
char src[1024] = { 0 };
char *ptr = NULL;

POSIX_CHECKED_MEMCPY(ptr, src, 1024);
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/s2n_tls12_handshake_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ int main(int argc, char **argv)
{
struct s2n_connection *conn = s2n_connection_new(S2N_CLIENT);
conn->actual_protocol_version = S2N_TLS12;
EXPECT_EQUAL(ACTIVE_STATE_MACHINE(conn), state_machine);
EXPECT_EQUAL(ACTIVE_HANDSHAKES(conn), handshakes);
EXPECT_EQUAL(&ACTIVE_STATE_MACHINE(conn)[0], &state_machine[0]);
EXPECT_EQUAL(&ACTIVE_HANDSHAKES(conn)[0], &handshakes[0]);
EXPECT_SUCCESS(s2n_connection_free(conn));
};

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/s2n_tls13_handshake_state_machine_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ int main(int argc, char **argv)
struct s2n_connection *conn = s2n_connection_new(S2N_CLIENT);
conn->actual_protocol_version = S2N_TLS13;
EXPECT_OK(s2n_conn_choose_state_machine(conn, S2N_TLS13));
EXPECT_EQUAL(ACTIVE_STATE_MACHINE(conn), tls13_state_machine);
EXPECT_EQUAL(ACTIVE_HANDSHAKES(conn), tls13_handshakes);
EXPECT_EQUAL(&ACTIVE_STATE_MACHINE(conn)[0], &tls13_state_machine[0]);
EXPECT_EQUAL(&ACTIVE_HANDSHAKES(conn)[0], &tls13_handshakes[0]);
EXPECT_SUCCESS(s2n_connection_free(conn));
};

Expand Down
Loading