t_sockaddr.c revision ec5347e2c775f027573ce5648b910361aa926c01
/*
* Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: t_sockaddr.c,v 1.13 2007/06/18 23:47:27 tbox Exp $ */
#include <config.h>
#include <isc/sockaddr.h>
static int
test_isc_sockaddr_eqaddrprefix(void) {
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_PASS;
}
static void
t1(void) {
int result;
"isc_sockaddr_eqaddrprefix() returns ISC_TRUE when "
"prefixes of a and b are equal, and ISC_FALSE when "
"they are not equal");
}
static int
test_isc_netaddr_masktoprefixlen(void) {
unsigned int plen;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
return T_FAIL;
if (plen != 0)
return T_FAIL;
return T_FAIL;
if (plen != 31)
return T_FAIL;
return T_FAIL;
if (plen != 32)
return T_FAIL;
return T_FAIL;
if (plen != 24)
return T_FAIL;
return T_PASS;
}
static void
t2(void) {
int result;
"isc_netaddr_masktoprefixlen() calculates "
"correct prefix lengths ");
}
testspec_t T_testlist[] = {
{ t1, "isc_sockaddr_eqaddrprefix" },
{ t2, "isc_netaddr_masktoprefixlen" },
};