summaryrefslogtreecommitdiff
path: root/ethtool.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-10-31 18:42:29 +0000
committerBen Hutchings <bhutchings@solarflare.com>2011-11-03 19:12:55 +0000
commitcfe91ed582a8947d6cdd5eee0bd3199f3ea265fa (patch)
treef346c604f9cba5d150f7f82a0732af852d5b6106 /ethtool.c
parent37897ca86845ac9f8df16ca424477baa3ac8c389 (diff)
downloadethtool-cfe91ed582a8947d6cdd5eee0bd3199f3ea265fa.tar.gz
Add test cases for command-line parsing
Preparation for refactoring command-line parsing. All these test cases pass. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'ethtool.c')
-rw-r--r--ethtool.c5
1 files changed, 5 insertions, 0 deletions
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)