diff options
| author | Russell Belfer <rb@github.com> | 2013-04-19 12:48:33 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-04-21 11:50:55 -0700 |
| commit | 83cc70d9fec5f81d07f9fc4133c9515527efb9af (patch) | |
| tree | a3ddac356c641e6accf8396d08afbebb7bb52336 /tests-clar/odb | |
| parent | 83041c711cd7d9fccb7a1327e642ce33f0705370 (diff) | |
| download | libgit2-83cc70d9fec5f81d07f9fc4133c9515527efb9af.tar.gz | |
Move odb_backend implementors stuff into git2/sys
This moves some of the odb_backend stuff that is related to the
internals of an odb_backend implementation into include/git2/sys.
Some of the stuff related to streaming I left in include/git2
because it seemed like it would be reasonably needed by a normal
user who wanted to stream objects into and out of the ODB.
Also, I added APIs for traversing the list of backends so that
some of the tests would not need to access ODB internals.
Diffstat (limited to 'tests-clar/odb')
| -rw-r--r-- | tests-clar/odb/packed_one.c | 3 | ||||
| -rw-r--r-- | tests-clar/odb/sorting.c | 18 |
2 files changed, 10 insertions, 11 deletions
diff --git a/tests-clar/odb/packed_one.c b/tests-clar/odb/packed_one.c index e9d246c23..4f9bde9ed 100644 --- a/tests-clar/odb/packed_one.c +++ b/tests-clar/odb/packed_one.c @@ -1,5 +1,6 @@ #include "clar_libgit2.h" -#include "odb.h" +#include "git2/odb_backend.h" + #include "pack_data_one.h" #include "pack.h" diff --git a/tests-clar/odb/sorting.c b/tests-clar/odb/sorting.c index b4f9e44bc..147a160c8 100644 --- a/tests-clar/odb/sorting.c +++ b/tests-clar/odb/sorting.c @@ -1,13 +1,12 @@ #include "clar_libgit2.h" -#include "git2/odb_backend.h" -#include "odb.h" +#include "git2/sys/odb_backend.h" typedef struct { git_odb_backend base; - int position; + size_t position; } fake_backend; -static git_odb_backend *new_backend(int position) +static git_odb_backend *new_backend(size_t position) { fake_backend *b; @@ -22,14 +21,13 @@ static git_odb_backend *new_backend(int position) static void check_backend_sorting(git_odb *odb) { - unsigned int i; - - for (i = 0; i < odb->backends.length; ++i) { - fake_backend *internal = - *((fake_backend **)git_vector_get(&odb->backends, i)); + size_t i, max_i = git_odb_num_backends(odb); + fake_backend *internal; + for (i = 0; i < max_i; ++i) { + cl_git_pass(git_odb_get_backend((git_odb_backend **)&internal, odb, i)); cl_assert(internal != NULL); - cl_assert(internal->position == (int)i); + cl_assert_equal_sz(i, internal->position); } } |
