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
5490c9d4
Commit
5490c9d4
authored
Oct 16, 2014
by
Alan Rogers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test to make sure a new snapshot has the new value.
parent
e0383fa3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
+14
-1
tests/config/snapshot.c
+14
-1
No files found.
tests/config/snapshot.c
View file @
5490c9d4
...
...
@@ -3,7 +3,7 @@
void
test_config_snapshot__create_snapshot
(
void
)
{
int32_t
tmp
;
git_config
*
cfg
,
*
snapshot
;
git_config
*
cfg
,
*
snapshot
,
*
new_snapshot
;
const
char
*
filename
=
"config-ext-change"
;
cl_git_mkfile
(
filename
,
"[old]
\n
value = 5
\n
"
);
...
...
@@ -24,6 +24,19 @@ void test_config_snapshot__create_snapshot(void)
cl_git_pass
(
git_config_get_int32
(
&
tmp
,
snapshot
,
"old.value"
));
cl_assert_equal_i
(
5
,
tmp
);
/* Change the value on the file itself (simulate external process) */
cl_git_mkfile
(
filename
,
"[old]
\n
value = 99
\n
"
);
cl_git_pass
(
git_config_snapshot
(
&
new_snapshot
,
cfg
));
/* New snapshot should see new value */
cl_git_pass
(
git_config_get_int32
(
&
tmp
,
new_snapshot
,
"old.value"
));
cl_assert_equal_i
(
99
,
tmp
);
/* Old snapshot should still have the old value */
cl_git_pass
(
git_config_get_int32
(
&
tmp
,
snapshot
,
"old.value"
));
cl_assert_equal_i
(
5
,
tmp
);
git_config_free
(
snapshot
);
git_config_free
(
cfg
);
}
...
...
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