Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-29 01:04:29 +0400
committerRussell Belfer <rb@github.com>2014-05-02 20:21:32 +0400
commit240f4af321612a0fe4cf01aed75a8cb44173feb8 (patch)
treed92455ee46456a2de161b1128b0555e9a6e43401 /tests/diff/workdir.c
parent6a1ca96e4193f79c16c6a71dd8b5d576acf22e91 (diff)
Add build option for diff internal statistics
Diffstat (limited to 'tests/diff/workdir.c')
-rw-r--r--tests/diff/workdir.c12
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);