summaryrefslogtreecommitdiff
path: root/pjmedia/src/test/wince_main.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-07-05 11:53:45 +0000
committerBenny Prijono <bennylp@teluu.com>2008-07-05 11:53:45 +0000
commit554f21469fe790bf6b658082bba819ca294618e5 (patch)
tree75ccdaaad070cc720b25998524a6563dd0de9001 /pjmedia/src/test/wince_main.c
parentf7ab60344d90c41c7558f6c956c2a67e24928209 (diff)
Added WinCE project for pjmedia_test
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2105 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src/test/wince_main.c')
-rw-r--r--pjmedia/src/test/wince_main.c64
1 files changed, 64 insertions, 0 deletions
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 <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 <windows.h>
+#include <stdio.h>
+#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;
+}
+