names[0].state,
names[0].node,
names[0].is_static);
+ char *expected_scope = NULL;
CHECK_VALUE(names[0].name.type, name->name->type);
CHECK_VALUE_STRING(names[0].name.name, name->name->name);
- CHECK_VALUE_STRING(names[0].name.scope, name->name->scope);
+ if (names[0].name.scope) {
+ expected_scope = talloc_strndup(ctx,
+ name->name->scope,
+ 237);
+ }
+ CHECK_VALUE_STRING(names[0].name.scope, expected_scope);
CHECK_VALUE(flags, name->flags);
CHECK_VALUE_UINT64(names[0].version_id, name->id);
return ret;
}
+static char *test_nbt_winsrepl_scope_string(TALLOC_CTX *mem_ctx, uint8_t count)
+{
+ char *res;
+ uint8_t i;
+
+ res = talloc_array(mem_ctx, char, count+1);
+ if (res == NULL) {
+ return NULL;
+ }
+
+ for (i=0; i < count; i++) {
+ res[i] = '0' + (i%10);
+ }
+
+ res[count] = '\0';
+
+ talloc_set_name_const(res, res);
+
+ return res;
+}
+
static BOOL test_conflict_same_owner(struct test_wrepl_conflict_conn *ctx)
{
BOOL ret = True;
uint32_t i,j;
struct nbt_name names[] = {
_NBT_NAME("_SAME_OWNER_A", 0x00, NULL),
+ _NBT_NAME("_SAME_OWNER_A", 0x00,
+ test_nbt_winsrepl_scope_string(ctx, 1)),
+ _NBT_NAME("_SAME_OWNER_A", 0x00,
+ test_nbt_winsrepl_scope_string(ctx, 2)),
+ _NBT_NAME("_SAME_OWNER_A", 0x00,
+ test_nbt_winsrepl_scope_string(ctx, 3)),
+ _NBT_NAME("_SAME_OWNER_A", 0x00,
+ test_nbt_winsrepl_scope_string(ctx, 4)),
+ _NBT_NAME("_SAME_OWNER_A", 0x00,
+ test_nbt_winsrepl_scope_string(ctx, 5)),
+ _NBT_NAME("_SAME_OWNER_A", 0x00,
+ test_nbt_winsrepl_scope_string(ctx, 6)),
+ _NBT_NAME("_SAME_OWNER_A", 0x00,
+ test_nbt_winsrepl_scope_string(ctx, 7)),
+ _NBT_NAME("_SAME_OWNER_A", 0x00,
+ test_nbt_winsrepl_scope_string(ctx, 8)),
+ _NBT_NAME("_SAME_OWNER_A", 0x00,
+ test_nbt_winsrepl_scope_string(ctx, 9)),
+ _NBT_NAME("_SAME_OWNER_A", 0x00,
+ test_nbt_winsrepl_scope_string(ctx, 237)),
+ _NBT_NAME("_SAME_OWNER_A", 0x00,
+ test_nbt_winsrepl_scope_string(ctx, 238)),
_NBT_NAME("_SAME_OWNER_A", 0x1C, NULL),
};
struct {