Line data Source code
1 : /**
2 : * @file
3 : *
4 : * @brief Tests for I/O UV binding.
5 : *
6 : * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
7 : *
8 : */
9 :
10 : #include <stdio.h>
11 : #include <stdlib.h>
12 :
13 : #include <kdbio.h>
14 : #include <kdbiotest.h>
15 : #include <tests.h>
16 :
17 : #include <ev.h>
18 :
19 : #include <kdbio/ev.h>
20 :
21 38 : static ElektraIoInterface * createBinding (void)
22 : {
23 38 : return elektraIoEvNew (EV_DEFAULT);
24 : }
25 :
26 30 : static void startLoop (void)
27 : {
28 30 : ev_run (EV_DEFAULT, 0);
29 30 : }
30 :
31 30 : static void stopLoop (void)
32 : {
33 30 : ev_break (EV_DEFAULT, EVBREAK_ONE);
34 30 : }
35 :
36 2 : int main (int argc, char ** argv)
37 : {
38 2 : init (argc, argv);
39 :
40 2 : elektraIoTestSuite (createBinding, startLoop, stopLoop);
41 :
42 2 : print_result ("iowrapper_ev");
43 :
44 2 : ev_loop_destroy (EV_DEFAULT);
45 :
46 2 : return nbError;
47 : }
|