test-socket-util.c revision 07630cea1f3a845c09309f197ac7c4f11edd3b62
/***
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 "async.h"
#include "in-addr-util.h"
#include "log.h"
#include "macro.h"
#include "socket-util.h"
#include "string-util.h"
#include "util.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_is_null(void) {
union in_addr_union i = {};
}
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 test_in_addr_to_string_one(int f, const char *addr) {
union in_addr_union ua;
_cleanup_free_ char *r = NULL;
}
static void test_in_addr_to_string(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 = {};
log_info_errno(r, "No connection remote: %m");
assert_se(r < 0);
/* find out the port number */
assert_se(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;
}