[PATCH 4/7] bundle-uri: unit test "key=value" parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> writes:

> +> +	init_bundle_list(&list);
> +	while (strbuf_getline(&sb, stdin) != EOF) {
> +		if (bundle_uri_parse_line(&list, sb.buf) < 0)
> +			err = error("bad line: '%s'", sb.buf);
> +	}

The command to write such a test is useful for people who
want to experiment about the feature, Thanks. On top of that,
I have a little question about the condition:

  if (bundle_uri_parse_line(&list, sb.buf) < 0)

"bundle_uri_parse_line" will call "bundle_list_update" inside, and
could get the result of it as "bundle_uri_parse_line"'s return, then
actually "bundle_list_update" could return "1", so I'm not sure but maybe
the line could modified to:

  if (bundle_uri_parse_line(&list, sb.buf))

at here.

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux