summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-01-29 16:33:58 +0100
committerStefan Metzmacher <metze@samba.org>2010-02-01 15:23:33 +0100
commit07b06e51bbf95168899081ba2aa92a4e6a5bac12 (patch)
tree38d4dbaed4a801ebd09dff9f2c4bca20ce642ff7 /source4/torture
parentea7ec4fb30a261cedb882c9325815679e5e20d57 (diff)
downloadsamba-07b06e51bbf95168899081ba2aa92a4e6a5bac12.tar.gz
samba-07b06e51bbf95168899081ba2aa92a4e6a5bac12.tar.bz2
samba-07b06e51bbf95168899081ba2aa92a4e6a5bac12.zip
s4:NBT-WINSREPLICATION: use an array of nbt_names to loop over different names
metze
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/nbt/winsreplication.c17
1 files changed, 7 insertions, 10 deletions
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,