]> git.saurik.com Git - apple/xnu.git/blame_incremental - tools/tests/perf_index/perfindex-iperf.c
xnu-4903.241.1.tar.gz
[apple/xnu.git] / tools / tests / perf_index / perfindex-iperf.c
... / ...
CommitLineData
1#include "perf_index.h"
2#include "fail.h"
3#include <stdio.h>
4#include <stdlib.h>
5
6DECL_SETUP {
7 VERIFY(test_argc > 0, "missing argument");
8
9 return PERFINDEX_SUCCESS;
10}
11
12DECL_TEST {
13 char* cmd;
14 int retval;
15
16 retval = asprintf(&cmd, "iperf -c \"%s\" -n %lld > /dev/null", test_argv[0], length);
17 VERIFY(retval > 0, "asprintf failed");
18
19 retval = system(cmd);
20 VERIFY(retval == 0, "iperf command failed");
21
22 return PERFINDEX_SUCCESS;
23}