PageRenderTime 24ms CodeModel.GetById 16ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/test/ttest.c

http://bdremote-ng.googlecode.com/
C | 92 lines | 36 code | 21 blank | 35 comment | 3 complexity | 4fd8edf9bb174a16b49ff9d681da7ea7 MD5 | raw file
 1/*
 2 *  bdremoteng - helper daemon for Sony(R) BD Remote Control
 3 *  Based on bdremoted, written by Anton Starikov <antst@mail.ru>.
 4 *
 5 *  Copyright (C) 2009  Michael Wojciechowski <wojci@wojci.dk>
 6 *
 7 *
 8 *  This program is free software; you can redistribute it and/or modify
 9 *  it under the terms of the GNU General Public License as published by
10 *  the Free Software Foundation; either version 2 of the License, or
11 *  (at your option) any later version.
12 *
13 *  This program is distributed in the hope that it will be useful,
14 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *  GNU General Public License for more details.
17 *
18 *  You should have received a copy of the GNU General Public License
19 *  along with this program; if not, write to the Free Software
20 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21 *
22 */
23
24/* The following was based on some pthread examples written by Andrae
25 * Muys.
26 */
27
28/** \ingroup Test
29 *  @{
30 */
31
32/*! \file ttest.c
33  \brief Test timers.
34
35  Test application which tests if simple timers behave as expected.
36*/
37
38#include <globaldefs.h>
39
40#include <stdio.h>
41#include <unistd.h>
42#include <stdlib.h>
43#include <string.h>
44
45#include <lirc_srv.h>
46
47unsigned int globalLogMask = 
48  MODULEMASK_LIRC_THR | MODULEMASK_LIRC_SOCK | 
49  MODULEMASK_LIRC_CB | MODULEMASK_BT_IF | MODULEMASK_BT_IMPL | 
50  MODULEMASK_QUEUE | MODULEMASK_SPARE | MODULEMASK_MAIN;
51
52
53static const unsigned int moduleMask = MODULEMASK_MAIN;
54
55int main(int argc, char *argv[])
56{
57  int i = 0;
58  keyState ks;
59
60  if (argc > 1)
61    {
62      printf("Arguments are not supported.\n");
63
64      for (i = 1; i < argc; i++)
65	{
66	  printf("Unhandled argument: %s.\n", argv[i]);
67	}
68      return -1;
69    }
70
71  initTime(&ks);
72
73  /* sleep(1); */
74  i = 0;
75  while (i < 50)
76    {
77      printf("Sleep #%d.\n", i);
78
79      usleep(10000);
80
81      updateTime(&ks);
82
83      printf("Elapsed ms: %lu\n.", ks.elapsed);
84
85      i++;
86    }
87
88  return 0;
89}
90
91/*\@}*/
92