[U-Boot] [PATCH v3 4/4] sandbox: Add basic test for command execution

Mike Frysinger vapier at gentoo.org
Sun Apr 1 21:53:36 CEST 2012


On Saturday 31 March 2012 03:30:58 Simon Glass wrote:
> --- /dev/null
> +++ b/test/Makefile
>
> +include $(TOPDIR)/config.mk
> +
> +LIB	= $(obj)libtest.o
> +
> +COBJS-$(CONFIG_SANDBOX) += command_ut.o
> +
> +COBJS	:= $(sort $(COBJS-y))

that sort actually needed ?

> +SRCS	:= $(COBJS:.o=.c)
> +OBJS	:= $(addprefix $(obj),$(COBJS))
> +
> +all:	$(LIB) $(XOBJS)

$(XOBJS) is dead code

> --- /dev/null
> +++ b/test/command_ut.c
>
> +#define DEBUG

should comment why you've always defined this

> +static const char test_cmd[] = "setenv list 1\n setenv list ${list}2; "
> +		"setenv list ${list}3\0"
> +		"setenv list ${list}4";

i'd put the first string on a new line too to make it easier to read

> +static int do_ut_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const

what is "ut" supposed to stand for ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120401/c96a3750/attachment.pgp>


More information about the U-Boot mailing list