the tests haven't been loved as we've been killing warnings. clean up.
Change-Id: I9c36114d3172c4a6347f5e890df6edb5caf796b4
Reviewed-on: http://gerrit.openafs.org/7232
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
tools platform kopenafs authtools $(DIR_roken)
+${COMPILE_PART1} finale ${COMPILE_PART2}
+rpctestlib: util fsint rx opr libafsrpc libafsauthent
+ +${TEST_PART1} rpctestlib ${COMPILE_PART2}
+
check test: finale
cd tests && $(MAKE) check
#include <rx/rxkad.h>
#include <rx/rx_identity.h>
+#include <hcrypto/des.h>
#include <tests/tap/basic.h>
#include "test.h"
main(int argc, char **argv)
{
plan(11);
- uint32_t test[] = {3526055646, 2064483663, 3234460805, 3963629775};
+ uint32_t test[] = {3526055646UL, 2064483663UL, 3234460805UL, 3963629775UL};
is_int(256, opr_jhash_size(8), "opr_jhash_size returns expected value");
is_int(255, opr_jhash_mask(8), "opr_jhash_mask returns expected value");
is_int(0xdeadbeef, opr_jhash(test, 0, 0), "empty array hashes as expected");
is_int(766530906, opr_jhash(test, 4, 0), "simple array works");
- is_int(3782684773, opr_jhash(test, 4, 1), "changing initval works");
+ is_int(3782684773UL, opr_jhash(test, 4, 1), "changing initval works");
test[2]++;
is_int(1977082159, opr_jhash(test, 4, 0), "modifying value works");
include @TOP_OBJDIR@/src/config/Makefile.config
include @TOP_OBJDIR@/src/config/Makefile.pthread
-
RTL=@TOP_OBJDIR@/tests/rpctestlib
-RX=@TOP_OBJDIR@/src/rx
+RX = ${srcdir}/../../src/rx
VICED=@TOP_OBJDIR@/src/viced
UTIL=@TOP_OBJDIR@/src/util
FSINT=@TOP_OBJDIR@/src/fsint
LIBOBJS= ${RTLOBJS} ${FSINTOBJS} ${RXOBJS}
-LIBS=${TOP_LIBDIR}/libafsauthent.a ${TOP_LIBDIR}/libafsrpc.a ${TOP_LIBDIR}/util.a
+LIBS=${TOP_LIBDIR}/libafsauthent.a ${TOP_LIBDIR}/libafsrpc.a ${TOP_LIBDIR}/libopr.a ${TOP_LIBDIR}/util.a
all: xmpl_driver
CFLAGS_rx_pthread.o = -DDPF_FSLOG
rx_pthread.o: ${RX}/rx_pthread.c
+ $(AFS_CCRULE) $(RX)/rx_pthread.c
rpc_test_main.o: ${RTL}/rpc_test_main.c ${headers}
rpc_test_procs.o: ${RTL}/rpc_test_procs.c ${headers}
CFLAGS_afsaux.o = -I{FSINT}
afsaux.o: ${FSINT}/afsaux.c
+ $(AFS_CCRULE) ${FSINT}/afsaux.c
afscbint.ss.o: ${FSINT}/afscbint.ss.c
+ $(AFS_CCRULE) ${FSINT}/afscbint.ss.c
afsint.cs.o: ${FSINT}/afsint.cs.c
+ $(AFS_CCRULE) ${FSINT}/afsint.cs.c
afsint.ss.o: ${FSINT}/afsint.ss.c
+ $(AFS_CCRULE) ${FSINT}/afsint.ss.c
afsint.xdr.o: ${FSINT}/afsint.xdr.c
+ $(AFS_CCRULE) ${FSINT}/afsint.xdr.c
afscbint.xdr.o: ${FSINT}/afscbint.xdr.c
+ $(AFS_CCRULE) ${FSINT}/afscbint.xdr.c
xmpl_driver: librpc_test_lib.a rpc_test_main.o ${LIBS}
$(AFS_LDRULE) rpc_test_main.o librpc_test_lib.a \
- ${LIBS} ${MT_LIBS} ${XLIBS}
+ ${LIBS} $(LIB_hcrypto) $(LIB_roken) ${MT_LIBS} ${XLIBS}
librpc_test_lib.a: ${LIBOBJS}
$(RM) -f $@
#endif
#ifdef AFS_DARWIN_ENV
#include <sys/malloc.h>
-#else
-#include <malloc.h>
#endif
#include <afs/errors.h>
#include <afs/sys_prototypes.h>
SRXAFSCB_TellMeAboutYourself(struct rx_call *a_call, struct interfaceAddr *
addr, Capabilities *capabilities)
{
- afs_int32 code;
rpc_test_request_ctx *ctx = CTX_FOR_RXCALL(a_call);
printf("%s: SRXAFSCB_TellMeAboutYourself: enter (%s)\n", prog,
#endif
#ifdef AFS_DARWIN_ENV
#include <sys/malloc.h>
-#else
-#include <malloc.h>
#endif
#include <afs/errors.h>
#include <afs/sys_prototypes.h>
#include "rpc_test_procs.h"
-#include <stdio.h>
-#include <sys/types.h>
-#include <string.h>
-
-#ifdef AFS_NT40_ENV
-#else
-#include <sys/param.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#endif
-
-#include <string.h>
-#include <fcntl.h>
#ifdef AFS_NT40_ENV
-#include <io.h>
#include <windows.h>
#include <WINNT/afsevent.h>
#else
-#include <pwd.h>
+#include <sys/file.h>
#include <afs/venus.h>
#include <sys/time.h>
-#include <netdb.h>
#endif
#include <afs/afsint.h>
#define FSINT_COMMON_XG 1
-#include <sys/stat.h>
-#include <errno.h>
-#include <signal.h>
#include <afs/vice.h>
#include <afs/cmd.h>
#include <afs/auth.h>
#include <afs/cellconfig.h>
#include <afs/com_err.h>
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#endif
#ifdef HAVE_DIRECT_H
#include <direct.h>
#endif
-#ifdef AFS_DARWIN_ENV
-#include <sys/malloc.h>
-#else
-#include <malloc.h>
-#endif
#include <afs/errors.h>
#include <afs/sys_prototypes.h>
#include <rx/rx_prototypes.h>
} rpc_test_pkg_params;
static rpc_test_pkg_params rpc_test_params;
-afs_int32 rpc_test_PkgInit()
+afs_int32 rpc_test_PkgInit(void)
{
afs_int32 code = 0;
static afs_uint32 rpc_test_initialized = 0; /* once */
if (!rpc_test_initialized) {
rpc_test_initialized = 1;
} else {
- printf("%s: rpc_test_PkgInit: package already initialized\n");
+ printf("%s: rpc_test_PkgInit: package already initialized\n", prog);
exit(1);
}
{
struct rx_securityClass *sc;
struct rx_service *svc;
- afs_int32 code = 0;
rpc_test_request_ctx *ctx = (rpc_test_request_ctx *) arg;
rx_StartServer(1);
- printf("%s: init_callback_service_lwp: finished");
+ printf("%s: init_callback_service_lwp: finished", prog);
return (NULL);
char *listen_addr_s, char *prefix, char *fs_addr_s,
afs_uint32 flags)
{
- char cmd[512];
rpc_test_request_ctx *ctx;
afs_int32 code = 0;
#ifdef AFS_NT40_ENV
/* afscbint (server) */
sprintf(ctx->cb_svc_name, "cb_%d", ctx->cno);
- sprintf(ctx->cb_if_s, cb_if);
- sprintf(ctx->cb_listen_addr_s, listen_addr_s);
- sprintf(ctx->cb_prefix_s, prefix);
- sprintf(ctx->fs_addr_s, fs_addr_s);
+ sprintf(ctx->cb_if_s, "%s", cb_if);
+ sprintf(ctx->cb_listen_addr_s, "%s", listen_addr_s);
+ sprintf(ctx->cb_prefix_s, "%s", prefix);
+ sprintf(ctx->fs_addr_s, "%s", fs_addr_s);
#if defined(RPC_TEST_ADD_ADDRESSES)
#if defined(AFS_LINUX26_ENV)
/* unlock this */
pthread_mutex_unlock(&ctx->mtx);
-out:
return (code);
} /* init_fs_channel */
rpc_test_afs_fetch_status(rpc_test_request_ctx *ctx, AFSFid *fid,
AFSFetchStatus *outstatus)
{
- struct rx_call *tcall;
struct AFSVolSync tsync;
struct AFSCallBack tcb;
afs_int32 code = 0;
rpc_test_afs_store_status(rpc_test_request_ctx *ctx, AFSFid *fid,
AFSStoreStatus *instatus, AFSFetchStatus *outstatus)
{
- struct rx_call *tcall;
struct AFSVolSync tsync;
afs_int32 code = 0;
afs_int32
destroy_fs_channel(rpc_test_request_ctx *ctx)
{
- char cmd[512];
afs_int32 code = 0;
#if defined(RPC_TEST_ADD_ADDRESSES)
#if defined(AFS_LINUX26_ENV)
} /* destroy_fs_channel */
void
-rpc_test_PkgShutdown()
+rpc_test_PkgShutdown(void)
{
- afs_int32 code = 0;
-
} /* rpc_test_PkgShutdown */
#define CTX_FOR_RXCALL(call) \
(rx_GetServiceSpecific((rx_ServiceOf(rx_ConnectionOf(call))), ctx_key))
-afs_int32 rpc_test_PkgInit();
-void rpc_test_PkgShutdown();
+afs_int32 rpc_test_PkgInit(void);
+void rpc_test_PkgShutdown(void);
/* call channel, callback RPC server multiplexing */
afs_int32 init_fs_channel(rpc_test_request_ctx **ctx /* out */, char *cb_if,
afs_int32 destroy_fs_channel(rpc_test_request_ctx *ctx);
/* test proc wrappers */
-afs_int32 rpc_test_fetch_status();
+afs_int32 rpc_test_fetch_status(void);
afs_int32 rpc_test_afs_fetch_status(rpc_test_request_ctx *ctx, AFSFid *fid,
AFSFetchStatus *outstatus);
#if defined(AFS_BYTE_RANGE_FLOCKS) /* when will then be now? soon. */