Rev 4227 | Rev 4252 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4227 | Rev 4229 | ||
---|---|---|---|
Line 1133... | Line 1133... | ||
1133 | int cmd_bench(cmd_arg_t *argv) |
1133 | int cmd_bench(cmd_arg_t *argv) |
1134 | { |
1134 | { |
1135 | test_t *test; |
1135 | test_t *test; |
1136 | uint32_t cnt = argv[1].intval; |
1136 | uint32_t cnt = argv[1].intval; |
1137 | 1137 | ||
1138 | bool fnd = false; |
1138 | if (str_cmp((char *) argv->buffer, "*") == 0) { |
1139 | - | ||
1140 | for (test = tests; test->name != NULL; test++) { |
1139 | for (test = tests; test->name != NULL; test++) { |
1141 | if (str_cmp(test->name, (char *) argv->buffer) == 0) { |
- | |
1142 | fnd = true; |
- | |
1143 | - | ||
1144 | if (test->safe) |
1140 | if (test->safe) { |
1145 | run_bench(test, cnt); |
1141 | if (!run_bench(test, cnt)) |
1146 | else |
1142 | break; |
1147 | printf("Unsafe test\n"); |
- | |
1148 | 1143 | } |
|
1149 | break; |
- | |
1150 | } |
1144 | } |
1151 | } |
1145 | } else { |
- | 1146 | bool fnd = false; |
|
1152 | 1147 | ||
- | 1148 | for (test = tests; test->name != NULL; test++) { |
|
- | 1149 | if (str_cmp(test->name, (char *) argv->buffer) == 0) { |
|
- | 1150 | fnd = true; |
|
- | 1151 | ||
- | 1152 | if (test->safe) |
|
- | 1153 | run_bench(test, cnt); |
|
- | 1154 | else |
|
- | 1155 | printf("Unsafe test\n"); |
|
- | 1156 | ||
- | 1157 | break; |
|
- | 1158 | } |
|
- | 1159 | } |
|
- | 1160 | ||
1153 | if (!fnd) |
1161 | if (!fnd) |
1154 | printf("Unknown test\n"); |
1162 | printf("Unknown test\n"); |
- | 1163 | } |
|
1155 | 1164 | ||
1156 | return 1; |
1165 | return 1; |
1157 | } |
1166 | } |
1158 | 1167 | ||
1159 | #endif |
1168 | #endif |