Test program usability fixes

This commit is contained in:
Laurence Withers 2011-04-15 19:03:35 +00:00
parent e0046bfb84
commit ca4b3beb5a
3 changed files with 6 additions and 30 deletions

View File

@ -48,7 +48,7 @@ then
exit 0
fi
run_test $*
run_test "$@"
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
# vim: expandtab:ts=4:sw=4

View File

@ -1,6 +1,6 @@
/* libiir/src/tests/plot_filter.c
*
* Copyright: ©2010, Laurence Withers.
* Copyright: ©20102011, Laurence Withers.
* Author: Laurence Withers <l@lwithers.me.uk>
* License: GPLv3
*/
@ -50,18 +50,7 @@ do_plot(const char* filter_desc, double samp_rat, const char* png_filename)
"set output '%s'\n"
"set multiplot layout 2,1 title \"Bode plot for filter '",
png_filename);
ret = 0;
while(*filter_desc) {
if(isspace(*filter_desc)) {
if(!ret) {
ret = 1;
putc('\n', fp);
}
} else {
putc(*filter_desc, fp);
}
++filter_desc;
}
fputs(strstr(filter_desc, "raw") ? "raw" : filter_desc, fp);
fprintf(fp, "' at %fHz\"\n"
"set grid\n"
"set logscale\n"
@ -209,7 +198,7 @@ main(int argc, char* argv[])
/* process commandline arguments */
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;
}
@ -266,6 +255,5 @@ main(int argc, char* argv[])
/* options for text editors
kate: replace-trailing-space-save true; space-indent true; tab-width 4;
vim: expandtab:ts=4:sw=4
*/

View File

@ -51,18 +51,7 @@ do_plot(const char* filter_desc, double samp_rat, const char* png_filename)
"set output '%s'\n"
"set multiplot layout 2,1 title \"Bode plot for filter '",
png_filename);
ret = 0;
while(*filter_desc) {
if(isspace(*filter_desc)) {
if(!ret) {
ret = 1;
putc('\n', fp);
}
} else {
putc(*filter_desc, fp);
}
++filter_desc;
}
fputs(strstr(filter_desc, "raw") ? "raw" : filter_desc, fp);
fprintf(fp, "' at %fHz\"\n"
"set grid\n"
"set logscale\n"
@ -142,7 +131,7 @@ main(int argc, char* argv[])
/* process commandline arguments */
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;
}
@ -201,6 +190,5 @@ main(int argc, char* argv[])
/* options for text editors
kate: replace-trailing-space-save true; space-indent true; tab-width 4;
vim: expandtab:ts=4:sw=4
*/