/* $Id$ */ /* * Copyright (C) 2003-2006 Benny Prijono * * 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 #include #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; }