diff options
| author | Patrick Steinhardt <ps@pks.im> | 2017-06-12 14:53:46 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2017-06-12 17:24:53 +0200 |
| commit | 2add34d0fbe47e44d17912e2431f57c6935026ef (patch) | |
| tree | 071822b65462d52ab86e8bc775010a46ddf61ccf /tests/odb/backend/backend_helpers.h | |
| parent | 9927e9587aff31c85916028ae9bee2a21a413a8f (diff) | |
| download | libgit2-2add34d0fbe47e44d17912e2431f57c6935026ef.tar.gz | |
tests: odb: move fake backend into its own file
The fake backend used by the test suite `odb::backend::nonrefreshing` is
useful to have some low-level tests for the ODB layer. As such, we move
the implementation into its own `backend_helpers` module.
Diffstat (limited to 'tests/odb/backend/backend_helpers.h')
| -rw-r--r-- | tests/odb/backend/backend_helpers.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/odb/backend/backend_helpers.h b/tests/odb/backend/backend_helpers.h new file mode 100644 index 000000000..04bd844b2 --- /dev/null +++ b/tests/odb/backend/backend_helpers.h @@ -0,0 +1,18 @@ +#include "git2/sys/odb_backend.h" + +typedef struct { + git_odb_backend parent; + + git_error_code error_code; + git_oid oid; + + int exists_calls; + int read_calls; + int read_header_calls; + int read_prefix_calls; +} fake_backend; + +int build_fake_backend( + git_odb_backend **out, + git_error_code error_code, + const git_oid *oid); |
