]> git.sesse.net Git - vlc/commitdiff
Check that hotkeys are sorted properly (debug-only self-test)
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 28 Dec 2009 09:30:10 +0000 (11:30 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 28 Dec 2009 12:23:02 +0000 (14:23 +0200)
src/libvlc.c

index a6e6b69cbf11778994293ed524cc1ea9759cb252..c3087573effd011e093f40c29cfd77f338dd53a8 100644 (file)
@@ -824,6 +824,15 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
             p_keys[i].i_key = config_GetInt( p_libvlc,
                                              libvlc_actions[i].name );
             p_keys[i].i_action = libvlc_actions[i].value;
+#ifndef NDEBUG
+            if (i > 0
+             && strcmp(libvlc_actions[i-1].name, libvlc_actions[i].name) >= 0)
+            {
+                msg_Err(p_libvlc, "%s and %s are not ordered properly",
+                        libvlc_actions[i-1].name, libvlc_actions[i].name);
+                abort();
+            }
+#endif
         }
         p_keys[libvlc_actions_count].psz_action = NULL;
         p_keys[libvlc_actions_count].i_key = 0;