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
9e2eaee5
Commit
9e2eaee5
authored
Jun 25, 2021
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: improved integer compare in stacktrace test
parent
f73f2cac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
tests/trace/windows/stacktrace.c
+10
-10
No files found.
tests/trace/windows/stacktrace.c
View file @
9e2eaee5
...
...
@@ -58,47 +58,47 @@ void test_trace_windows_stacktrace__leaks(void)
GIT_WIN32__CRTDBG_STACKTRACE__QUIET
|
GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK
,
"p1"
);
cl_assert
((
leaks
==
1
)
);
cl_assert
_equal_i
(
1
,
leaks
);
p2
=
git__malloc
(
5
);
leaks
=
git_win32__crtdbg_stacktrace__dump
(
GIT_WIN32__CRTDBG_STACKTRACE__QUIET
|
GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK
,
"p1,p2"
);
cl_assert
((
leaks
==
2
)
);
cl_assert
_equal_i
(
2
,
leaks
);
p3
=
git__malloc
(
5
);
leaks
=
git_win32__crtdbg_stacktrace__dump
(
GIT_WIN32__CRTDBG_STACKTRACE__QUIET
|
GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK
,
"p1,p2,p3"
);
cl_assert
((
leaks
==
3
)
);
cl_assert
_equal_i
(
3
,
leaks
);
git__free
(
p2
);
leaks
=
git_win32__crtdbg_stacktrace__dump
(
GIT_WIN32__CRTDBG_STACKTRACE__QUIET
|
GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK
,
"p1,p3"
);
cl_assert
((
leaks
==
2
)
);
cl_assert
_equal_i
(
2
,
leaks
);
/* move the mark. only new leaks should appear afterwards */
error
=
git_win32__crtdbg_stacktrace__dump
(
GIT_WIN32__CRTDBG_STACKTRACE__SET_MARK
,
NULL
);
cl_assert
((
error
==
0
)
);
cl_assert
_equal_i
(
0
,
error
);
leaks
=
git_win32__crtdbg_stacktrace__dump
(
GIT_WIN32__CRTDBG_STACKTRACE__QUIET
|
GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK
,
"not_p1,not_p3"
);
cl_assert
((
leaks
==
0
)
);
cl_assert
_equal_i
(
0
,
leaks
);
p4
=
git__malloc
(
5
);
leaks
=
git_win32__crtdbg_stacktrace__dump
(
GIT_WIN32__CRTDBG_STACKTRACE__QUIET
|
GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK
,
"p4,not_p1,not_p3"
);
cl_assert
((
leaks
==
1
)
);
cl_assert
_equal_i
(
1
,
leaks
);
git__free
(
p1
);
git__free
(
p3
);
...
...
@@ -106,21 +106,21 @@ void test_trace_windows_stacktrace__leaks(void)
GIT_WIN32__CRTDBG_STACKTRACE__QUIET
|
GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK
,
"p4"
);
cl_assert
((
leaks
==
1
)
);
cl_assert
_equal_i
(
1
,
leaks
);
git__free
(
p4
);
leaks
=
git_win32__crtdbg_stacktrace__dump
(
GIT_WIN32__CRTDBG_STACKTRACE__QUIET
|
GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK
,
"end"
);
cl_assert
((
leaks
==
0
)
);
cl_assert
_equal_i
(
0
,
leaks
);
/* confirm current absolute leaks count matches beginning value. */
after
=
git_win32__crtdbg_stacktrace__dump
(
GIT_WIN32__CRTDBG_STACKTRACE__QUIET
|
GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_TOTAL
,
"total"
);
cl_assert
((
before
==
after
)
);
cl_assert
_equal_i
(
before
,
after
);
#endif
}
...
...
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