From cfe91ed582a8947d6cdd5eee0bd3199f3ea265fa Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 31 Oct 2011 18:42:29 +0000 Subject: Add test cases for command-line parsing Preparation for refactoring command-line parsing. All these test cases pass. Signed-off-by: Ben Hutchings --- ethtool.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ethtool.c') diff --git a/ethtool.c b/ethtool.c index b6f535c..7a26043 100644 --- a/ethtool.c +++ b/ethtool.c @@ -3444,8 +3444,13 @@ static int do_setfwdump(struct cmd_context *ctx) int send_ioctl(struct cmd_context *ctx, void *cmd) { +#ifndef TEST_ETHTOOL ctx->ifr.ifr_data = cmd; return ioctl(ctx->fd, SIOCETHTOOL, &ctx->ifr); +#else + /* If we get this far then parsing succeeded */ + exit(0); +#endif } int main(int argc, char **argp, char **envp) -- cgit v1.2.1