[vlc-devel] commit: Check that hotkeys are sorted properly (debug-only self-test) ( Rémi Denis-Courmont )

git version control git at videolan.org
Mon Dec 28 13:23:06 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 28 11:30:10 2009 +0200| [1b7540c4e7db9d419566bf36aac08aaa6f559895] | committer: Rémi Denis-Courmont 

Check that hotkeys are sorted properly (debug-only self-test)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1b7540c4e7db9d419566bf36aac08aaa6f559895
---

 src/libvlc.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index a6e6b69..c308757 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -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;




More information about the vlc-devel mailing list