Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
Alexander Færøy
tor
Commits
45530ed7
Commit
45530ed7
authored
Sep 25, 2017
by
Nick Mathewson
Browse files
Merge branch 'bug22109'
parents
81c47932
f9155ff4
Pipeline
#12249413
failed with stage
in 16 minutes and 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
changes/bug22109
changes/bug22109
+3
-0
src/test/test_dir.c
src/test/test_dir.c
+24
-0
No files found.
changes/bug22109
0 → 100644
View file @
45530ed7
o Minor features (tests):
- Add a unit test to make sure that our own generated platform string
will be accepted by directory authorities. Closes ticket 22109.
src/test/test_dir.c
View file @
45530ed7
...
...
@@ -6140,6 +6140,29 @@ test_dir_post_parsing(void *arg)
;
}
static
void
test_dir_platform_str
(
void
*
arg
)
{
char
platform
[
256
];
(
void
)
arg
;
platform
[
0
]
=
0
;
get_platform_str
(
platform
,
sizeof
(
platform
));
tt_int_op
((
int
)
strlen
(
platform
),
OP_GT
,
0
);
tt_assert
(
!
strcmpstart
(
platform
,
"Tor "
));
tor_version_t
ver
;
// make sure this is a tor version, a real actual tor version.
tt_int_op
(
tor_version_parse_platform
(
platform
,
&
ver
,
1
),
OP_EQ
,
1
);
TT_BLATHER
((
"%d.%d.%d.%d"
,
ver
.
major
,
ver
.
minor
,
ver
.
micro
,
ver
.
patchlevel
));
// Handle an example version.
tt_int_op
(
tor_version_parse_platform
(
"Tor 0.3.3.3 (foo) (git-xyzzy) on a potato"
,
&
ver
,
1
),
OP_EQ
,
1
);
done:
;
}
#define DIR_LEGACY(name) \
{ #name, test_dir_ ## name , TT_FORK, NULL, NULL }
...
...
@@ -6205,6 +6228,7 @@ struct testcase_t dir_tests[] = {
DIR_ARG
(
find_dl_schedule
,
TT_FORK
,
"car"
),
DIR
(
assumed_flags
,
0
),
DIR
(
networkstatus_compute_bw_weights_v10
,
0
),
DIR
(
platform_str
,
0
),
END_OF_TESTCASES
};
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