diff options
author | Russell Belfer <rb@github.com> | 2014-04-28 14:04:29 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-05-02 09:21:32 -0700 |
commit | 240f4af321612a0fe4cf01aed75a8cb44173feb8 (patch) | |
tree | d92455ee46456a2de161b1128b0555e9a6e43401 /tests/diff/workdir.c | |
parent | 6a1ca96e4193f79c16c6a71dd8b5d576acf22e91 (diff) | |
download | libgit2-240f4af321612a0fe4cf01aed75a8cb44173feb8.tar.gz |
Add build option for diff internal statistics
Diffstat (limited to 'tests/diff/workdir.c')
-rw-r--r-- | tests/diff/workdir.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/diff/workdir.c b/tests/diff/workdir.c index 6128e820e..03a3ff418 100644 --- a/tests/diff/workdir.c +++ b/tests/diff/workdir.c @@ -2,6 +2,11 @@ #include "diff_helpers.h" #include "repository.h" +#ifdef GIT_PERF +/* access to diff usage statistics */ +# include "diff.h" +#endif + static git_repository *g_repo = NULL; void test_diff_workdir__initialize(void) @@ -58,6 +63,13 @@ void test_diff_workdir__to_index(void) cl_assert_equal_i(5, exp.line_ctxt); cl_assert_equal_i(4, exp.line_adds); cl_assert_equal_i(5, exp.line_dels); + +#ifdef GIT_PERF + cl_assert_equal_sz( + 13 /* in root */ + 3 /* in subdir */, diff->stat_calls); + cl_assert_equal_sz(9, diff->oid_calculations); + cl_assert_equal_sz(2, diff->submodule_lookups); +#endif } git_diff_free(diff); |