This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFAv2 2/2] Add a selftest that checks documentation invariants.


>>>>> "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:

Philippe> gdb/ChangeLog
Philippe> 	* unittests/help-doc-selftests.c: New file.
Philippe> 	* Makefile.in: Add the new file.

Thanks for doing this.

Philippe> +static void
Philippe> +broken_doc_invariant (const char *prefix, const char *name, const char *msg)
Philippe> +{
Philippe> +  fprintf_filtered (gdb_stdout,
Philippe> +		    "help doc broken invariant: command '%s%s' help doc %s\n",
Philippe> +		    prefix, name, msg);

Normally I'd probably complain about being i18n-unfriendly here, but TBH
I don't think that matters much for unit tests.

Philippe> +  /* Walk through the commands.  */
Philippe> +  for (c=commandlist;c;c=c->next)

This needs some spaces.

Philippe> +      while (*p && *p != '\n')
Philippe> +	p++;

I think this could just be "p = strchr (p, '\n')".

This is ok with those things fixed.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]