From 66a5c9a88c736b368b0eeae4a8f9bb6f90ee4495 Mon Sep 17 00:00:00 2001 From: mnicholson Date: Fri, 8 Jul 2011 19:54:23 +0000 Subject: Merged revisions 327106 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r327106 | mnicholson | 2011-07-08 14:52:51 -0500 (Fri, 08 Jul 2011) | 11 lines Reset our ast_str before passing it on to dialplan function backends. It is possible for a dialplan backend to not modify the given buffer or ast_str and still return success. This causes any previous value stored in the buffer to be used as if the new function call provided it. Some functions also append to the given buffer assuming it is empty. The test_substitution unit test has also been modified to detect this problem. (closes issue ASTERISK-17878) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327107 f38db490-d61c-443f-a65b-d21fe96a405b --- tests/test_substitution.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/test_substitution.c') diff --git a/tests/test_substitution.c b/tests/test_substitution.c index aa7d14f91..98e1ed191 100644 --- a/tests/test_substitution.c +++ b/tests/test_substitution.c @@ -261,6 +261,8 @@ AST_TEST_DEFINE(test_substitution) 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")); + TEST(test_expected_result(test, c, "${SHELL(echo -n 123)},${SHELL(echo -n 456)}", "123,456")); + TEST(test_expected_result(test, c, "${foo},${CDR(answer)},${SHELL(echo -n 456)}", "123,,456")); #undef TEST /* For testing dialplan functions */ -- cgit v1.2.3 From 959deafb08b36e7a7ee52493e048c751b646dc9b Mon Sep 17 00:00:00 2001 From: mnicholson Date: Mon, 11 Jul 2011 13:55:28 +0000 Subject: Merged revisions 327512 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r327512 | mnicholson | 2011-07-11 08:53:59 -0500 (Mon, 11 Jul 2011) | 2 lines reset our buffer each iteration when doing variable substitution ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327513 f38db490-d61c-443f-a65b-d21fe96a405b --- tests/test_substitution.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/test_substitution.c') diff --git a/tests/test_substitution.c b/tests/test_substitution.c index 98e1ed191..366b9371c 100644 --- a/tests/test_substitution.c +++ b/tests/test_substitution.c @@ -263,6 +263,7 @@ AST_TEST_DEFINE(test_substitution) TEST(test_expected_result(test, c, "${LISTFILTER(list1,&,cd)}", "ab&ef")); TEST(test_expected_result(test, c, "${SHELL(echo -n 123)},${SHELL(echo -n 456)}", "123,456")); TEST(test_expected_result(test, c, "${foo},${CDR(answer)},${SHELL(echo -n 456)}", "123,,456")); + TEST(test_expected_result(test, c, "${foo},${this_does_not_exist},${THIS_DOES_NOT_EXIST(either)}", "123,,")); #undef TEST /* For testing dialplan functions */ -- cgit v1.2.3 From bdb6e57e72a435d52535de1067426024560574e8 Mon Sep 17 00:00:00 2001 From: mnicholson Date: Mon, 11 Jul 2011 20:06:28 +0000 Subject: use printf instead of echo -n in substitution test git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327684 f38db490-d61c-443f-a65b-d21fe96a405b --- tests/test_substitution.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_substitution.c') diff --git a/tests/test_substitution.c b/tests/test_substitution.c index 366b9371c..b335d50ba 100644 --- a/tests/test_substitution.c +++ b/tests/test_substitution.c @@ -261,8 +261,8 @@ AST_TEST_DEFINE(test_substitution) 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")); - TEST(test_expected_result(test, c, "${SHELL(echo -n 123)},${SHELL(echo -n 456)}", "123,456")); - TEST(test_expected_result(test, c, "${foo},${CDR(answer)},${SHELL(echo -n 456)}", "123,,456")); + TEST(test_expected_result(test, c, "${SHELL(printf 123)},${SHELL(printf 456)}", "123,456")); + TEST(test_expected_result(test, c, "${foo},${CDR(answer)},${SHELL(printf 456)}", "123,,456")); TEST(test_expected_result(test, c, "${foo},${this_does_not_exist},${THIS_DOES_NOT_EXIST(either)}", "123,,")); #undef TEST -- cgit v1.2.3 From 9b87fa23c7836284f1945f620a105573471af0a1 Mon Sep 17 00:00:00 2001 From: tilghman Date: Tue, 12 Jul 2011 15:38:47 +0000 Subject: Merged revisions 327793 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r327793 | tilghman | 2011-07-12 10:35:46 -0500 (Tue, 12 Jul 2011) | 14 lines Use 'printf' (POSIX issue 4) instead of 'echo -n', for portability. The problem with using 'echo -n' is that it is not portable. While BSD systems required that the '-n' option be removed and interpreted, System V required that all strings should be echoed with no interpretation of options. This fundamental difference of behavior means that it is never possible to use the '-n' flag to echo in tests which are meant to be portable. In this case, on Mac OS X 10.6, the /bin/sh shell builtin 'echo' uses the System V semantics of the command, and thus the SHELL test failed on that platform. http://pubs.opengroup.org/onlinepubs/009695399/utilities/echo.html#tag_04_41_16 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@327794 f38db490-d61c-443f-a65b-d21fe96a405b --- tests/test_substitution.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_substitution.c') diff --git a/tests/test_substitution.c b/tests/test_substitution.c index b335d50ba..cb3161691 100644 --- a/tests/test_substitution.c +++ b/tests/test_substitution.c @@ -261,8 +261,8 @@ AST_TEST_DEFINE(test_substitution) 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")); - TEST(test_expected_result(test, c, "${SHELL(printf 123)},${SHELL(printf 456)}", "123,456")); - TEST(test_expected_result(test, c, "${foo},${CDR(answer)},${SHELL(printf 456)}", "123,,456")); + TEST(test_expected_result(test, c, "${SHELL(printf '%d' 123)},${SHELL(printf '%d' 456)}", "123,456")); + TEST(test_expected_result(test, c, "${foo},${CDR(answer)},${SHELL(printf '%d' 456)}", "123,,456")); TEST(test_expected_result(test, c, "${foo},${this_does_not_exist},${THIS_DOES_NOT_EXIST(either)}", "123,,")); #undef TEST -- cgit v1.2.3 From e73cab2f3f7846300e1d8a340f8261b16c718226 Mon Sep 17 00:00:00 2001 From: lmadsen Date: Thu, 14 Jul 2011 20:28:54 +0000 Subject: Merged revisions 328247 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines Merged revisions 328209 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines Introduce tags in MODULEINFO. This change introduces MODULEINFO into many modules in Asterisk in order to show the community support level for those modules. This is used by changes committed to menuselect by Russell Bryant recently (r917 in menuselect). More information about the support level types and what they mean is available on the wiki at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@328259 f38db490-d61c-443f-a65b-d21fe96a405b --- tests/test_substitution.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/test_substitution.c') diff --git a/tests/test_substitution.c b/tests/test_substitution.c index cb3161691..eb3bb54e2 100644 --- a/tests/test_substitution.c +++ b/tests/test_substitution.c @@ -28,6 +28,7 @@ /*** MODULEINFO TEST_FRAMEWORK func_curl + extended ***/ #include "asterisk.h" -- cgit v1.2.3