Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
245c7ff1
Commit
245c7ff1
authored
May 31, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return nonzero exit status if test fails. Fixed failmalloc tests.
parent
3c49a31a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
tests/failmalloc.c
tests/failmalloc.c
+8
-1
tests/failmalloc_test.c
tests/failmalloc_test.c
+3
-1
tests/main.c
tests/main.c
+8
-1
tests/spdylay_test_helper.c
tests/spdylay_test_helper.c
+3
-1
No files found.
tests/failmalloc.c
View file @
245c7ff1
...
...
@@ -41,6 +41,7 @@ static int clean_suite1(void)
int
main
(
int
argc
,
char
*
argv
[])
{
CU_pSuite
pSuite
=
NULL
;
unsigned
int
num_tests_failed
;
/* initialize the CUnit test registry */
if
(
CUE_SUCCESS
!=
CU_initialize_registry
())
...
...
@@ -66,6 +67,12 @@ int main(int argc, char* argv[])
/* Run all tests using the CUnit Basic interface */
CU_basic_set_mode
(
CU_BRM_VERBOSE
);
CU_basic_run_tests
();
num_tests_failed
=
CU_get_number_of_tests_failed
();
CU_cleanup_registry
();
return
CU_get_error
();
if
(
CU_get_error
()
==
CUE_SUCCESS
)
{
return
num_tests_failed
;
}
else
{
printf
(
"CUnit Error: %s
\n
"
,
CU_get_error_msg
());
return
CU_get_error
();
}
}
tests/failmalloc_test.c
View file @
245c7ff1
...
...
@@ -151,6 +151,7 @@ static ssize_t get_credential_proof(spdylay_session *session,
#define TEST_FAILMALLOC_RUN(FUN) \
size_t nmalloc, i; \
\
spdylay_failmalloc = 0; \
spdylay_nmalloc = 0; \
FUN(); \
nmalloc = spdylay_nmalloc; \
...
...
@@ -162,7 +163,8 @@ static ssize_t get_credential_proof(spdylay_session *session,
/* printf("i=%zu\n", i); */
\
FUN(); \
/* printf("nmalloc=%d\n", spdylay_nmalloc); */
\
}
} \
spdylay_failmalloc = 0;
static
void
run_spdylay_session_send
(
void
)
{
...
...
tests/main.c
View file @
245c7ff1
...
...
@@ -52,6 +52,7 @@ static int clean_suite1(void)
int
main
(
int
argc
,
char
*
argv
[])
{
CU_pSuite
pSuite
=
NULL
;
unsigned
int
num_tests_failed
;
/* initialize the CUnit test registry */
if
(
CUE_SUCCESS
!=
CU_initialize_registry
())
...
...
@@ -223,6 +224,12 @@ int main(int argc, char* argv[])
/* Run all tests using the CUnit Basic interface */
CU_basic_set_mode
(
CU_BRM_VERBOSE
);
CU_basic_run_tests
();
num_tests_failed
=
CU_get_number_of_tests_failed
();
CU_cleanup_registry
();
return
CU_get_error
();
if
(
CU_get_error
()
==
CUE_SUCCESS
)
{
return
num_tests_failed
;
}
else
{
printf
(
"CUnit Error: %s
\n
"
,
CU_get_error_msg
());
return
CU_get_error
();
}
}
tests/spdylay_test_helper.c
View file @
245c7ff1
...
...
@@ -46,7 +46,9 @@ ssize_t unpack_frame_with_nv_block(spdylay_frame_type type,
rv
=
spdylay_zlib_inflate_hd
(
inflater
,
&
buffer
,
&
in
[
SPDYLAY_HEAD_LEN
+
pnvlen
],
len
-
SPDYLAY_HEAD_LEN
-
pnvlen
);
CU_ASSERT
(
rv
>=
0
);
if
(
rv
<
0
)
{
return
rv
;
}
switch
(
type
)
{
case
SPDYLAY_SYN_STREAM
:
rv
=
spdylay_frame_unpack_syn_stream
(
&
frame
->
syn_stream
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment