summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2018-08-08 14:22:08 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-08-08 14:22:08 +0000
commit3aeb9c1443f74ee1107772608afbc1041d65c958 (patch)
tree36684d871d6dd7182d5bf4b9921d1e14cc8507b7 /tests
parentfa122d8149f1058e135bdcb31a7306a70093352d (diff)
parent125aab3c0ac4b7e6eadfd6974fb877fd874a358d (diff)
downloadgnutls-3aeb9c1443f74ee1107772608afbc1041d65c958.tar.gz
Merge branch 'tmp-consistent-falltrough' into 'master'
use a consistent method to mark fall-through in switch cases Closes #306 See merge request gnutls/gnutls!726
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