parseutils-test: Move some variable declarations to avoid block braces

pull/206/head
Diego Biurrun 9 years ago
parent 52385410b7
commit a84713e70d
  1. 30
      libavutil/parseutils.c

@ -658,10 +658,9 @@ int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info
#ifdef TEST #ifdef TEST
int main(void) int main(void)
{
printf("Testing av_parse_video_rate()\n");
{ {
int i; int i;
uint8_t rgba[4];
static const char *const rates[] = { static const char *const rates[] = {
"-inf", "-inf",
"inf", "inf",
@ -689,20 +688,6 @@ int main(void)
" 21332.2324 ", " 21332.2324 ",
" -21332.2324 ", " -21332.2324 ",
}; };
for (i = 0; i < FF_ARRAY_ELEMS(rates); i++) {
int ret;
AVRational q = { 0, 0 };
ret = av_parse_video_rate(&q, rates[i]);
printf("'%s' -> %d/%d %s\n",
rates[i], q.num, q.den, ret ? "ERROR" : "OK");
}
}
printf("\nTesting av_parse_color()\n");
{
int i;
uint8_t rgba[4];
static const char *const color_names[] = { static const char *const color_names[] = {
"foo", "foo",
"red", "red",
@ -740,6 +725,18 @@ int main(void)
"red@-0.0", "red@-0.0",
}; };
printf("Testing av_parse_video_rate()\n");
for (i = 0; i < FF_ARRAY_ELEMS(rates); i++) {
int ret;
AVRational q = { 0, 0 };
ret = av_parse_video_rate(&q, rates[i]);
printf("'%s' -> %d/%d %s\n",
rates[i], q.num, q.den, ret ? "ERROR" : "OK");
}
printf("\nTesting av_parse_color()\n");
av_log_set_level(AV_LOG_DEBUG); av_log_set_level(AV_LOG_DEBUG);
for (i = 0; i < FF_ARRAY_ELEMS(color_names); i++) { for (i = 0; i < FF_ARRAY_ELEMS(color_names); i++) {
@ -747,7 +744,6 @@ int main(void)
printf("%s -> R(%d) G(%d) B(%d) A(%d)\n", printf("%s -> R(%d) G(%d) B(%d) A(%d)\n",
color_names[i], rgba[0], rgba[1], rgba[2], rgba[3]); color_names[i], rgba[0], rgba[1], rgba[2], rgba[3]);
} }
}
return 0; return 0;
} }

Loading…
Cancel
Save