diff options
author | Rich Salz <rsalz@openssl.org> | 2016-08-30 13:31:18 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-09-22 08:36:26 -0400 |
commit | f3b3d7f0033080f86ede5a53e8af2fb313091b5a (patch) | |
tree | c3761c9e3503980b7a2933211424165adad3fa8d /test | |
parent | 39c136cc53d7b6fafdd1a0b52c035fd24358e01c (diff) |
Add -Wswitch-enum
Change code so when switching on an enumeration, have case's for all
enumeration values.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/ct_test.c | 5 | ||||
-rw-r--r-- | test/handshake_helper.c | 13 |
2 files changed, 12 insertions, 6 deletions
diff --git a/test/ct_test.c b/test/ct_test.c index 6c96268e87..705fbfbb83 100644 --- a/test/ct_test.c +++ b/test/ct_test.c @@ -244,7 +244,10 @@ static int assert_validity(CT_TEST_FIXTURE fixture, case SCT_VALIDATION_STATUS_INVALID: ++invalid_sct_count; break; - default: + case SCT_VALIDATION_STATUS_NOT_SET: + case SCT_VALIDATION_STATUS_UNKNOWN_LOG: + case SCT_VALIDATION_STATUS_UNVERIFIED: + case SCT_VALIDATION_STATUS_UNKNOWN_VERSION: /* Ignore other validation statuses. */ break; } diff --git a/test/handshake_helper.c b/test/handshake_helper.c index 90e18fcaaa..3cfee16b61 100644 --- a/test/handshake_helper.c +++ b/test/handshake_helper.c @@ -333,7 +333,7 @@ static void configure_handshake_ctx(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, SSL_CTX_set_cert_verify_callback(client_ctx, &verify_reject_cb, NULL); break; - default: + case SSL_TEST_VERIFY_NONE: break; } @@ -347,7 +347,7 @@ static void configure_handshake_ctx(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, SSL_CTX_set_tlsext_servername_callback(server_ctx, servername_reject_cb); SSL_CTX_set_tlsext_servername_arg(server_ctx, server2_ctx); break; - default: + case SSL_TEST_SERVERNAME_CB_NONE: break; } @@ -631,9 +631,11 @@ static connect_phase_t next_phase(connect_phase_t phase) return SHUTDOWN; case SHUTDOWN: return CONNECTION_DONE; - default: - TEST_check(0); /* Should never call next_phase when done. */ + case CONNECTION_DONE: + TEST_check(0); + break; } + return -1; } static void do_connect_step(PEER *peer, connect_phase_t phase) @@ -648,8 +650,9 @@ static void do_connect_step(PEER *peer, connect_phase_t phase) case SHUTDOWN: do_shutdown_step(peer); break; - default: + case CONNECTION_DONE: TEST_check(0); + break; } } |