X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=libraries%2Flibldap%2Fapitest.c;h=17548cd2b3eb7ecc1f025d3293faa82ba61be7aa;hb=241d6a558e3bfd7a7cfc70a1de65fa527fe40e60;hp=cbab301c271d2495e205ccc48857920ac2702aa9;hpb=8e60c8e287ba54ceee765cea1f5abb5f90a5f300;p=openldap diff --git a/libraries/libldap/apitest.c b/libraries/libldap/apitest.c index cbab301c27..17548cd2b3 100644 --- a/libraries/libldap/apitest.c +++ b/libraries/libldap/apitest.c @@ -1,5 +1,6 @@ +/* $OpenLDAP$ */ /* - * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ /* @@ -12,11 +13,11 @@ */ #include "portable.h" +#include + #include -#include -#include "lber.h" -#include "ldap.h" +#include int main(int argc, char **argv) @@ -184,8 +185,50 @@ main(int argc, char **argv) printf(" HOST NAME: %s\n", sval); ldap_memfree(sval); } else { - printf(" HOST NAME: \n", sval); + 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; }