]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/apitest.c
Use struct berval * instead of ** for newpasswd
[openldap] / libraries / libldap / apitest.c
index 94ba779400adfb3f8163fedee11d4d1ce9d943a9..ca41a78c6ad10ccc140755a5e8325801ae7b191d 100644 (file)
@@ -1,5 +1,6 @@
+/* $OpenLDAP$ */
 /*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 /*
@@ -187,5 +188,47 @@ main(int argc, char **argv)
                puts("  HOST NAME:         <not set>");
        }
 
+#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;
 }