Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
7d69f788
Commit
7d69f788
authored
Jun 28, 2011
by
Carlos Martín Nieto
Committed by
Vicent Marti
Jul 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add variable writing tests
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
parent
156af801
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
tests/t15-config.c
+28
-0
No files found.
tests/t15-config.c
View file @
7d69f788
...
...
@@ -271,6 +271,32 @@ BEGIN_TEST(config14, "don't fail horribly if a section header is in the last lin
git_config_free
(
cfg
);
END_TEST
BEGIN_TEST
(
config15
,
"add a variable in an existing section"
)
git_config
*
cfg
;
int
i
;
/* By freeing the config, we make sure we flush the values */
must_pass
(
git_config_open_ondisk
(
&
cfg
,
CONFIG_BASE
"/config10"
));
must_pass
(
git_config_set_int
(
cfg
,
"empty.tmp"
,
5
));
must_pass
(
git_config_get_int
(
cfg
,
"empty.tmp"
,
&
i
));
must_be_true
(
i
==
5
);
must_pass
(
git_config_del
(
cfg
,
"empty.tmp"
));
git_config_free
(
cfg
);
END_TEST
BEGIN_TEST
(
config16
,
"add a variable in a new section"
)
git_config
*
cfg
;
int
i
;
/* By freeing the config, we make sure we flush the values */
must_pass
(
git_config_open_ondisk
(
&
cfg
,
CONFIG_BASE
"/config10"
));
must_pass
(
git_config_set_int
(
cfg
,
"section.tmp"
,
5
));
must_pass
(
git_config_get_int
(
cfg
,
"section.tmp"
,
&
i
));
must_be_true
(
i
==
5
);
must_pass
(
git_config_del
(
cfg
,
"section.tmp"
));
git_config_free
(
cfg
);
END_TEST
BEGIN_SUITE
(
config
)
ADD_TEST
(
config0
);
ADD_TEST
(
config1
);
...
...
@@ -287,4 +313,6 @@ BEGIN_SUITE(config)
ADD_TEST
(
config12
);
ADD_TEST
(
config13
);
ADD_TEST
(
config14
);
ADD_TEST
(
config15
);
ADD_TEST
(
config16
);
END_SUITE
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