[asterisk-commits] tilghman: trunk r251677 - in /trunk: funcs/ tests/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 10 14:30:38 CST 2010


Author: tilghman
Date: Wed Mar 10 14:30:34 2010
New Revision: 251677

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=251677
Log:
It's amazing what writing a test will find.

(issue #16900)
 Reported by: bluecrow76

Modified:
    trunk/funcs/func_strings.c
    trunk/tests/test_substitution.c

Modified: trunk/funcs/func_strings.c
URL: http://svnview.digium.com/svn/asterisk/trunk/funcs/func_strings.c?view=diff&rev=251677&r1=251676&r2=251677
==============================================================================
--- trunk/funcs/func_strings.c (original)
+++ trunk/funcs/func_strings.c Wed Mar 10 14:30:34 2010
@@ -493,7 +493,7 @@
 		ast_channel_lock(chan);
 	}
 	ast_str_substitute_variables(&orig_list, 0, chan, varsubst);
-	if (ast_str_strlen(orig_list)) {
+	if (!ast_str_strlen(orig_list)) {
 		ast_log(LOG_ERROR, "List variable '%s' not found\n", args.listname);
 		if (chan) {
 			ast_channel_unlock(chan);

Modified: trunk/tests/test_substitution.c
URL: http://svnview.digium.com/svn/asterisk/trunk/tests/test_substitution.c?view=diff&rev=251677&r1=251676&r2=251677
==============================================================================
--- trunk/tests/test_substitution.c (original)
+++ trunk/tests/test_substitution.c Wed Mar 10 14:30:34 2010
@@ -251,6 +251,8 @@
 	TEST(test_expected_result(test, c, "A${${baz}o:-1:1}A", "A3A"));
 	TEST(test_expected_result(test, c, "A${${baz}o:-2:1}A", "A2A"));
 	TEST(test_expected_result(test, c, "A${${baz}o:-2:-1}A", "A2A"));
+	pbx_builtin_setvar_helper(c, "list1", "ab&cd&ef");
+	TEST(test_expected_result(test, c, "${LISTFILTER(list1,&,cd)}", "ab&ef"));
 #undef TEST
 
 	/* For testing dialplan functions */




More information about the asterisk-commits mailing list