[gnome-desktop-testing/wip/no-autotools: 3/8] main: Explicitly handle all members of enum in switch




commit 7658e81f4bcb0f428a12a873c4f925bb10fa40bb
Author: Simon McVittie <smcv collabora com>
Date:   Tue Jun 29 17:05:11 2021 +0100

    main: Explicitly handle all members of enum in switch
    
    This means we can use -Wswitch-enum to check that we have thought
    about everything we need to handle.
    
    Signed-off-by: Simon McVittie <smcv collabora com>

 configure.ac                       | 1 +
 src/gnome-desktop-testing-runner.c | 3 +++
 2 files changed, 4 insertions(+)
---
diff --git a/configure.ac b/configure.ac
index 82dc535..f929f60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,7 @@ if test "x$GCC" = "xyes"; then
                -Werror=pointer-arith -Werror=init-self -Werror=format=2 \
                -Werror=format-security \
                -Werror=missing-include-dirs -Werror=aggregate-return \
+               -Werror=switch-default -Wswitch-enum
                -Werror=declaration-after-statement"
 fi
 changequote([,])dnl
diff --git a/src/gnome-desktop-testing-runner.c b/src/gnome-desktop-testing-runner.c
index 536eb8f..c9d6ad0 100644
--- a/src/gnome-desktop-testing-runner.c
+++ b/src/gnome-desktop-testing-runner.c
@@ -1025,6 +1025,9 @@ main (int argc, char **argv)
             case TEST_STATE_COMPLETE_FAILED:
               n_failed++;
               break;
+            case TEST_STATE_UNLOADED:
+            case TEST_STATE_LOADED:
+            case TEST_STATE_EXECUTING:
             default:
               break;
             }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]