summaryrefslogtreecommitdiff
path: root/pjsip/src/test-pjsip/msg_err_test.c
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2009-04-22 14:27:55 +0000
committerNanang Izzuddin <nanang@teluu.com>2009-04-22 14:27:55 +0000
commitd593d23d9acec3467625480a8a027babacec3618 (patch)
tree430e074ddb4323da5536ec081d56adbd99563241 /pjsip/src/test-pjsip/msg_err_test.c
parente9770fb6f2b66e939984b8887137d28b24b25799 (diff)
Ticket #706: Merged branch vs-reorg into trunk:
- Currently supported platforms are Win32 & WM6 std/pro. - Renamed project test_pjsip with pjsip_test, also source directory 'test-pjsip' to 'test'. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2638 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/test-pjsip/msg_err_test.c')
-rw-r--r--pjsip/src/test-pjsip/msg_err_test.c101
1 files changed, 0 insertions, 101 deletions
diff --git a/pjsip/src/test-pjsip/msg_err_test.c b/pjsip/src/test-pjsip/msg_err_test.c
deleted file mode 100644
index 46d28f15..00000000
--- a/pjsip/src/test-pjsip/msg_err_test.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
- * Copyright (C) 2003-2008 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 <pjsip.h>
-#include <pjlib.h>
-
-#define THIS_FILE "msg_err_test.c"
-
-
-static pj_bool_t verify_success(pjsip_msg *msg,
- pjsip_parser_err_report *err_list)
-{
- return PJ_TRUE;
-}
-
-static struct test_entry
-{
- char msg[1024];
- pj_bool_t (*verify)(pjsip_msg *msg,
- pjsip_parser_err_report *err_list);
-
-} test_entries[] =
-{
- /* Syntax error in status line */
- {
- "SIP/2.0 200\r\n"
- "H-Name: H-Value\r\n"
- "\r\n",
- &verify_success
- },
-
- /* Syntax error in header */
- {
- "SIP/2.0 200 OK\r\n"
- "Via: SIP/2.0\r\n"
- "H-Name: H-Value\r\n"
- "\r\n",
- &verify_success
- },
-
- /* Multiple syntax errors in headers */
- {
- "SIP/2.0 200 OK\r\n"
- "Via: SIP/2.0\r\n"
- "H-Name: H-Value\r\n"
- "Via: SIP/2.0\r\n"
- "\r\n",
- &verify_success
- }
-};
-
-
-int msg_err_test(void)
-{
- pj_pool_t *pool;
- unsigned i;
-
- PJ_LOG(3,(THIS_FILE, "Testing parsing error"));
-
- pool = pjsip_endpt_create_pool(endpt, "msgerrtest", 4000, 4000);
-
- for (i=0; i<PJ_ARRAY_SIZE(test_entries); ++i) {
- pjsip_parser_err_report err_list, *e;
- pjsip_msg *msg;
-
- PJ_LOG(3,(THIS_FILE, " Parsing msg %d", i));
- pj_list_init(&err_list);
- msg = pjsip_parse_msg(pool, test_entries[i].msg,
- strlen(test_entries[i].msg), &err_list);
-
- e = err_list.next;
- while (e != &err_list) {
- PJ_LOG(3,(THIS_FILE,
- " reported syntax error at line %d col %d for %.*s",
- e->line, e->col,
- (int)e->hname.slen,
- e->hname.ptr));
- e = e->next;
- }
- }
-
- pj_pool_release(pool);
- return 0;
-}