X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fapitest.c;h=62c1c1d6bec8bfe37e9ca3905dcf206ca8bdfd6d;hb=fff5d3de601a7a980cf7554e3f2e6f4d7ceda834;hp=0fe1de5ee5eb347e5d414a351e2e6bc1d7ae3265;hpb=29d9fa20a2823c827f098d78f1ea8539d86bf4cf;p=openldap diff --git a/libraries/libldap/apitest.c b/libraries/libldap/apitest.c index 0fe1de5ee5..62c1c1d6be 100644 --- a/libraries/libldap/apitest.c +++ b/libraries/libldap/apitest.c @@ -1,6 +1,6 @@ /* $OpenLDAP$ */ /* - * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ /* @@ -188,5 +188,47 @@ main(int argc, char **argv) puts(" HOST NAME: "); } +#if 0 + /* API tests */ + { /* bindless unbind */ + LDAP *ld; + int rc; + + ld = ldap_init( "localhost", 389 ); + if( ld == NULL ) { + perror("ldap_init"); + return EXIT_FAILURE; + } + + rc = ldap_unbind( ld ); + if( rc != LDAP_SUCCESS ) { + perror("ldap_unbind"); + return EXIT_FAILURE; + } + } + { /* bindless unbind */ + LDAP *ld; + int rc; + + ld = ldap_init( "localhost", 389 ); + if( ld == NULL ) { + perror("ldap_init"); + return EXIT_FAILURE; + } + + rc = ldap_abandon_ext( ld, 0, NULL, NULL ); + if( rc != LDAP_SERVER_DOWN ) { + ldap_perror( ld, "ldap_abandon"); + return EXIT_FAILURE; + } + + rc = ldap_unbind( ld ); + if( rc != LDAP_SUCCESS ) { + perror("ldap_unbind"); + return EXIT_FAILURE; + } + } +#endif + return EXIT_SUCCESS; }