dlopen-tests.c revision 99b2352f909c548811617389641a9ccc3e17bc53
/*
SSSD
Authors:
Simo Sorce <simo@redhat.com>
Copyright (C) 2013 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdbool.h>
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <check.h>
#include <dirent.h>
struct so {
const char *name;
const char *libs[6];
} so[] = {
#ifdef BUILD_LIBWBCLIENT
#endif /* BUILD_LIBWBCLIENT */
#ifdef BUILD_IFP
#endif /* BUILD_IFP */
#ifdef BUILD_SUDO
#endif
#ifdef BUILD_AUTOFS
#endif
#ifdef HAVE_KRB5_LOCATOR_PLUGIN
NULL } },
#endif
#ifdef HAVE_KRB5_LOCALAUTH_PLUGIN
NULL } },
#endif
#ifdef HAVE_PAC_RESPONDER
#endif
#ifdef HAVE_CIFS_IDMAP_PLUGIN
#endif
#ifdef BUILD_SAMBA
#endif /* BUILD_SAMBA */
#ifdef HAVE_PYTHON2_BINDINGS
#endif
#ifdef HAVE_PYTHON3_BINDINGS
#endif
#ifdef BUILD_NFS_IDMAP
#endif
/* for testing purposes */
NULL } },
NULL } },
#ifdef BUILD_SAMBA
#endif
{ NULL }
};
{
void *handle;
bool ok;
if (!handle) {
return false;
}
round++;
} else {
ok = true;
}
return ok;
}
{
char *suffix;
return 1;
}
return 0;
}
{
int n;
char **libraries;
fail_unless(n > 0);
for (int i = 0; i < n; ++i) {
}
*_list_size = (size_t)n;
return libraries;
}
{
/* found library need to be removed from list */
return;
}
}
}
{
char *errmsg;
bool ok;
int i;
bool unchecked_library = false;
}
for (i = 0; i < found_libraries_size; ++i) {
if (found_libraries[i] != NULL) {
unchecked_library = true;
}
}
}
Suite *dlopen_suite(void)
{
suite_add_tcase(s, tc_dlopen);
return s;
}
{
int number_failed;
Suite *s = dlopen_suite();
if (number_failed == 0)
return EXIT_SUCCESS;
return EXIT_FAILURE;
}