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
be7cc971
Commit
be7cc971
authored
Feb 04, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added asserts to test_spdylay_frame_count_unpack_nv_space()
parent
8b20e836
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
tests/spdylay_frame_test.c
tests/spdylay_frame_test.c
+17
-0
No files found.
tests/spdylay_frame_test.c
View file @
be7cc971
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include <CUnit/CUnit.h>
#include <CUnit/CUnit.h>
#include "spdylay_frame.h"
#include "spdylay_frame.h"
#include "spdylay_helper.h"
static
const
char
*
headers
[]
=
{
static
const
char
*
headers
[]
=
{
"method"
,
"GET"
,
"method"
,
"GET"
,
...
@@ -69,10 +70,26 @@ void test_spdylay_frame_count_unpack_nv_space()
...
@@ -69,10 +70,26 @@ void test_spdylay_frame_count_unpack_nv_space()
size_t
nvlen
,
buflen
;
size_t
nvlen
,
buflen
;
uint8_t
out
[
1024
];
uint8_t
out
[
1024
];
size_t
inlen
=
spdylay_frame_pack_nv
(
out
,
(
char
**
)
headers
);
size_t
inlen
=
spdylay_frame_pack_nv
(
out
,
(
char
**
)
headers
);
uint16_t
temp
;
CU_ASSERT
(
0
==
spdylay_frame_count_unpack_nv_space
(
&
nvlen
,
&
buflen
,
CU_ASSERT
(
0
==
spdylay_frame_count_unpack_nv_space
(
&
nvlen
,
&
buflen
,
out
,
inlen
));
out
,
inlen
));
CU_ASSERT
(
6
==
nvlen
);
CU_ASSERT
(
6
==
nvlen
);
CU_ASSERT
(
166
==
buflen
);
CU_ASSERT
(
166
==
buflen
);
/* Change number of nv pair to a bogus value */
temp
=
spdylay_get_uint16
(
out
);
spdylay_put_uint16be
(
out
,
temp
+
1
);
CU_ASSERT
(
SPDYLAY_ERR_INVALID_ARGUMENT
==
spdylay_frame_count_unpack_nv_space
(
&
nvlen
,
&
buflen
,
out
,
inlen
));
spdylay_put_uint16be
(
out
,
temp
);
/* Change the length of name to a bogus value */
temp
=
spdylay_get_uint16
(
out
+
2
);
spdylay_put_uint16be
(
out
+
2
,
temp
+
1
);
CU_ASSERT
(
SPDYLAY_ERR_INVALID_ARGUMENT
==
spdylay_frame_count_unpack_nv_space
(
&
nvlen
,
&
buflen
,
out
,
inlen
));
spdylay_put_uint16be
(
out
+
2
,
65536
);
CU_ASSERT
(
SPDYLAY_ERR_INVALID_ARGUMENT
==
spdylay_frame_count_unpack_nv_space
(
&
nvlen
,
&
buflen
,
out
,
inlen
));
}
}
void
test_spdylay_frame_pack_ping
()
void
test_spdylay_frame_pack_ping
()
...
...
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