test-socket-util.c revision 43dc004336ae0c99cac45df20e32dc7aa2e7cd0c
/***
This file is part of systemd
Copyright 2014 Ronny Chevalier
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "socket-util.h"
#include "in-addr-util.h"
#include "util.h"
#include "macro.h"
#include "log.h"
#include "async.h"
static void test_socket_address_parse(void) {
if (socket_ipv6_is_supported()) {
} else {
}
}
static void test_socket_address_parse_netlink(void) {
}
static void test_socket_address_equal(void) {
assert_se(!socket_address_equal(&a, &b));
assert_se(!socket_address_equal(&a, &b));
assert_se(!socket_address_equal(&a, &b));
assert_se(!socket_address_equal(&a, &b));
assert_se(socket_address_equal(&a, &b));
assert_se(socket_address_equal(&a, &b));
assert_se(socket_address_equal(&a, &b));
assert_se(socket_address_equal(&a, &b));
assert_se(socket_address_equal(&a, &b));
}
static void test_socket_address_get_path(void) {
assert_se(!socket_address_get_path(&a));
assert_se(!socket_address_get_path(&a));
assert_se(!socket_address_get_path(&a));
}
static void test_socket_address_is(void) {
}
static void test_socket_address_is_netlink(void) {
}
static void test_in_addr_prefix_intersect_one(unsigned f, const char *a, unsigned apl, const char *b, unsigned bpl, int result) {
}
static void test_in_addr_prefix_intersect(void) {
test_in_addr_prefix_intersect_one(AF_INET6, "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", 128, "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe", 128, 0);
test_in_addr_prefix_intersect_one(AF_INET6, "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", 0, "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", 128, 1);
test_in_addr_prefix_intersect_one(AF_INET6, "::", 0, "beef:beef:beef:beef:beef:beef:beef:beef", 128, 1);
}
static void test_in_addr_prefix_next_one(unsigned f, const char *before, unsigned pl, const char *after) {
t = ubefore;
if (after) {
}
}
static void test_in_addr_prefix_next(void) {
}
static void *connect_thread(void *arg) {
return NULL;
}
static void test_nameinfo_pretty(void) {
union sockaddr_union s = {
};
int r;
union sockaddr_union c = {};
assert_se(r < 0);
/* find out the port number */
assert(r == 0);
}
static void test_sockaddr_equal(void) {
union sockaddr_union a = {
};
union sockaddr_union b = {
};
union sockaddr_union c = {
};
union sockaddr_union d = {
};
assert_se(sockaddr_equal(&a, &a));
assert_se(sockaddr_equal(&a, &b));
assert_se(sockaddr_equal(&d, &d));
assert_se(!sockaddr_equal(&a, &c));
assert_se(!sockaddr_equal(&b, &c));
}
return 0;
}