Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
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
The Tor Project
Core
Tor
Commits
55412c4f
Commit
55412c4f
authored
6 years ago
by
rl1987
Browse files
Options
Downloads
Patches
Plain Diff
Add new source file to test target
parent
b7fbd1f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/test/include.am
+1
-0
1 addition, 0 deletions
src/test/include.am
src/test/test.c
+1
-0
1 addition, 0 deletions
src/test/test.c
src/test/test.h
+1
-0
1 addition, 0 deletions
src/test/test.h
src/test/test_parsecommon.c
+44
-0
44 additions, 0 deletions
src/test/test_parsecommon.c
with
47 additions
and
0 deletions
src/test/include.am
+
1
−
0
View file @
55412c4f
...
...
@@ -182,6 +182,7 @@ src_test_test_SOURCES += \
src/test/test_x509.c \
src/test/test_helpers.c \
src/test/test_dns.c \
src/test/test_parsecommon.c \
src/test/testing_common.c \
src/test/testing_rsakeys.c \
src/ext/tinytest.c
...
...
This diff is collapsed.
Click to expand it.
src/test/test.c
+
1
−
0
View file @
55412c4f
...
...
@@ -926,5 +926,6 @@ struct testgroup_t testgroups[] = {
{
"util/thread/"
,
thread_tests
},
{
"util/handle/"
,
handle_tests
},
{
"dns/"
,
dns_tests
},
{
"parsecommon/"
,
parsecommon_tests
},
END_OF_GROUPS
};
This diff is collapsed.
Click to expand it.
src/test/test.h
+
1
−
0
View file @
55412c4f
...
...
@@ -266,6 +266,7 @@ extern struct testcase_t dns_tests[];
extern
struct
testcase_t
handle_tests
[];
extern
struct
testcase_t
sr_tests
[];
extern
struct
testcase_t
x509_tests
[];
extern
struct
testcase_t
parsecommon_tests
[];
extern
struct
testcase_t
slow_crypto_tests
[];
extern
struct
testcase_t
slow_util_tests
[];
...
...
This diff is collapsed.
Click to expand it.
src/test/test_parsecommon.c
0 → 100644
+
44
−
0
View file @
55412c4f
/* Copyright (c) 2001-2004, Roger Dingledine.
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
* Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */
#include
"core/or/or.h"
#include
"test/test.h"
#include
"lib/memarea/memarea.h"
#include
"lib/encoding/binascii.h"
#include
"feature/dirparse/parsecommon.h"
#include
"test/log_test_helpers.h"
static
void
test_parsecommon_tokenize_string_null
(
void
*
arg
)
{
memarea_t
*
area
=
memarea_new
();
smartlist_t
*
tokens
=
smartlist_new
();
(
void
)
arg
;
const
char
*
str_with_null
=
"a
\0
bccccccccc"
;
int
retval
=
tokenize_string
(
area
,
str_with_null
,
str_with_null
+
3
,
tokens
,
NULL
,
0
);
tt_int_op
(
retval
,
OP_EQ
,
-
1
);
done:
memarea_drop_all
(
area
);
smartlist_free
(
tokens
);
return
;
}
#define PARSECOMMON_TEST(name) \
{ #name, test_parsecommon_ ## name, 0, NULL, NULL }
struct
testcase_t
parsecommon_tests
[]
=
{
PARSECOMMON_TEST
(
tokenize_string_null
),
END_OF_TESTCASES
};
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