From 554f21469fe790bf6b658082bba819ca294618e5 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sat, 5 Jul 2008 11:53:45 +0000 Subject: Added WinCE project for pjmedia_test git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2105 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/test/wince_main.c | 64 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 pjmedia/src/test/wince_main.c (limited to 'pjmedia/src/test/wince_main.c') diff --git a/pjmedia/src/test/wince_main.c b/pjmedia/src/test/wince_main.c new file mode 100644 index 00000000..99adf799 --- /dev/null +++ b/pjmedia/src/test/wince_main.c @@ -0,0 +1,64 @@ +/* $Id:$ */ +/* + * Copyright (C)2003-2008 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 +#include +#include "test.h" + +#define TITLE "PJMEDIA Test" +#define CAPTION "This will start pjmedia test. Please do not use the PDA while the test is in progress. The test may take couple of minutes to complete, and you will be notified again when it completes" + +static FILE *fLog; + +static void log_writer_cb(int level, const char *data, int len) +{ + fwrite(data, len, 1, fLog); +} + + +int WINAPI WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + int rc; + + rc = MessageBox(0, TEXT(CAPTION), TEXT(TITLE), MB_OKCANCEL); + if (rc != IDOK) + return TRUE; + + fLog = fopen("\\pjmedia-test.txt", "wt"); + if (fLog == NULL) { + MessageBox(0, TEXT("Unable to create result file"), TEXT(TITLE), MB_OK); + return TRUE; + } + pj_log_set_log_func(&log_writer_cb); + rc = test_main(); + + fclose(fLog); + + if (rc != 0) { + MessageBox(0, TEXT("Test failed"), TEXT(TITLE), MB_OK); + return TRUE; + } + + MessageBox(0, TEXT("Test has been successful. Please see the result in \"\\pjmedia-test.txt\" file"), + TEXT(TITLE), 0); + return TRUE; +} + -- cgit v1.2.3