git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GSoC][PATCH] t: migrate helper/test-oidmap.c to unit-tests/t-oidmap.c

From
Pphillip.wood123@gmail.com <phillip.wood123@gmail.com>
Date
Jun 26, 2024, 08:59 UTC
Message-ID
<360290b2-f9eb-4a12-9832-1bb53ff455ef@gmail.com>
In-Reply-To
<D29C89BS8UEJ.14F33FD8XJATD@gmail.com>
Hi Ghanshyam
On 25/06/2024 20:16, Ghanshyam Thakkar wrote:
Show 13 quoted lines
> Phillip Wood <phillip.wood123@gmail.com> wrote:
>> When writing unit tests it is important to make sure that they fail,
>> rather than just return early if there is an error. There are a number
>> of places like this that return early without calling one of the check()
>> macros to make the test fail.
> 
> They do fail. `get_oid_arbitrary_hex()` from 'unit-tests/lib-oid.h' is
> a function specifically built for the use in unit tests. And it
> contains in built `check_*` to ensure that the tests fails if something
> goes wrong and also prints diagnostic info. Maybe we can add a check here
> as well to know the line number at which the call failed, but since we
> already print queried hex value and other diagnostic info from
> `get_oid_arbitrary_hex()`, I thought it would be enough.

Oh, sorry I didn't realize that. I agree that the check in get_oid_arbitary_hex() should be sufficient.

Best Wishes
Phillip
Previous: Ghanshyam ThakkarNext: Ghanshyam Thakkar
Message 6 of 16 in “t: migrate helper/test-oidmap.c to unit-tests/t-oidmap.c”
  1. Ghanshyam ThakkarJun 19, 2024
  2. Jonathan NiederJun 20, 2024
  3. Ghanshyam ThakkarJun 25, 2024
  4. Phillip WoodJun 25, 2024
  5. Ghanshyam ThakkarJun 25, 2024
  6. phillip.wood123@gmail.comJun 26, 2024
  7. [GSoC][PATCH v2] t: migrate helper/test-oidmap.c to unit-tests/t-oidmap.cGhanshyam Thakkar, Jun 28, 2024
  8. Josh SteadmonJul 1, 2024
  9. Junio C HamanoJul 1, 2024
  10. Junio C HamanoJul 1, 2024
  11. Junio C HamanoJul 1, 2024
  12. Ghanshyam ThakkarJul 2, 2024
  13. Phillip WoodJul 2, 2024
  14. Phillip WoodJul 2, 2024
  15. Ghanshyam ThakkarJul 2, 2024
  16. Junio C HamanoJul 2, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.