Test program usability fixes
This commit is contained in:
parent
e0046bfb84
commit
ca4b3beb5a
|
@ -48,7 +48,7 @@ then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_test $*
|
run_test "$@"
|
||||||
|
|
||||||
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
||||||
# vim: expandtab:ts=4:sw=4
|
# vim: expandtab:ts=4:sw=4
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* libiir/src/tests/plot_filter.c
|
/* libiir/src/tests/plot_filter.c
|
||||||
*
|
*
|
||||||
* Copyright: ©2010, Laurence Withers.
|
* Copyright: ©2010–2011, Laurence Withers.
|
||||||
* Author: Laurence Withers <l@lwithers.me.uk>
|
* Author: Laurence Withers <l@lwithers.me.uk>
|
||||||
* License: GPLv3
|
* License: GPLv3
|
||||||
*/
|
*/
|
||||||
|
@ -50,18 +50,7 @@ do_plot(const char* filter_desc, double samp_rat, const char* png_filename)
|
||||||
"set output '%s'\n"
|
"set output '%s'\n"
|
||||||
"set multiplot layout 2,1 title \"Bode plot for filter '",
|
"set multiplot layout 2,1 title \"Bode plot for filter '",
|
||||||
png_filename);
|
png_filename);
|
||||||
ret = 0;
|
fputs(strstr(filter_desc, "raw") ? "raw" : filter_desc, fp);
|
||||||
while(*filter_desc) {
|
|
||||||
if(isspace(*filter_desc)) {
|
|
||||||
if(!ret) {
|
|
||||||
ret = 1;
|
|
||||||
putc('\n', fp);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
putc(*filter_desc, fp);
|
|
||||||
}
|
|
||||||
++filter_desc;
|
|
||||||
}
|
|
||||||
fprintf(fp, "' at %fHz\"\n"
|
fprintf(fp, "' at %fHz\"\n"
|
||||||
"set grid\n"
|
"set grid\n"
|
||||||
"set logscale\n"
|
"set logscale\n"
|
||||||
|
@ -209,7 +198,7 @@ main(int argc, char* argv[])
|
||||||
|
|
||||||
/* process commandline arguments */
|
/* process commandline arguments */
|
||||||
if(argc == 2 && !strcmp(argv[1], "--print-summary")) {
|
if(argc == 2 && !strcmp(argv[1], "--print-summary")) {
|
||||||
fputs("Generates Bode plot for a filter.\n", stdout);
|
fputs("Generates Bode plot for a filter (simulation method).\n", stdout);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,6 +255,5 @@ main(int argc, char* argv[])
|
||||||
|
|
||||||
|
|
||||||
/* options for text editors
|
/* options for text editors
|
||||||
kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
|
||||||
vim: expandtab:ts=4:sw=4
|
vim: expandtab:ts=4:sw=4
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -51,18 +51,7 @@ do_plot(const char* filter_desc, double samp_rat, const char* png_filename)
|
||||||
"set output '%s'\n"
|
"set output '%s'\n"
|
||||||
"set multiplot layout 2,1 title \"Bode plot for filter '",
|
"set multiplot layout 2,1 title \"Bode plot for filter '",
|
||||||
png_filename);
|
png_filename);
|
||||||
ret = 0;
|
fputs(strstr(filter_desc, "raw") ? "raw" : filter_desc, fp);
|
||||||
while(*filter_desc) {
|
|
||||||
if(isspace(*filter_desc)) {
|
|
||||||
if(!ret) {
|
|
||||||
ret = 1;
|
|
||||||
putc('\n', fp);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
putc(*filter_desc, fp);
|
|
||||||
}
|
|
||||||
++filter_desc;
|
|
||||||
}
|
|
||||||
fprintf(fp, "' at %fHz\"\n"
|
fprintf(fp, "' at %fHz\"\n"
|
||||||
"set grid\n"
|
"set grid\n"
|
||||||
"set logscale\n"
|
"set logscale\n"
|
||||||
|
@ -142,7 +131,7 @@ main(int argc, char* argv[])
|
||||||
|
|
||||||
/* process commandline arguments */
|
/* process commandline arguments */
|
||||||
if(argc == 2 && !strcmp(argv[1], "--print-summary")) {
|
if(argc == 2 && !strcmp(argv[1], "--print-summary")) {
|
||||||
fputs("Generates Bode plot for a filter.\n", stdout);
|
fputs("Generates Bode plot for a filter (Z transform method).\n", stdout);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,6 +190,5 @@ main(int argc, char* argv[])
|
||||||
|
|
||||||
|
|
||||||
/* options for text editors
|
/* options for text editors
|
||||||
kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
|
||||||
vim: expandtab:ts=4:sw=4
|
vim: expandtab:ts=4:sw=4
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue