From: phillip.wood123@gmail.com Date: Fri, 21 Feb 2025 14:50:51 GMT Subject: Re: [PATCH 1/5] t/unit-tests: implement oid helper functions in unit-tests.{c,h} Message-ID: In-Reply-To: <20250220082959.10854-2-kuforiji98@gmail.com> Hi Seyi On 20/02/2025 08:29, Seyi Kuforiji wrote: > +static void cl_parse_oid(const char *hex, struct object_id *oid, > + const struct git_hash_algo *algop) > +{ > + int ret; > + size_t sz = strlen(hex); > + struct strbuf buf = STRBUF_INIT; > + > + cl_assert(sz <= algop->hexsz); > + > + strbuf_add(&buf, hex, sz); > + strbuf_addchars(&buf, '0', algop->hexsz - sz); > + > + ret = get_oid_hex_algop(buf.buf, oid, algop); > + cl_assert_equal_i(ret, 0); These last two lines would be better written as cl_assert_equal_i(get_oid_hex_algop(buf.buf, oid, algop), 0); So that if it fails the message shows which function was being called Best Wishes Phillip