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 57 : static ElektraIoInterface * createBinding (void)
22 : {
23 57 : return elektraIoEvNew (EV_DEFAULT);
24 : }
25 :
26 45 : static void startLoop (void)
27 : {
28 45 : ev_run (EV_DEFAULT, 0);
29 45 : }
30 :
31 45 : static void stopLoop (void)
32 : {
33 45 : ev_break (EV_DEFAULT, EVBREAK_ONE);
34 45 : }
35 :
36 3 : int main (int argc, char ** argv)
37 : {
38 3 : init (argc, argv);
39 :
40 3 : elektraIoTestSuite (createBinding, startLoop, stopLoop);
41 :
42 9 : print_result ("iowrapper_ev");
43 :
44 3 : ev_loop_destroy (EV_DEFAULT);
45 :
46 3 : return nbError;
47 : }
|