summaryrefslogtreecommitdiff
path: root/tests/t06-index.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-02-28 12:46:13 +0200
committerVicent Marti <tanoku@gmail.com>2011-03-03 20:23:52 +0200
commit86d7e1ca6f54161a9e4d1ebe7a2f8e4802dc9639 (patch)
tree88d9d0fc4a7dbeec37f863b47200c0c55e8ffcf4 /tests/t06-index.c
parent5de079b86dcf8744f71fa3d0bb496a2cf9b20c0d (diff)
downloadlibgit2-86d7e1ca6f54161a9e4d1ebe7a2f8e4802dc9639.tar.gz
Fix searching in git_vector
We now store only one sorting callback that does entry comparison. This is used when sorting the entries using a quicksort, and when looking for a specific entry with the new search methods. The following search methods now exist: git_vector_search(vector, entry) git_vector_search2(vector, custom_search_callback, key) git_vector_bsearch(vector, entry) git_vector_bsearch2(vector, custom_search_callback, key) The sorting state of the vector is now stored internally. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'tests/t06-index.c')
-rw-r--r--tests/t06-index.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/t06-index.c b/tests/t06-index.c
index 0c748cc8d..19b4da5c2 100644
--- a/tests/t06-index.c
+++ b/tests/t06-index.c
@@ -55,7 +55,7 @@ BEGIN_TEST(read0, "load an empty index")
must_be_true(index->on_disk == 0);
must_be_true(git_index_entrycount(index) == 0);
- must_be_true(index->sorted);
+ must_be_true(index->entries.sorted);
git_index_free(index);
END_TEST
@@ -72,7 +72,7 @@ BEGIN_TEST(read1, "load a standard index (default test index)")
must_be_true(index->on_disk);
must_be_true(git_index_entrycount(index) == TEST_INDEX_ENTRY_COUNT);
- must_be_true(index->sorted);
+ must_be_true(index->entries.sorted);
entries = (git_index_entry **)index->entries.contents;
@@ -97,7 +97,7 @@ BEGIN_TEST(read2, "load a standard index (git.git index)")
must_be_true(index->on_disk);
must_be_true(git_index_entrycount(index) == TEST_INDEX2_ENTRY_COUNT);
- must_be_true(index->sorted);
+ must_be_true(index->entries.sorted);
must_be_true(index->tree != NULL);
git_index_free(index);
@@ -168,7 +168,7 @@ BEGIN_TEST(sort1, "sort the entires in an empty index")
must_pass(git_index_open_bare(&index, "fake-index"));
/* FIXME: this test is slightly dumb */
- must_be_true(index->sorted);
+ must_be_true(index->entries.sorted);
git_index_free(index);
END_TEST