Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Michael A. (Mike) Iovine
p1
Commits
26f037cf
Commit
26f037cf
authored
5 years ago
by
Mike Iovine
Browse files
Options
Download
Email Patches
Plain Diff
Add more tests
parent
27b5e31d
master
No related merge requests found
Pipeline
#30570
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/inflate_test.cpp
+19
-4
tests/inflate_test.cpp
with
19 additions
and
4 deletions
+19
-4
tests/inflate_test.cpp
View file @
26f037cf
...
...
@@ -198,12 +198,27 @@ TEST (HuffmanTests, TestReadChunkFixed) {
ASSERT_EQ
(
read_chunk
((
char
*
)
buf
,
HUFFMAN_FIXED
),
i
);
}
/* Test reading all possible fixed distances */
// TODO test fixed distance codes as well?
}
/*
* Mapping of distance literal -> code, again, as laid out in memory.
*/
int
codes_dist
[
30
]
=
{
0
,
16
,
8
,
24
,
4
,
20
,
12
,
28
,
2
,
18
,
10
,
26
,
6
,
22
,
14
,
30
,
1
,
17
,
9
,
25
,
5
,
21
,
13
,
29
,
3
,
19
,
11
,
27
,
7
,
23
};
for
(
int
i
=
0
;
i
<
30
;
i
++
)
{
reset_pos
();
// TODO
TEST
(
HuffmanTests
,
TestReadLens
)
{}
int
code
=
codes_dist
[
i
];
unsigned
char
buf
[
1
];
buf
[
0
]
=
code
;
ASSERT_EQ
(
read_chunk
((
char
*
)
buf
,
HUFFMAN_FIXED_DISTS
),
i
);
}
}
int
main
(
int
argc
,
char
**
argv
)
{
::
testing
::
InitGoogleTest
(
&
argc
,
argv
);
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help