From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/torture/locktest2.c | 4 +-- source3/torture/mangle_test.c | 2 +- source3/torture/msgtest.c | 10 ++++--- source3/torture/t_asn1.c | 61 +++++++++++++++++++++++++++++++++++++++++++ source3/torture/t_strappend.c | 45 +++++++++++++++++++++++++++++++ source3/torture/torture.c | 1 - source3/torture/vfstest.c | 2 +- 7 files changed, 116 insertions(+), 9 deletions(-) create mode 100644 source3/torture/t_asn1.c create mode 100644 source3/torture/t_strappend.c (limited to 'source3/torture') diff --git a/source3/torture/locktest2.c b/source3/torture/locktest2.c index d0b502c74e..fc180bfafe 100644 --- a/source3/torture/locktest2.c +++ b/source3/torture/locktest2.c @@ -133,12 +133,12 @@ static BOOL try_unlock(struct cli_state *c, int fstype, return False; } -static void print_brl(SMB_DEV_T dev, SMB_INO_T ino, int pid, +static void print_brl(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, enum brl_type lock_type, br_off start, br_off size) { printf("%6d %05x:%05x %s %.0f:%.0f(%.0f)\n", - (int)pid, (int)dev, (int)ino, + (int)procid_to_pid(&pid), (int)dev, (int)ino, lock_type==READ_LOCK?"R":"W", (double)start, (double)start+size-1,(double)size); diff --git a/source3/torture/mangle_test.c b/source3/torture/mangle_test.c index df0855d93d..9ce6afa038 100644 --- a/source3/torture/mangle_test.c +++ b/source3/torture/mangle_test.c @@ -98,7 +98,7 @@ static BOOL test_one(struct cli_state *cli, const char *name) } else { TDB_DATA namedata; /* store it for later */ - namedata.dptr = name; + namedata.dptr = CONST_DISCARD(char *, name); namedata.dsize = strlen(name)+1; tdb_store_bystring(tdb, shortname, namedata, TDB_REPLACE); } diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index ac55d70327..d691ab32f1 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -28,7 +28,7 @@ static int pong_count; /**************************************************************************** a useful function for testing the message system ****************************************************************************/ -void pong_message(int msg_type, pid_t src, void *buf, size_t len) +void pong_message(int msg_type, struct process_id src, void *buf, size_t len) { pong_count++; } @@ -56,7 +56,7 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len) message_register(MSG_PONG, pong_message); for (i=0;i ASN -> Int %d\n", values[i], val); + ok = False; + } + } + + return ok ? 0 : 1; +} diff --git a/source3/torture/t_strappend.c b/source3/torture/t_strappend.c new file mode 100644 index 0000000000..becc691c7f --- /dev/null +++ b/source3/torture/t_strappend.c @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2005 by Volker Lendecke + * + * Test harness for sprintf_append + */ + +#include "includes.h" +#include + +int main(int argc, char *argv[]) +{ + TALLOC_CTX *mem_ctx; + char *string = NULL; + int len = 0; + int bufsize = 4; + int i; + + mem_ctx = talloc_init("t_strappend"); + if (mem_ctx == NULL) { + fprintf(stderr, "talloc_init failed\n"); + return 1; + } + + sprintf_append(mem_ctx, &string, &len, &bufsize, ""); + assert(strlen(string) == len); + sprintf_append(mem_ctx, &string, &len, &bufsize, ""); + assert(strlen(string) == len); + sprintf_append(mem_ctx, &string, &len, &bufsize, + "01234567890123456789012345678901234567890123456789\n"); + assert(strlen(string) == len); + + + for (i=0; i<(100000); i++) { + if (i%1000 == 0) { + printf("%d %d\r", i, bufsize); + fflush(stdout); + } + sprintf_append(mem_ctx, &string, &len, &bufsize, "%d\n", i); + assert(strlen(string) == len); + } + + talloc_destroy(mem_ctx); + + return 0; +} diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 11cea53188..8ad567f177 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -698,7 +698,6 @@ static BOOL run_netbench(int client) { struct cli_state *cli; int i; - fstring fname; pstring line; char cname[20]; FILE *f; diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c index 69acd01c1a..b5ccf930bc 100644 --- a/source3/torture/vfstest.c +++ b/source3/torture/vfstest.c @@ -38,7 +38,7 @@ extern pstring user_socket_options; /**************************************************************************** handle completion of commands for readline ****************************************************************************/ -static char **completion_fn(char *text, int start, int end) +static char **completion_fn(const char *text, int start, int end) { #define MAX_COMPLETIONS 100 char **matches; -- cgit