tizen 2.3 release
[external/buxton.git] / test / check_utils.c
1 /*
2  * This file is part of buxton.
3  *
4  * Copyright (C) 2013 Intel Corporation
5  *
6  * buxton is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as
8  * published by the Free Software Foundation; either version 2.1
9  * of the License, or (at your option) any later version.
10  */
11
12 #include <check.h>
13 #include <sys/socket.h>
14
15 #include "check_utils.h"
16
17 void setup_socket_pair(int *client, int *server)
18 {
19         int socks[2];
20         fail_if(socketpair(AF_UNIX, SOCK_STREAM, 0, socks),
21                 "socketpair: %m");
22
23         *client = socks[0];
24         *server = socks[1];
25 }
26
27 /*
28  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
29  *
30  * Local variables:
31  * c-basic-offset: 8
32  * tab-width: 8
33  * indent-tabs-mode: t
34  * End:
35  *
36  * vi: set shiftwidth=8 tabstop=8 noexpandtab:
37  * :indentSize=8:tabSize=8:noTabs=false:
38  */