tests/t0603-sort.c


Log

Author Commit Date CI Message
Vicent Marti 2cd6d686 2010-12-10T05:53:39 Tests now run with the resources folder as a hardcoded path Each tests expects a "TEST_RESOURCES" define with the full path to the resources folder. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 44908fe7 2010-12-06T23:03:16 Change the library include file Libgit2 is now officially include as #include "<git2.h>" or indidividual files may be included as #include <git2/index.h> Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 654cd5ff 2010-12-02T21:50:28 Fix segfault in t0603 (unitialized pointer) Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti c4034e63 2010-12-02T04:31:54 Refactor all 'vector' functions into common code All the operations on the 'git_index_entry' array and the 'git_tree_entry' array have been refactored into common code in the src/vector.c file. The new vector methods support: - insertion: O(1) (avg) - deletion: O(n) - searching: O(logn) - sorting: O(logn) - r. access: O(1) Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti c3a20d5c 2010-11-14T22:11:46 Add support for 'index add' Actually add files to the index by creating their corresponding blob and storing it on the repository, then getting the hash and updating the index file. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 1795f879 2010-11-05T03:20:17 Improve error handling All initialization functions now return error codes instead of pointers. Error codes are now properly propagated on most functions. Several new and more specific error codes have been added in common.h Signed-off-by: Vicent Marti <tanoku@gmail.com>
Vicent Marti 6fd195d7 2010-11-02T18:42:42 Change git_repository initialization to use a path The constructor to git_repository is now called 'git_repository_open(path)' and takes a path to a git repository instead of an existing ODB object. Unit tests have been updated accordingly and the two test repositories have been merged into one. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Ramsay Jones 2d16373c 2010-10-12T19:12:50 msvc: Fix an "conversion, possible loss of data" warning In particular, msvc complains thus: t0603-sort.c(23) : warning C4244: 'function' : conversion from \ 'time_t' to 'unsigned int', possible loss of data Note that msvc, by default, defines time_t as a 64-bit type, whereas srand() is expecting an (32-bit) unsigned int. In order to suppress the warning, we simply cast the return value of the time() function call to 'unsigned int'. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Vicent Marti ff17642d 2010-07-19T15:35:52 Add unit tests for index manipulation Three new unit tests, t06XX files have been added. t0601-read: tests for loading index files from disk, for creating in-memory indexes and for accessing index entries. t0602-write: tests for writing index files back to disk t0603-sort: tests for properly sorting the entries array of an index Two test indexes have been added in 'tests/resources/': test/resources/index: a sample index from a libgit2 repository test/resources/gitgit.index: a sample index from a git.git repository (includes TREE extension data) Signed-off-by: Vicent Marti <tanoku@gmail.com>