<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/unit-tests/lib-oid.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-02-25T18:31:22Z</updated>
<entry>
<title>t/unit-tests: implement clar specific oid helper functions</title>
<updated>2025-02-25T18:31:22Z</updated>
<author>
<name>Seyi Kuforiji</name>
<email>kuforiji98@gmail.com</email>
</author>
<published>2025-02-25T10:10:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a16a2ee312b088ae6ac2ab3302ed191d19a71718'/>
<id>urn:sha1:a16a2ee312b088ae6ac2ab3302ed191d19a71718</id>
<content type='text'>
`get_oid_arbitrary_hex()` and `init_hash_algo()` are both required for
oid-related tests to run without errors. In the current implementation,
both functions are defined and declared in the
`t/unit-tests/lib-oid.{c,h}` which is utilized by oid-related tests in
the homegrown unit tests structure.

Adapt functions in lib-oid.{c,h} to use clar. Both these functions
become available for oid-related test files implemented using the clar
testing framework, which requires them. This will be used by subsequent
commits.

Mentored-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Seyi Kuforiji &lt;kuforiji98@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t: port helper/test-oid-array.c to unit-tests/t-oid-array.c</title>
<updated>2024-09-02T03:43:38Z</updated>
<author>
<name>Ghanshyam Thakkar</name>
<email>shyamthakkar001@gmail.com</email>
</author>
<published>2024-09-01T21:26:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a680635e05848f4428b4867b7e7ad0e07c94ae8b'/>
<id>urn:sha1:a680635e05848f4428b4867b7e7ad0e07c94ae8b</id>
<content type='text'>
helper/test-oid-array.c along with t0064-oid-array.sh test the
oid-array.h API, which provides storage and processing
efficiency over large lists of object identifiers.

Migrate them to the unit testing framework for better runtime
performance and efficiency. As we don't initialize a repository
in these tests, the hash algo that functions like oid_array_lookup()
use is not initialized, therefore call repo_set_hash_algo() to
initialize it. And init_hash_algo():lib-oid.c can aid in this
process, so make it public.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored-by: Kaartic Sivaraam &lt;kaartic.sivaraam@gmail.com&gt;
Helped-by: Phillip Wood &lt;phillip.wood123@gmail.com&gt;
Signed-off-by: Ghanshyam Thakkar &lt;shyamthakkar001@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/: migrate helper/test-oidtree.c to unit-tests/t-oidtree.c</title>
<updated>2024-06-12T20:33:20Z</updated>
<author>
<name>Ghanshyam Thakkar</name>
<email>shyamthakkar001@gmail.com</email>
</author>
<published>2024-06-08T16:57:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed548408723d6e969160279398cc47f88f5700bc'/>
<id>urn:sha1:ed548408723d6e969160279398cc47f88f5700bc</id>
<content type='text'>
helper/test-oidtree.c along with t0069-oidtree.sh test the oidtree.h
library, which is a wrapper around crit-bit tree. Migrate them to
the unit testing framework for better debugging and runtime
performance. Along with the migration, add an extra check for
oidtree_each() test, which showcases how multiple expected matches can
be given to check_each() helper.

To achieve this, introduce a new library called 'lib-oid.h'
exclusively for the unit tests to use. It currently mainly includes
utility to generate object_id from an arbitrary hex string
(i.e. '12a' -&gt; '12a0000000000000000000000000000000000000'). This also
handles the hash algo selection based on GIT_TEST_DEFAULT_HASH.
This library will also be helpful when we port other unit tests such
as oid-array, oidset etc.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored-by: Kaartic Sivaraam &lt;kaartic.sivaraam@gmail.com&gt;
Signed-off-by: Ghanshyam Thakkar &lt;shyamthakkar001@gmail.com&gt;
[jc: small fixlets squashed in]
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
