diff options
author | Benny Prijono <bennylp@teluu.com> | 2011-02-28 22:19:23 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2011-02-28 22:19:23 +0000 |
commit | 7506dc2e5de7c417ec9835bf95a29e442fa0ed37 (patch) | |
tree | 581d81ed044c2a9a2e3bdedcf2b81fc761a494f3 /pjlib/src/pjlib-test | |
parent | becc875a5dafe43a6067b6fb5e0c953c582fad48 (diff) |
Re #1202 (pjlib sysinfo): testing on OpenSolaris and added pjlib-test entry
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3426 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pjlib-test')
-rw-r--r-- | pjlib/src/pjlib-test/os.c | 24 | ||||
-rw-r--r-- | pjlib/src/pjlib-test/test.c | 4 | ||||
-rw-r--r-- | pjlib/src/pjlib-test/test.h | 2 |
3 files changed, 30 insertions, 0 deletions
diff --git a/pjlib/src/pjlib-test/os.c b/pjlib/src/pjlib-test/os.c index e82ac244..2a28b928 100644 --- a/pjlib/src/pjlib-test/os.c +++ b/pjlib/src/pjlib-test/os.c @@ -17,4 +17,28 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "test.h" +#include <pj/log.h> +#include <pj/os.h> + +#if INCLUDE_OS_TEST +int os_test(void) +{ + const pj_sys_info *si; + int rc = 0; + + si = pj_get_sys_info(); + PJ_LOG(3,("", " machine: %s", si->machine.ptr)); + PJ_LOG(3,("", " os_name: %s", si->os_name.ptr)); + PJ_LOG(3,("", " os_ver: 0x%x", si->os_ver)); + PJ_LOG(3,("", " sdk_name: %s", si->sdk_name.ptr)); + PJ_LOG(3,("", " sdk_ver: 0x%x", si->sdk_ver)); + PJ_LOG(3,("", " info: %s", si->info.ptr)); + + return rc; +} + +#else int dummy_os_var; +#endif + diff --git a/pjlib/src/pjlib-test/test.c b/pjlib/src/pjlib-test/test.c index 9d7c1ba4..7983284b 100644 --- a/pjlib/src/pjlib-test/test.c +++ b/pjlib/src/pjlib-test/test.c @@ -75,6 +75,10 @@ int test_inner(void) DO_TEST( exception_test() ); #endif +#if INCLUDE_OS_TEST + DO_TEST( os_test() ); +#endif + #if INCLUDE_RAND_TEST DO_TEST( rand_test() ); #endif diff --git a/pjlib/src/pjlib-test/test.h b/pjlib/src/pjlib-test/test.h index 2d65d15d..d33a9ba7 100644 --- a/pjlib/src/pjlib-test/test.h +++ b/pjlib/src/pjlib-test/test.h @@ -47,6 +47,7 @@ #define INCLUDE_ATOMIC_TEST GROUP_OS #define INCLUDE_MUTEX_TEST (PJ_HAS_THREADS && GROUP_OS) #define INCLUDE_SLEEP_TEST GROUP_OS +#define INCLUDE_OS_TEST GROUP_OS #define INCLUDE_THREAD_TEST (PJ_HAS_THREADS && GROUP_OS) #define INCLUDE_SOCK_TEST GROUP_NETWORK #define INCLUDE_SOCK_PERF_TEST GROUP_NETWORK @@ -78,6 +79,7 @@ extern int exception_test(void); extern int rand_test(void); extern int list_test(void); extern int hash_test(void); +extern int os_test(void); extern int pool_test(void); extern int pool_perf_test(void); extern int string_test(void); |