summaryrefslogtreecommitdiff
path: root/expat/tests/minicheck.h
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2016-11-04 12:13:08 +0000
committerChris Liddell <chris.liddell@artifex.com>2016-11-04 12:42:40 +0000
commit00b5d81646bb936577cbea2476e13f0a5dd4b9f1 (patch)
tree1a648bec4b9bd8ba16e38e5d96e636c568802c41 /expat/tests/minicheck.h
parenta73e3cf1ca91bbdb51d5a999a491e58fb9a7ce35 (diff)
downloadghostpdl-00b5d81646bb936577cbea2476e13f0a5dd4b9f1.tar.gz
Update to expat 2.2.0
Diffstat (limited to 'expat/tests/minicheck.h')
-rw-r--r--expat/tests/minicheck.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/expat/tests/minicheck.h b/expat/tests/minicheck.h
index f846bead1..9b06f51a8 100644
--- a/expat/tests/minicheck.h
+++ b/expat/tests/minicheck.h
@@ -18,13 +18,19 @@ extern "C" {
#define CK_NORMAL 1
#define CK_VERBOSE 2
-/* Workaround for Tru64 Unix systems where the C compiler has a working
- __func__, but the C++ compiler only has a working __FUNCTION__. This
- could be fixed in configure.in, but it's not worth it right now. */
-#if defined(__osf__) && defined(__cplusplus)
+/* Workaround for Microsoft's compiler and Tru64 Unix systems where the
+ C compiler has a working __func__, but the C++ compiler only has a
+ working __FUNCTION__. This could be fixed in configure.in, but it's
+ not worth it right now. */
+#if defined (_MSC_VER) || (defined(__osf__) && defined(__cplusplus))
#define __func__ __FUNCTION__
#endif
+/* ISO C90 does not support '__func__' predefined identifier */
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ < 199901)
+# define __func__ "(unknown)"
+#endif
+
#define START_TEST(testname) static void testname(void) { \
_check_set_test_info(__func__, __FILE__, __LINE__); \
{
@@ -47,12 +53,12 @@ struct SRunner {
};
struct Suite {
- char *name;
+ const char *name;
TCase *tests;
};
struct TCase {
- char *name;
+ const char *name;
tcase_setup_function setup;
tcase_teardown_function teardown;
tcase_test_function *tests;
@@ -71,9 +77,9 @@ void _check_set_test_info(char const *function,
* Prototypes for the actual implementation.
*/
-void _fail_unless(int condition, const char *file, int line, char *msg);
-Suite *suite_create(char *name);
-TCase *tcase_create(char *name);
+void _fail_unless(int condition, const char *file, int line, const char *msg);
+Suite *suite_create(const char *name);
+TCase *tcase_create(const char *name);
void suite_add_tcase(Suite *suite, TCase *tc);
void tcase_add_checked_fixture(TCase *,
tcase_setup_function,