From 07b06e51bbf95168899081ba2aa92a4e6a5bac12 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 29 Jan 2010 16:33:58 +0100 Subject: s4:NBT-WINSREPLICATION: use an array of nbt_names to loop over different names metze --- source4/torture/nbt/winsreplication.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'source4/torture/nbt/winsreplication.c') diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 1ad0543d66..6d75aac80e 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -1008,14 +1008,16 @@ static bool test_conflict_same_owner(struct torture_context *tctx, struct test_wrepl_conflict_conn *ctx) { static bool ret = true; - struct nbt_name name; struct wrepl_wins_name wins_name1; struct wrepl_wins_name wins_name2; struct wrepl_wins_name *wins_name_tmp; struct wrepl_wins_name *wins_name_last; struct wrepl_wins_name *wins_name_cur; uint32_t i,j; - uint8_t types[] = { 0x00, 0x1C }; + struct nbt_name names[] = { + _NBT_NAME("_SAME_OWNER_A", 0x00, NULL), + _NBT_NAME("_SAME_OWNER_A", 0x1C, NULL), + }; struct { enum wrepl_name_type type; enum wrepl_name_state state; @@ -1112,18 +1114,13 @@ static bool test_conflict_same_owner(struct torture_context *tctx, } }; - name.name = "_SAME_OWNER_A"; - name.type = 0; - name.scope = NULL; - wins_name_tmp = NULL; wins_name_last = &wins_name2; wins_name_cur = &wins_name1; - for (j=0; ret && j < ARRAY_SIZE(types); j++) { - name.type = types[j]; + for (j=0; ret && j < ARRAY_SIZE(names); j++) { torture_comment(tctx, "Test Replica Conflicts with same owner[%s] for %s\n", - nbt_name_string(ctx, &name), ctx->a.address); + nbt_name_string(ctx, &names[j]), ctx->a.address); for(i=0; ret && i < ARRAY_SIZE(records); i++) { wins_name_tmp = wins_name_last; @@ -1142,7 +1139,7 @@ static bool test_conflict_same_owner(struct torture_context *tctx, "REPLACE"); } - wins_name_cur->name = &name; + wins_name_cur->name = &names[j]; wins_name_cur->flags = WREPL_NAME_FLAGS(records[i].type, records[i].state, records[i].node, -- cgit