summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2005-11-20 10:58:43 +0000
committerBenny Prijono <bennylp@teluu.com>2005-11-20 10:58:43 +0000
commit66864977389a1a59bf7a5d38fcd62559190bb93e (patch)
treebf37612e7ddcd3f96caf169c77b06d2aa9e8d5d2
parentda8ba46b200bffdc9cb80e42902809b5ead7b0c5 (diff)
Renaming files
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@61 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/test-pjsip/main.c14
-rw-r--r--pjsip/src/test-pjsip/parse_msg.c (renamed from pjsip/src/test-pjsip/test_msg.c)0
-rw-r--r--pjsip/src/test-pjsip/parse_uri.c (renamed from pjsip/src/test-pjsip/test_uri.c)0
-rw-r--r--pjsip/src/test-pjsip/test.c65
-rw-r--r--pjsip/src/test-pjsip/test.h16
5 files changed, 78 insertions, 17 deletions
diff --git a/pjsip/src/test-pjsip/main.c b/pjsip/src/test-pjsip/main.c
index 621bac61..75b3792e 100644
--- a/pjsip/src/test-pjsip/main.c
+++ b/pjsip/src/test-pjsip/main.c
@@ -16,17 +16,3 @@
* 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 <stdio.h>
-
-int main()
-{
- test_uri();
- test_msg();
-
-#if !IS_PROFILING
- puts("Press <ENTER> to quit.");
- fgets( s, sizeof(s), stdin);
-#endif
- return 0;
-}
diff --git a/pjsip/src/test-pjsip/test_msg.c b/pjsip/src/test-pjsip/parse_msg.c
index 94ac25ce..94ac25ce 100644
--- a/pjsip/src/test-pjsip/test_msg.c
+++ b/pjsip/src/test-pjsip/parse_msg.c
diff --git a/pjsip/src/test-pjsip/test_uri.c b/pjsip/src/test-pjsip/parse_uri.c
index cfb3afd7..cfb3afd7 100644
--- a/pjsip/src/test-pjsip/test_uri.c
+++ b/pjsip/src/test-pjsip/parse_uri.c
diff --git a/pjsip/src/test-pjsip/test.c b/pjsip/src/test-pjsip/test.c
new file mode 100644
index 00000000..4a69b582
--- /dev/null
+++ b/pjsip/src/test-pjsip/test.c
@@ -0,0 +1,65 @@
+/* $Id$ */
+/*
+ * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * 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 <pjlib.h>
+#include <pjsip_core.h>
+
+#define DO_TEST(test) do { \
+ PJ_LOG(3, ("test", "Running %s...", #test)); \
+ rc = test; \
+ PJ_LOG(3, ("test", \
+ "%s(%d)", \
+ (rc ? "..ERROR" : "..success"), rc)); \
+ if (rc!=0) goto on_return; \
+ } while (0)
+
+
+
+pjsip_endpoint *endpt;
+
+void app_perror(const char *msg, pj_status_t rc)
+{
+ char errbuf[256];
+
+ PJ_CHECK_STACK();
+
+ pjsip_strerror(rc, errbuf, sizeof(errbuf));
+ PJ_LOG(1,("test", "%s: [pj_status_t=%d] %s", msg, rc, errbuf));
+
+}
+
+
+
+int main()
+{
+ pj_status_t rc;
+
+ if ((rc=pj_init()) != PJ_SUCCESS) {
+ app_perror("pj_init", rc);
+ }
+
+ DO_TEST(parse_uri());
+ DO_TEST(parse_msg());
+
+on_return:
+ return 0;
+}
+
diff --git a/pjsip/src/test-pjsip/test.h b/pjsip/src/test-pjsip/test.h
index d5f84031..225c8be7 100644
--- a/pjsip/src/test-pjsip/test.h
+++ b/pjsip/src/test-pjsip/test.h
@@ -16,11 +16,21 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <pj/types.h>
+#ifndef __TEST_H__
+#define __TEST_H__
-pj_status_t test_uri(void);
-pj_status_t test_msg(void);
+#include <pjsip/sip_types.h>
#define SILENT 1
#define IS_PROFILING 1
#define LOOP 2000
+
+extern pjsip_endpoint *endpt;
+
+pj_status_t parse_uri(void);
+pj_status_t parse_msg(void);
+
+void app_perror(const char *msg, pj_status_t status);
+
+
+#endif /* __TEST_H__ */