diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2010-05-14 14:42:58 -0700 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2010-05-14 14:42:58 -0700 |
commit | 43b816538fbbac07ca7ccc2dc647c972c3ee072a (patch) | |
tree | f3919626d841a55cc86d73b458bfeddb00ba72b4 /tests/libtest | |
parent | 77cfeadfa6405c5808273f1d3cc8e89eb17e5f08 (diff) |
Fixed test 577 to work when --enable-hidden-symbols is configured
Diffstat (limited to 'tests/libtest')
-rw-r--r-- | tests/libtest/lib577.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/libtest/lib577.c b/tests/libtest/lib577.c index 8b434f8fb..ac995c3fc 100644 --- a/tests/libtest/lib577.c +++ b/tests/libtest/lib577.c @@ -9,6 +9,25 @@ #include "test.h" +/* + * This hacky test bypasses the library external API, + * using internal only libcurl functions. So don't be + * surprised if we cannot run it when the library has + * been built with hidden symbols, exporting only the + * ones in the public API. + */ + +#if defined(CURL_HIDDEN_SYMBOLS) +# define SKIP_TEST 1 +#elif defined(WIN32) && !defined(CURL_STATICLIB) +# define SKIP_TEST 1 +#else +# undef SKIP_TEST +#endif + + +#if !defined(SKIP_TEST) + #include "memdebug.h" #include "curl_fnmatch.h" @@ -204,6 +223,12 @@ int test(char *URL) int testnum = sizeof(tests) / sizeof(struct testcase); int i, rc; (void)URL; /* not used */ + + if(!strcmp(URL, "check")) { + /* test harness script verifying if this test can run */ + return 0; /* sure, run this! */ + } + printf("===========================\n"); for(i = 0; i < testnum; i++) { rc = Curl_fnmatch(tests[i].pattern, tests[i].string); @@ -215,3 +240,16 @@ int test(char *URL) printf("===========================\n"); return 0; } + +#else /* !defined(SKIP_TEST) */ + + +int test(char *URL) +{ + (void)URL; + fprintf(stdout, "libcurl built with hidden symbols"); + return 1; /* skip test */ +} + + +#endif /* !defined(SKIP_TEST) */ |