summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2018-08-07 09:52:55 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2018-08-08 15:03:28 +0200
commit125aab3c0ac4b7e6eadfd6974fb877fd874a358d (patch)
tree36684d871d6dd7182d5bf4b9921d1e14cc8507b7 /tests
parentfa122d8149f1058e135bdcb31a7306a70093352d (diff)
downloadgnutls-125aab3c0ac4b7e6eadfd6974fb877fd874a358d.tar.gz
use a consistent method to mark fall-through in switch cases
Also document that method in contribution guide. Resolves #306 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/tls13/key_update.c6
-rw-r--r--tests/utils.h8
2 files changed, 11 insertions, 3 deletions
diff --git a/tests/tls13/key_update.c b/tests/tls13/key_update.c
index bed8a682b4..9abfa8afed 100644
--- a/tests/tls13/key_update.c
+++ b/tests/tls13/key_update.c
@@ -145,7 +145,7 @@ static void run(const char *name, unsigned test)
if (test != 0)
break;
sec_sleep(2);
- /* fall-through */
+ FALLTHROUGH;
case 2:
success("%s: updating server's key\n", name);
@@ -162,7 +162,7 @@ static void run(const char *name, unsigned test)
if (test != 0)
break;
sec_sleep(2);
- /* fall-through */
+ FALLTHROUGH;
case 3:
success("%s: updating client's key and asking server\n", name);
do {
@@ -178,7 +178,7 @@ static void run(const char *name, unsigned test)
if (test != 0)
break;
sec_sleep(2);
- /* fall-through */
+ FALLTHROUGH;
case 4:
success("%s: updating server's key and asking client\n", name);
do {
diff --git a/tests/utils.h b/tests/utils.h
index 58e9aef8a2..d5409d661d 100644
--- a/tests/utils.h
+++ b/tests/utils.h
@@ -40,6 +40,14 @@
# error tests cannot be compiled with NDEBUG defined
#endif
+#if _GNUTLS_GCC_VERSION >= 70100
+#define FALLTHROUGH __attribute__ ((fallthrough))
+#endif
+
+#ifndef FALLTHROUGH
+# define FALLTHROUGH
+#endif
+
inline static int global_init(void)
{
#ifdef ENABLE_PKCS11