From 1b7540c4e7db9d419566bf36aac08aaa6f559895 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Mon, 28 Dec 2009 11:30:10 +0200 Subject: [PATCH] Check that hotkeys are sorted properly (debug-only self-test) --- src/libvlc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libvlc.c b/src/libvlc.c index a6e6b69cbf..c3087573ef 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; -- 2.39.5