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

Re: [GSoC][PATCH v5] t: port helper/test-hashmap.c to unit-tests/t-hashmap.c

From
Christian Couder <christian.couder@gmail.com>
Date
Aug 7, 2024, 14:33 UTC
Message-ID
<CAP8UFD3VwiAbGvzgi14EcEQLX6Gs7pNy+dvZcXkPOueKpJS7HA@mail.gmail.com>
In-Reply-To
<20240803133517.73308-2-shyamthakkar001@gmail.com>

On Sat, Aug 3, 2024 at 3:35 PM Ghanshyam Thakkar <shyamthakkar001@gmail.com> wrote:

Show 27 quoted lines
>
> helper/test-hashmap.c along with t0011-hashmap.sh test the hashmap.h
> library. Migrate them to the unit testing framework for better
> debugging, runtime performance and concise code.
>
> Along with the migration, make 'add' tests from the shell script order
> agnostic in unit tests, since they iterate over entries with the same
> keys and we do not guarantee the order. This was already done for the
> 'iterate' tests[1].
>
> The helper/test-hashmap.c is still not removed because it contains a
> performance test meant to be run by the user directly (not used in
> t/perf). And it makes sense for such a utility to be a helper.
>
> [1]: e1e7a77141 (t: sort output of hashmap iteration, 2019-07-30)
>
> Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
> Helped-by: Josh Steadmon <steadmon@google.com>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Helped-by: Phillip Wood <phillip.wood123@gmail.com>
> Signed-off-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com>
> ---
> Changes in v5:
> - modify one of the inputs and queries inside t_get() to better check
>   ignore-case scenario. This should address the comments from
>   Christian in v4.

Yes, the only comment I had about the patch itself is addressed. There were also comments about the email author, but that is fixed too.

> Range-diff against v4:

Nit (not worth a reroll): the range-diff usually goes before the actual patch in the section starting with a line containing only 3 dashes

Show 18 quoted lines
> 1:  04022c4cb9 ! 1:  49cb2db9c8 t: port helper/test-hashmap.c to unit-tests/t-hashmap.c
>     @@ t/unit-tests/t-hashmap.c (new)
>      +  const char *key_val[][2] = { { "key1", "value1" },
>      +                               { "key2", "value2" },
>      +                               { "fooBarFrotz", "value3" },
>     -+                               { ignore_case ? "TeNor" : "tenor",
>     -+                                 ignore_case ? "value4" : "value5" } };
>     ++                               { ignore_case ? "key4" : "foobarfrotz",
>     ++                                 "value4" } };
>      +  const char *query[][2] = {
>      +          { ignore_case ? "Key1" : "key1", "value1" },
>      +          { ignore_case ? "keY2" : "key2", "value2" },
>      +          { ignore_case ? "FOObarFrotz" : "fooBarFrotz", "value3" },
>     -+          { ignore_case ? "TENOR" : "tenor",
>     -+            ignore_case ? "value4" : "value5" }
>     ++          { ignore_case ? "FOObarFrotz" : "foobarfrotz",
>     ++            ignore_case ? "value3" : "value4" }
>      +  };
Yeah, the above are the changes I suggested.

With this all the suggestions made by others and me have been taken into account and this patch should be good to go.

Thanks.
Previous: Ghanshyam ThakkarNext: Ghanshyam Thakkar
Message 18 of 20 in “t: port helper/test-hashmap.c to unit-tests/t-hashmap.c”
  1. Ghanshyam ThakkarJun 28, 2024
  2. [GSoC][PATCH v2] t: port helper/test-hashmap.c to unit-tests/t-hashmap.cGhanshyam Thakkar, Jul 8, 2024
  3. Josh SteadmonJul 9, 2024
  4. Junio C HamanoJul 9, 2024
  5. Ghanshyam ThakkarJul 10, 2024
  6. Ghanshyam ThakkarJul 9, 2024
  7. Phillip WoodJul 10, 2024
  8. Ghanshyam ThakkarJul 11, 2024
  9. [GSoC][PATCH v3] t: port helper/test-hashmap.c to unit-tests/t-hashmap.cGhanshyam Thakkar, Jul 11, 2024
  10. Ghanshyam ThakkarJul 12, 2024
  11. Junio C HamanoJul 12, 2024
  12. Christian CouderJul 25, 2024
  13. t: port helper/test-hashmap.c to unit-tests/t-hashmap.cA U Thor, Jul 30, 2024
  14. Christian CouderJul 31, 2024
  15. Junio C HamanoJul 31, 2024
  16. Ghanshyam ThakkarAug 2, 2024
  17. [GSoC][PATCH v5] t: port helper/test-hashmap.c to unit-tests/t-hashmap.cGhanshyam Thakkar, Aug 3, 2024
  18. Christian CouderAug 7, 2024
  19. Ghanshyam ThakkarAug 7, 2024
  20. Junio C HamanoAug 7, 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.