Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
310d842b
Commit
310d842b
authored
16 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
Skip test #558 when libcurl is built with hidden symbols
parent
1498de83
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/data/test558
+5
-0
5 additions, 0 deletions
tests/data/test558
tests/libtest/lib558.c
+42
-14
42 additions, 14 deletions
tests/libtest/lib558.c
with
47 additions
and
14 deletions
tests/data/test558
+
5
−
0
View file @
310d842b
...
...
@@ -13,6 +13,11 @@ none
<tool>
lib558
</tool>
# precheck is a command line to run before the test,
# to see if we can execute the test or not
<precheck>
./libtest/lib558 check
</precheck>
<name>
internal hash testing
...
...
This diff is collapsed.
Click to expand it.
tests/libtest/lib558.c
+
42
−
14
View file @
310d842b
...
...
@@ -27,6 +27,18 @@
#include
"memdebug.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)
static
Curl_addrinfo
*
fake_ai
(
void
)
{
Curl_addrinfo
*
ai
;
...
...
@@ -71,47 +83,50 @@ int test(char *URL)
struct
Curl_dns_entry
*
nodep
;
size_t
key_len
;
(
void
)
URL
;
/* not used */
if
(
!
strcmp
(
URL
,
"check"
))
{
/* test harness script verifying if this test can run */
return
0
;
/* sure, run this! */
}
easyh
=
curl_easy_init
();
if
(
!
easyh
)
{
printf
(
"easy handle init failed
\n
"
);
f
printf
(
stdout
,
"easy handle init failed
\n
"
);
return
TEST_ERR_MAJOR_BAD
;
}
printf
(
"easy handle init OK
\n
"
);
f
printf
(
stdout
,
"easy handle init OK
\n
"
);
printf
(
"creating hash...
\n
"
);
f
printf
(
stdout
,
"creating hash...
\n
"
);
hp
=
Curl_mk_dnscache
();
if
(
!
hp
)
{
printf
(
"hash creation failed
\n
"
);
f
printf
(
stdout
,
"hash creation failed
\n
"
);
return
TEST_ERR_MAJOR_BAD
;
}
printf
(
"hash creation OK
\n
"
);
f
printf
(
stdout
,
"hash creation OK
\n
"
);
/**/
data_key
=
aprintf
(
"%s:%d"
,
"dummy"
,
0
);
if
(
!
data_key
)
{
printf
(
"data key creation failed
\n
"
);
f
printf
(
stdout
,
"data key creation failed
\n
"
);
return
TEST_ERR_MAJOR_BAD
;
}
key_len
=
strlen
(
data_key
);
data_node
=
calloc
(
1
,
sizeof
(
struct
Curl_dns_entry
));
if
(
!
data_node
)
{
printf
(
"data node creation failed
\n
"
);
f
printf
(
stdout
,
"data node creation failed
\n
"
);
return
TEST_ERR_MAJOR_BAD
;
}
data_node
->
addr
=
fake_ai
();
if
(
!
data_node
->
addr
)
{
printf
(
"actual data creation failed
\n
"
);
f
printf
(
stdout
,
"actual data creation failed
\n
"
);
return
TEST_ERR_MAJOR_BAD
;
}
nodep
=
Curl_hash_add
(
hp
,
data_key
,
key_len
+
1
,
(
void
*
)
data_node
);
if
(
!
nodep
)
{
printf
(
"insertion into hash failed
\n
"
);
f
printf
(
stdout
,
"insertion into hash failed
\n
"
);
return
TEST_ERR_MAJOR_BAD
;
}
...
...
@@ -119,16 +134,29 @@ int test(char *URL)
/**/
printf
(
"destroying hash...
\n
"
);
f
printf
(
stdout
,
"destroying hash...
\n
"
);
Curl_hash_destroy
(
hp
);
printf
(
"hash destruction OK
\n
"
);
f
printf
(
stdout
,
"hash destruction OK
\n
"
);
printf
(
"destroying easy handle...
\n
"
);
f
printf
(
stdout
,
"destroying easy handle...
\n
"
);
curl_easy_cleanup
(
easyh
);
printf
(
"easy handle destruction OK
\n
"
);
f
printf
(
stdout
,
"easy handle destruction OK
\n
"
);
curl_global_cleanup
();
return
0
;
/* OK */
}
#else
/* !defined(CURL_HIDDEN_SYMBOLS) */
int
test
(
char
*
URL
)
{
(
void
)
URL
;
fprintf
(
stdout
,
"libcurl built with hidden symbols"
);
return
1
;
/* skip test */
}
#endif
/* !defined(CURL_HIDDEN_SYMBOLS) */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment