common.h (nss-pam-ldapd-0.9.11) | : | common.h (nss-pam-ldapd-0.9.12) | ||
---|---|---|---|---|
/* | /* | |||
common.h - common test routines | common.h - common test routines | |||
This file is part of the nss-pam-ldapd library. | This file is part of the nss-pam-ldapd library. | |||
Copyright (C) 2011, 2012 Arthur de Jong | Copyright (C) 2011-2021 Arthur de Jong | |||
This library is free software; you can redistribute it and/or | This library is free software; you can redistribute it and/or | |||
modify it under the terms of the GNU Lesser General Public | modify it under the terms of the GNU Lesser General Public | |||
License as published by the Free Software Foundation; either | License as published by the Free Software Foundation; either | |||
version 2.1 of the License, or (at your option) any later version. | version 2.1 of the License, or (at your option) any later version. | |||
This library is distributed in the hope that it will be useful, | This library is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
Lesser General Public License for more details. | Lesser General Public License for more details. | |||
skipping to change at line 27 | skipping to change at line 27 | |||
You should have received a copy of the GNU Lesser General Public | You should have received a copy of the GNU Lesser General Public | |||
License along with this library; if not, write to the Free Software | License along with this library; if not, write to the Free Software | |||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | |||
02110-1301 USA | 02110-1301 USA | |||
*/ | */ | |||
#ifndef TEST__COMMON_H | #ifndef TEST__COMMON_H | |||
#define TEST__COMMON_H 1 | #define TEST__COMMON_H 1 | |||
#include <errno.h> | #include <errno.h> | |||
#include <assert.h> | ||||
#ifndef __ASSERT_FUNCTION | #ifndef __ASSERT_FUNCTION | |||
#define __ASSERT_FUNCTION "" | #define __ASSERT_FUNCTION "" | |||
#endif /* not __ASSERT_FUNCTION */ | #endif /* not __ASSERT_FUNCTION */ | |||
/* try to find the actual assert function */ | /* try to find the actual assert function */ | |||
#ifndef HAVE___ASSERT_FAIL | #ifndef HAVE___ASSERT_FAIL | |||
/* for Solaris: */ | /* for Solaris: */ | |||
#ifdef sun | #ifdef sun | |||
#if defined(HAVE___ASSERT_C99) | ||||
#define __assert_fail(assertion, file, line, function) \ | ||||
__assert_c99(assertion, file, line, function) | ||||
#elif defined(HAVE___ASSERT) | ||||
#define __assert_fail(assertion, file, line, function) \ | #define __assert_fail(assertion, file, line, function) \ | |||
__assert(assertion, file, line) | __assert(assertion, file, line) | |||
#endif | #endif /* HAVE___ASSERT_C99 or HAVE___ASSERT */ | |||
#endif /* sun */ | ||||
/* for FreeBSD: */ | /* for FreeBSD: */ | |||
#ifdef __FreeBSD__ | #ifdef __FreeBSD__ | |||
#define __assert_fail(assertion, file, line, function) \ | #define __assert_fail(assertion, file, line, function) \ | |||
__assert(assertion, file, line, function) | __assert(assertion, file, line, function) | |||
#endif | #endif | |||
#endif /* not HAVE___ASSERT_FAIL */ | #endif /* not HAVE___ASSERT_FAIL */ | |||
/* extra assertion function that expects both strings to be the same | /* extra assertion function that expects both strings to be the same | |||
(special macro because strcmp() can be a macro that turns ugly in assert) */ | (special macro because strcmp() can be a macro that turns ugly in assert) */ | |||
#define assertstreq(str1, str2) \ | #define assertstreq(str1, str2) \ | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 8 lines changed or added |