dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

20 Commits

Author SHA1 Message Date
tilghman cc07f75cb0 Kill some startup warnings and errors and make some messages more helpful in tracking down the source.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@275105 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-09 17:00:22 +00:00
russell 0489f825d4 Merged revisions 275021 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r275021 | russell | 2010-07-09 10:33:08 -0500 (Fri, 09 Jul 2010) | 4 lines
  
  Document that a leading and trailing slash is expected for test categories.
  
  Also, emit a warning if a test is registered without one of these.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@275022 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-09 15:35:53 +00:00
russell 632a45fdad Put test output for a failure in a CDATA section in the XML results.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254159 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-23 22:35:56 +00:00
russell 4349aaed67 Resolve more compiler warnings on FreeBSD.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253540 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-20 12:03:07 +00:00
lmadsen 12b485099c main/test.c reports erroneous CLI message.
(closes issue #17051)
Reported by: Nick_Lewis

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253205 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-17 19:06:04 +00:00
dvossel a5ea1fa274 Changes 0ms to <1ms in cli END results during 'test execute'
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250478 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-03 19:02:13 +00:00
dvossel 7b56cffd49 fixes assumption that test failed if it did not pass when generating results
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250237 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-03 00:04:28 +00:00
dvossel eaec43bac9 adds Time field to "test show results" cli command
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@249186 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-26 18:41:36 +00:00
mmichelson 86e437c3c3 Fix a couple of bugs in test tab completion.
1. Add missing unlock of lists.
2. Swap order of arguments to test_cat_cmp in complete_test_name.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@247381 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-17 22:44:53 +00:00
mmichelson 57ef68cb88 Tab completion for test categories and names for "test show registered" and "test execute" CLI commands.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@247380 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-17 22:40:43 +00:00
russell d8d63de328 Various updates to the unit test API.
1) It occurred to me that the difference in usage between the error ast_str and
the ast_test_update_status() usage has turned out to be a bit ambiguous in
practice.  In a lot of cases, the same message was being sent to both.
In other cases, it was only sent to one or the other.  My opinion now is that
in every case, I think it makes sense to do both; we should output it to the
CLI as well as save it off for logging purposes.

This change results in most of the changes in this diff, since it required
changes to all existing unit tests.  It also allowed for some simplifications
of unit test API implementation code.

2) Update ast_test_status_update() to include the file, function, and line
number for the code providing the update.

3) There are some formatting tweaks here and there.  Hopefully they aren't too
distracting for code review purposes.  Reviewboard's diff viewer seems to do a
pretty good job of pointing out when something is a whitespace change.

4) I moved the md5_test and sha1_test into the test_utils module.  It seemed
like a better approach since these tests are so tiny.

5) I changed the number of nodes used in heap_test_2 from 1 million to
100 thousand.  The only reason for this was to reduce the time it took
for this test to run.

6) Remove an unused function prototype that was at the bottom of utils.h.

7) Simplify test_insert() using the LIST_INSERT_SORTALPHA() macro.  The one
minor difference in behavior is that it no longer checks for a test registered
with the same name.

8) Expand the code in test_alloc() to provide specific error messages for each
failure case, to clearly inform developers if they forget to set the name,
summary, description, etc.

9) Tweak the output of the "test show registered" CLI command.  I swapped the
name and category to have the category first.  It seemed more natural since
that is the sort key.

10) Don't output the status ast_str in the "test show results" CLI command.
This is going to tend to be pretty verbose, so just leave that for the
detailed test logs (test generate results).

Review: https://reviewboard.asterisk.org/r/493/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@245864 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-09 23:32:14 +00:00
russell 2571edec9a Remove an extra space.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@245268 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-07 20:56:57 +00:00
dvossel 78b90be27c fix truncated format string in 'test show registered'
When using the 'test show registered' cli command the 'Test Results'
category was truncating the last few characters making it look like 
'Test Resul'.  I also expanded other parts of the format to better
represent how long function names and categories will likely be.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@244688 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-04 15:36:33 +00:00
dvossel 88b11a8da5 modify 'test show registered' cli output format
In order to improve readability, the output from 'test show
registered' has been modified to truncate fields to fit within
the format output if they are over a certain length.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243242 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-26 17:40:02 +00:00
dvossel 1bc7ad599c RFC compliant uri and display-name encode/decode
1.  URI Encoding
This patch changes ast_uri_encode()'s behavior when doreserved is enabled.
Previously when doreserved was enabled only a small set of reserved
characters were encoded.  This set was comprised primarily of the reserved
characters defined in RFC3261 section 25.1, but contained other characters as
well.  Rather than only escaping the reserved set, doreserved now escapes
all characters not within the unreserved set as defined by RFC 3261 and
RFC 2396.  Also, the 'doreserved' variable has been renamed to 'do_special_char'
in attempts to avoid confusion.

When doreserve is not enabled, the previous logic of only encoding the
characters <= 0X1F and > 0X7f remains, except for the '%' character, which
must always be encoded as it signifies a HEX escaped character during the decode
process.

2. URI Decoding: Break up URI before decode.
In chan_sip.c ast_uri_decode is called on the entire URI instead of it's
individual parts after it is parsed.  This is not good as ast_uri_decode
can introduce special characters back into the URI which can mess up parsing.
This patch resolves this by not decoding a URI until parsing is completely
done.  There are many instances where we check to see if pedantic checking
is enabled before we decode a URI.  In these cases a new macro,
SIP_PEDANTIC_DECODE, is used on the individual parsed segments of the URI
rather than constantly putting if (pedantic) { decode() } checks everywhere
in the code.  In the areas where ast_uri_decode is not dependent upon
pedantic checking this macro is not used, but decoding is still moved to
each individual part of the URI.  The only behavior that should change from
this patch is the time at which decoding occurs.

Since I had to look over every place URI parsing occurs to create this
patch, I found several places where we use duplicate code for parsing.
To consolidate the code, those areas have updated to use the parse_uri()
function where possible.

3. SIP display-name decoding according to RFC3261 section 25.
To properly decode the display-name portion of a FROM header, chan_sip's
get_calleridname() function required a complete re-write.  More information
about this change can be found in the comments at the beginning of this function.

4. Unit Tests.
Unit tests for ast_uri_encode, ast_uri_decode, and get_calleridname() have been
written.  This involved the addition of the test_utils.c file for testing the
utils api.

(closes issue #16299)
Reported by: wdoekes
Patches:
      astsvn-16299-get_calleridname.diff uploaded by wdoekes (license 717)
      get_calleridname_rewrite.diff uploaded by dvossel (license 671)
Tested by: wdoekes, dvossel, Nick_Lewis

Review: https://reviewboard.asterisk.org/r/469/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243200 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-26 16:30:08 +00:00
russell 94e6be6095 Update the doxygenification of some comments.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242186 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-22 04:57:03 +00:00
russell f51fb43c4d Point to a useful reference on the XML output format.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@241856 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-21 14:10:51 +00:00
russell 39123aed2f Modify test results XML format to match the JUnit format.
When this code was developed, we came up with our own XML format for the test
output.  I have since started looking at integration with other tools, namely
continuous integration frameworks, and this format seems to be supported
across a number of applications.  With these changes in place, I was able
to get Atlassian Bamboo to interpret the test results.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@241855 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-21 13:59:41 +00:00
seanbright 76f02e8ea5 Fix spelling of 'category.'
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239111 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-11 16:22:09 +00:00
dvossel 5d1bac896e Unit Test Framework API
The Unit Test Framework is a new API that manages registration and
execution of unit tests in Asterisk with the purpose of verifying the
operation of C functions.  The Framework consists of a single test
manager accompanied by a list of registered test functions defined
within the code.  A test is defined, registered, and unregistered
from the framework using a set of macros which allow the test code
to only be compiled within asterisk when the TEST_FRAMEWORK flag is
enabled in menuselect.  This allows the test code to exist in the
same file as the C functions it intends to verify.  Registered tests
may be viewed and executed via a set of new CLI commands.  CLI commands
are also present for generating and exporting test results into xml
and txt formats.

For more information and use cases please refer to the documentation
provided at the beginning of the test.h file.

Review: https://reviewboard.asterisk.org/r/447/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236027 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-22 16:09:11 +00:00