summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-08-15 10:05:36 +0000
committerBenny Prijono <bennylp@teluu.com>2009-08-15 10:05:36 +0000
commit62085bfb4fe4e6f5ca95f414d96714c2f8714355 (patch)
treea20cf70d86ba9e61bf9f79a3945e258645ca93ef
parent05b080f7b17a9efbf1bc1a77397865cb97c5db21 (diff)
Ticket #944: misc fixes in pjmedia_test:
- Assertion in pjmedia tests's MIPS test with iLBC codec due to ptime mismatch - added compile time macro in test.h to enable/disable specific tests - also added SVN keyword expansion attributes to the source files git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2882 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjmedia/src/test/mips_test.c5
-rw-r--r--pjmedia/src/test/test.c8
-rw-r--r--pjmedia/src/test/test.h4
3 files changed, 17 insertions, 0 deletions
diff --git a/pjmedia/src/test/mips_test.c b/pjmedia/src/test/mips_test.c
index dfde5fb4..86797e0b 100644
--- a/pjmedia/src/test/mips_test.c
+++ b/pjmedia/src/test/mips_test.c
@@ -387,6 +387,7 @@ struct test_entry
const char *title;
unsigned valid_op;
unsigned valid_clock_rate;
+
pjmedia_port* (*init)(pj_pool_t *pool,
unsigned clock_rate,
unsigned channel_count,
@@ -833,6 +834,7 @@ static pjmedia_port* ilbc_encode_decode( pj_pool_t *pool,
unsigned flags,
struct test_entry *te)
{
+ samples_per_frame = 30 * clock_rate / 1000;
return codec_encode_decode(pool, "ilbc", &ilbc_init,
&pjmedia_codec_ilbc_deinit, clock_rate,
channel_count, samples_per_frame, flags, te);
@@ -2216,6 +2218,9 @@ static pj_timestamp run_entry(unsigned clock_rate, struct test_entry *e)
return t0;
}
+ /* Port may decide to use different ptime (e.g. iLBC) */
+ samples_per_frame = port->info.samples_per_frame;
+
gen_port = create_gen_port(pool, clock_rate, 1,
samples_per_frame, 100);
if (gen_port == NULL) {
diff --git a/pjmedia/src/test/test.c b/pjmedia/src/test/test.c
index d5bfd4e8..385eee15 100644
--- a/pjmedia/src/test/test.c
+++ b/pjmedia/src/test/test.c
@@ -56,13 +56,21 @@ int test_main(void)
mem = &caching_pool.factory;
+#if HAS_SDP_NEG_TEST
DO_TEST(sdp_neg_test());
+#endif
//DO_TEST(sdp_test (&caching_pool.factory));
//DO_TEST(rtp_test(&caching_pool.factory));
//DO_TEST(session_test (&caching_pool.factory));
+#if HAS_JBUF_TEST
DO_TEST(jbuf_main());
+#endif
+#if HAS_MIPS_TEST
DO_TEST(mips_test());
+#endif
+#if HAS_CODEC_VECTOR_TEST
DO_TEST(codec_test_vectors());
+#endif
PJ_LOG(3,(THIS_FILE," "));
diff --git a/pjmedia/src/test/test.h b/pjmedia/src/test/test.h
index 267be12e..96dc9d54 100644
--- a/pjmedia/src/test/test.h
+++ b/pjmedia/src/test/test.h
@@ -23,6 +23,10 @@
#include <pjmedia.h>
#include <pjlib.h>
+#define HAS_SDP_NEG_TEST 1
+#define HAS_JBUF_TEST 1
+#define HAS_MIPS_TEST 1
+#define HAS_CODEC_VECTOR_TEST 1
int session_test(void);
int rtp_test(void);