]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
bus dispatch tests: treat impossible message_kind as GOT_SOMETHING_ELSE
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 17 Jan 2017 20:18:47 +0000 (20:18 +0000)
committerSimon McVittie <smcv@collabora.com>
Fri, 7 Apr 2017 11:06:02 +0000 (12:06 +0100)
check_got_service_info() can't actually return an invalid
GotServiceInfo, but if it somehow does, we want to fail the test.
GOT_SOMETHING_ELSE already has that effect, and a similar meaning.

Based on a patch from Thomas Zimmermann.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191

bus/dispatch.c

index 620fd36ad385f01db7606b5a2a0c955cf1f9f395..2b590741f335db798373446503c007812cd77d55 100644 (file)
@@ -2875,6 +2875,7 @@ check_existent_service_no_auto_start (BusContext     *context,
       switch (message_kind)
         {
         case GOT_SOMETHING_ELSE:
+        default:
           _dbus_warn ("Unexpected message after ActivateService "
                       "(should be an error or a service announcement");
           goto out;
@@ -3550,6 +3551,7 @@ check_existent_service_auto_start (BusContext     *context,
 
         case GOT_ERROR:
         case GOT_SOMETHING_ELSE:
+        default:
           _dbus_warn ("Unexpected message after auto activation");
           goto out;
         }
@@ -4243,6 +4245,7 @@ check_shell_service_success_auto_start (BusContext     *context,
 
         case GOT_ERROR:
         case GOT_SOMETHING_ELSE:
+        default:
           _dbus_warn ("Unexpected message after auto activation");
           goto out;
         }
@@ -4671,6 +4674,7 @@ check_list_services (BusContext     *context,
        case GOT_SOMETHING_ELSE:
        case GOT_ERROR:
        case GOT_SERVICE_DELETED:
+       default:
          _dbus_warn ("Unexpected message after ActivateService "
                      "(should be an error or a service announcement)");
          goto out;