Module: kamailio
Branch: master
Commit: 6774d7abf93bf8631c5bb498dc5158b9fbff247d
URL: https://github.com/kamailio/kamailio/commit/6774d7abf93bf8631c5bb498dc5158b…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)edvina.net>
Date: 2016-06-03T21:27:26+02:00
test Adding documentation on module test
At this point this is just ideas and a proposal. Let's test it. Includes ideas on
variant of the abort() function in cfg_utils
---
Added: test/README.md
---
Diff: https://github.com/kamailio/kamailio/commit/6774d7abf93bf8631c5bb498dc5158b…
Patch: https://github.com/kamailio/kamailio/commit/6774d7abf93bf8631c5bb498dc5158b…
---
diff --git a/test/README.md b/test/README.md
new file mode 100644
index 0000000..0547475
--- /dev/null
+++ b/test/README.md
@@ -0,0 +1,26 @@
+Test directory
+===============
+
+Modules
+-------
+Note: Under development (2016-06-03 OEJ)
+
+Modules found here test APIs in other modules or are just created for testing, not for production
+use. In order to use the existing build system, each module needs a directory named mod_something
+in test.
+
+Each module needs a subdirectory called "test" with a test configuration and a Makefile.
+
+A typical test script load the htable module and execute tests in the [event:htable_init]
+event route when starting. Typically, if a test fails, it runs abort() from the cfg_utils
+module to abort the process.
+
+
+Ideas: We may need a way to exit kamailio from inside without dumping a core file, but simply
+stopping execution and returning different return values to the shell. That way a test
+config can run for a limited amount of time or until a test fails. We can also
+stop on an external action, like a RPC request calling the same function.
+
+Targets:
+ - "test": Test syntax with "kamailio -c"
+ - "all": Run full test
The column name is currently not free'd. Some db bankends copy this
data so that memory is leaked. Some store internal database pointers
and those shouldn't be free'd. One returns a pointer to a stack
variable which shouldn't be done.
The patch cleans up all db backends to copy the column name and frees
that column name as part of the database result cleanup function.
Author: Chris Double <doublec(a)silentcircle.com>
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/611
-- Commit Summary --
* Free database column name as part of database result cleanup
-- File Changes --
M lib/srdb1/db_res.c (3)
M modules/db_berkeley/km_bdb_res.c (9)
M modules/db_mongodb/mongodb_dbase.c (9)
M modules/db_mysql/km_res.c (9)
M modules/db_postgres/km_res.c (10)
M modules/db_text/dbt_api.c (9)
M modules/db_unixodbc/res.c (8)
M modules/xmlrpc/xmlrpc.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/611.patchhttps://github.com/kamailio/kamailio/pull/611.diff
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/611
```
CC (clang) [M db_berkeley.so] km_db_berkeley.o
km_db_berkeley.c:486:58: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if ((ret = bdb_get_columns(_tbc->dtp, *_r, lres, _nc)) < 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
km_db_berkeley.c:513:50: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if ((ret=bdb_append_row( *_r, dbuf, lres, i)) < 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
km_db_berkeley.c:567:58: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if ((ret = bdb_get_columns(_tbc->dtp, *_r, lres, _nc)) < 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
km_db_berkeley.c:572:47: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if ((ret=bdb_convert_row( *_r, dbuf, lres)) < 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
4 warnings generated.
```
```
CC (clang) [M auth_radius.so] authorize.o
authorize.c:110:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion]
ret = AUTH_NONCE_REUSED;
~ ^~~~~~~~~~~~~~~~~
authorize.c:114:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion]
ret = AUTH_STALE_NONCE;
~ ^~~~~~~~~~~~~~~~
authorize.c:120:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion]
ret = AUTH_ERROR;
~ ^~~~~~~~~~
authorize.c:124:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion]
ret = AUTH_NO_CREDENTIALS;
~ ^~~~~~~~~~~~~~~~~~~
authorize.c:131:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion]
ret = AUTH_OK;
~ ^~~~~~~
authorize.c:148:9: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion]
ret = AUTH_ERROR;
~ ^~~~~~~~~~
authorize.c:153:12: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion]
ret = AUTH_ERROR;
~ ^~~~~~~~~~
authorize.c:159:12: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion]
ret = AUTH_ERROR;;
~ ^~~~~~~~~~
authorize.c:186:12: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion]
ret = AUTH_ERROR;
~ ^~~~~~~~~~
authorize.c:189:12: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion]
ret = AUTH_OK;
~ ^~~~~~~
authorize.c:193:8: warning: implicit conversion from enumeration type 'enum auth_cfg_result' to different enumeration type 'auth_result_t' (aka 'enum auth_result') [-Wenum-conversion]
ret = AUTH_INVALID_PASSWORD;
~ ^~~~~~~~~~~~~~~~~~~~~
11 warnings generated.
```
```
CC (clang) [M misc_radius.so] functions.o
functions.c:47:27: warning: comparison of array 'vp->strvalue' equal to a null pointer is always false [-Wtautological-pointer-compare]
if (vp->lvalue==0 || vp->strvalue==0)
~~~~^~~~~~~~ ~
1 warning generated.
```
```
CC (clang) [M peering.so] verify.o
verify.c:58:30: warning: comparison of array 'vp->strvalue' equal to a null pointer is always false [-Wtautological-pointer-compare]
if (vp->lvalue==0 || vp->strvalue==0)
~~~~^~~~~~~~ ~
1 warning generated.
```
```
CC (clang) [M pua_xmpp.so] xmpp2simple.o
xmpp2simple.c:372:10: warning: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Wnon-literal-null-conversion]
slash= '\0';
^~~~
1 warning generated.
```
```
CC (clang) [M db2_ldap.so] ld_fld.o
ld_fld.c:831:19: warning: unused function 'db_double2ldap_str' [-Wunused-function]
static inline int db_double2ldap_str(struct sbuf* buf, db_fld_t* fld)
^
```
```
CC (clang) [M xmpp.so] xmpp_server.o
In file included from xmpp_server.c:96:
./xode.h:75:9: warning: 'snprintf' macro redefined [-Wmacro-redefined]
#define snprintf ap_snprintf
^
/usr/include/x86_64-linux-gnu/bits/stdio2.h:68:11: note: previous definition is here
# define snprintf(str, len, ...) \
^
1 warning generated.
```
```
CC (clang) [M xmpp.so] xpool.o
In file included from xpool.c:41:
./xode.h:75:9: warning: 'snprintf' macro redefined [-Wmacro-redefined]
#define snprintf ap_snprintf
^
/usr/include/x86_64-linux-gnu/bits/stdio2.h:68:11: note: previous definition is here
# define snprintf(str, len, ...) \
^
1 warning generated.
```
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/653