diff options
author | Russell Belfer <rb@github.com> | 2014-02-04 10:01:37 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-02-04 10:01:37 -0800 |
commit | 882c7742711199f757305687c257ac97262a3a30 (patch) | |
tree | 72de2a06120aa30875cde571454e77f4441d449c /tests/index | |
parent | af4bc6615d9fe0ebcc4abb939273913bcf9aee60 (diff) | |
download | libgit2-882c7742711199f757305687c257ac97262a3a30.tar.gz |
Convert pqueue to just be a git_vector
This updates the git_pqueue to simply be a set of specialized
init/insert/pop functions on a git_vector.
To preserve the pqueue feature of having a fixed size heap, I
converted the "sorted" field in git_vectors to a more general
"flags" field so that pqueue could mix in it's own flag. This
had a bunch of ramifications because a number of places were
directly looking at the vector "sorted" field - I added a couple
new git_vector helpers (is_sorted, set_sorted) so the specific
representation of this information could be abstracted.
Diffstat (limited to 'tests/index')
-rw-r--r-- | tests/index/tests.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/index/tests.c b/tests/index/tests.c index bd90bc557..55a2f2c51 100644 --- a/tests/index/tests.c +++ b/tests/index/tests.c @@ -80,7 +80,7 @@ void test_index_tests__empty_index(void) cl_assert(index->on_disk == 0); cl_assert(git_index_entrycount(index) == 0); - cl_assert(index->entries.sorted); + cl_assert(git_vector_is_sorted(&index->entries)); git_index_free(index); } @@ -95,7 +95,7 @@ void test_index_tests__default_test_index(void) cl_assert(index->on_disk); cl_assert(git_index_entrycount(index) == index_entry_count); - cl_assert(index->entries.sorted); + cl_assert(git_vector_is_sorted(&index->entries)); entries = (git_index_entry **)index->entries.contents; @@ -118,7 +118,7 @@ void test_index_tests__gitgit_index(void) cl_assert(index->on_disk); cl_assert(git_index_entrycount(index) == index_entry_count_2); - cl_assert(index->entries.sorted); + cl_assert(git_vector_is_sorted(&index->entries)); cl_assert(index->tree != NULL); git_index_free(index); @@ -195,7 +195,7 @@ void test_index_tests__sort1(void) cl_git_pass(git_index_open(&index, "fake-index")); /* FIXME: this test is slightly dumb */ - cl_assert(index->entries.sorted); + cl_assert(git_vector_is_sorted(&index->entries)); git_index_free(index); } |