~ubuntu-branches/debian/sid/sflphone/sid

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.0.1/pjmedia/src/test/wince_main.c

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-06-02 18:04:11 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130602180411-3rcpy8c1zdlo8y0s
Tags: 1.2.2-1
* New upstream release
* changeset_rb68857a4b485b7d43f92714cd5792595ff895f82.diff - fix QTest
* pjproject ./configure --disable-sound --disable-video

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: wince_main.c 3553 2011-05-05 06:14:19Z nanang $ */
 
2
/*
 
3
 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
 
4
 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 */
 
20
#include "test.h"
 
21
#include <windows.h>
 
22
#include <stdio.h>
 
23
 
 
24
#define TITLE   "PJMEDIA Test"
 
25
#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"
 
26
 
 
27
static FILE *fLog;
 
28
 
 
29
static void log_writer_cb(int level, const char *data, int len)
 
30
{
 
31
    PJ_UNUSED_ARG(level);
 
32
 
 
33
    fwrite(data, len, 1, fLog);
 
34
}
 
35
 
 
36
 
 
37
int WINAPI WinMain(HINSTANCE hInstance,
 
38
                   HINSTANCE hPrevInstance,
 
39
                   LPTSTR    lpCmdLine,
 
40
                   int       nCmdShow)
 
41
{
 
42
    int rc;
 
43
 
 
44
    PJ_UNUSED_ARG(hInstance);
 
45
    PJ_UNUSED_ARG(hPrevInstance);
 
46
    PJ_UNUSED_ARG(lpCmdLine);
 
47
    PJ_UNUSED_ARG(nCmdShow);
 
48
 
 
49
    rc = MessageBox(0, TEXT(CAPTION), TEXT(TITLE), MB_OKCANCEL);
 
50
    if (rc != IDOK)
 
51
        return TRUE;
 
52
 
 
53
    fLog = fopen("\\pjmedia-test.txt", "wt");
 
54
    if (fLog == NULL) {
 
55
        MessageBox(0, TEXT("Unable to create result file"), TEXT(TITLE), MB_OK);
 
56
        return TRUE;
 
57
    }
 
58
    pj_log_set_log_func(&log_writer_cb);
 
59
    rc = test_main();
 
60
 
 
61
    fclose(fLog);
 
62
 
 
63
    if (rc != 0) {
 
64
        MessageBox(0, TEXT("Test failed"), TEXT(TITLE), MB_OK);
 
65
        return TRUE;
 
66
    }
 
67
 
 
68
    MessageBox(0, TEXT("Test has been successful. Please see the result in \"\\pjmedia-test.txt\" file"),
 
69
                  TEXT(TITLE), 0);
 
70
    return TRUE;
 
71
}