Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4eff0667
Commit
4eff0667
authored
Mar 23, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Mar 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wldap32/tests: Use the same context in test_ldap_(add|modify_compare).
parent
c91ab8c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
24 deletions
+6
-24
parse.c
dlls/wldap32/tests/parse.c
+6
-24
No files found.
dlls/wldap32/tests/parse.c
View file @
4eff0667
...
...
@@ -175,17 +175,13 @@ static void test_ldap_bind_sA( void )
ldap_unbind
(
ld
);
}
static
void
test_ldap_add
(
void
)
static
void
test_ldap_add
(
LDAP
*
ld
)
{
char
*
one_empty_string
[]
=
{
(
char
*
)
""
,
NULL
};
LDAPModA
empty_equals_empty
=
{
0
,
(
char
*
)
""
,
{
one_empty_string
}
};
LDAPModA
*
attrs
[]
=
{
&
empty_equals_empty
,
NULL
};
LDAP
*
ld
;
ULONG
ret
,
num
;
ld
=
ldap_initA
(
(
char
*
)
"db.debian.org"
,
389
);
ok
(
ld
!=
NULL
,
"ldap_init failed
\n
"
);
ret
=
ldap_addA
(
NULL
,
NULL
,
NULL
);
ok
(
ret
==
(
ULONG
)
-
1
,
"ldap_addA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_addA
(
NULL
,
(
char
*
)
""
,
attrs
);
...
...
@@ -231,21 +227,15 @@ static void test_ldap_add(void)
ok
(
ret
==
LDAP_PROTOCOL_ERROR
,
"ldap_add_ext_sA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_add_ext_sA
(
ld
,
(
char
*
)
""
,
attrs
,
NULL
,
NULL
);
ok
(
ret
==
LDAP_ALREADY_EXISTS
,
"ldap_add_ext_sA should fail, got %#lx
\n
"
,
ret
);
ldap_unbind
(
ld
);
}
static
void
test_ldap_modify
(
void
)
static
void
test_ldap_modify
(
LDAP
*
ld
)
{
char
*
one_empty_string
[]
=
{
(
char
*
)
""
,
NULL
};
LDAPModA
empty_equals_empty
=
{
0
,
(
char
*
)
""
,
{
one_empty_string
}
};
LDAPModA
*
attrs
[]
=
{
&
empty_equals_empty
,
NULL
};
LDAP
*
ld
;
ULONG
ret
,
num
;
ld
=
ldap_initA
(
(
char
*
)
"db.debian.org"
,
389
);
ok
(
ld
!=
NULL
,
"ldap_init failed
\n
"
);
ret
=
ldap_modifyA
(
NULL
,
NULL
,
NULL
);
ok
(
ret
==
(
ULONG
)
-
1
,
"ldap_modifyA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_modifyA
(
NULL
,
(
char
*
)
""
,
attrs
);
...
...
@@ -291,19 +281,13 @@ static void test_ldap_modify(void)
ok
(
ret
==
LDAP_UNWILLING_TO_PERFORM
,
"ldap_modify_ext_sA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_modify_ext_sA
(
ld
,
(
char
*
)
""
,
attrs
,
NULL
,
NULL
);
ok
(
ret
==
LDAP_UNDEFINED_TYPE
,
"ldap_modify_ext_sA should fail, got %#lx
\n
"
,
ret
);
ldap_unbind
(
ld
);
}
static
void
test_ldap_compare
(
void
)
static
void
test_ldap_compare
(
LDAP
*
ld
)
{
struct
berval
empty_value
=
{
0
};
LDAP
*
ld
;
ULONG
ret
,
num
;
ld
=
ldap_initA
(
(
char
*
)
"db.debian.org"
,
389
);
ok
(
ld
!=
NULL
,
"ldap_init failed
\n
"
);
ret
=
ldap_compareA
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
(
ULONG
)
-
1
,
"ldap_compareA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_compareA
(
NULL
,
(
char
*
)
""
,
(
char
*
)
""
,
(
char
*
)
""
);
...
...
@@ -363,8 +347,6 @@ static void test_ldap_compare(void)
ok
(
ret
==
LDAP_UNDEFINED_TYPE
,
"ldap_compare_ext_sA should fail, got %#lx
\n
"
,
ret
);
ret
=
ldap_compare_ext_sA
(
ld
,
(
char
*
)
""
,
(
char
*
)
""
,
(
char
*
)
""
,
&
empty_value
,
NULL
,
NULL
);
ok
(
ret
==
LDAP_UNDEFINED_TYPE
,
"ldap_compare_ext_sA should fail, got %#lx
\n
"
,
ret
);
ldap_unbind
(
ld
);
}
static
void
test_ldap_server_control
(
void
)
...
...
@@ -489,13 +471,13 @@ START_TEST (parse)
test_ldap_paged_search
();
test_ldap_server_control
();
test_ldap_bind_sA
();
test_ldap_add
();
test_ldap_modify
();
test_ldap_compare
();
ld
=
ldap_initA
(
(
char
*
)
"db.debian.org"
,
389
);
ok
(
ld
!=
NULL
,
"ldap_init failed
\n
"
);
test_ldap_add
(
ld
);
test_ldap_modify
(
ld
);
test_ldap_compare
(
ld
);
test_ldap_parse_sort_control
(
ld
);
test_ldap_search_extW
(
ld
);
test_ldap_get_optionW
(
ld
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment