test-args.c

Go to the documentation of this file.
00001 #include "config.h"
00002 
00003 #include "headers.h"
00004 #include "types.h"
00005 #include "error.h"
00006 #include "fd.h"
00007 #include "io.h"
00008 #include "display.h"
00009 #include "args.h"
00010 
00011 /*
00012 #define PRINT_DEBUG
00013 #define PRINT_ERRORS
00014 */
00015 
00016 #ifdef PRINT_DEBUG
00017 void print(void)
00018 {
00019         fprintf(stderr, "d.start_time == %llu\n", (unsigned long long)d.start_time);
00020         fprintf(stderr, "d.total_time == %llu\n", (unsigned long long)d.total_time);
00021         fprintf(stderr, "d.current_time == %llu\n", (unsigned long long)d.current_time);
00022         fprintf(stderr, "d.elapsed_time == %llu\n", (unsigned long long)d.elapsed_time);
00023         fprintf(stderr, "d.percent_complete == %d\n", (int)d.percent_complete);
00024         fprintf(stderr, "d.display_interval == %d\n", d.display_interval);
00025         fprintf(stderr, "d.overtime_flag == %d\n", d.overtime_flag);
00026         fprintf(stderr, "d.k == %d\n", d.k);
00027         fprintf(stderr, "d.twiddle == %d\n", d.twiddle);
00028         fprintf(stderr, "d.screen_width == %d\n", d.screen_width);
00029         fprintf(stderr, "d.manual_width == %d\n", d.manual_width);
00030         fprintf(stderr, "d.display_twiddle == %d\n", d.display_twiddle);
00031         fprintf(stderr, "d.display_datacount == %d\n", d.display_datacount);
00032         fprintf(stderr, "d.display_throughput == %d\n", d.display_throughput);
00033         fprintf(stderr, "d.display_time == %d\n", d.display_time);
00034         fprintf(stderr, "d.display_percent == %d\n", d.display_percent);
00035         fprintf(stderr, "d.display_bar == %d\n", d.display_bar);
00036         fprintf(stderr, "d.display_summary == %d\n", d.display_summary);
00037         fprintf(stderr, "d.display_ansi == %d\n", d.display_ansi);
00038 
00039         fprintf(stderr, "d.twiddle_fg_color == %s\n",
00040                 (d.twiddle_fg_color != 0) ? d.twiddle_fg_color+1 : "");
00041         fprintf(stderr, "d.twiddle_bg_color == %s\n",
00042                 (d.twiddle_bg_color != 0) ? d.twiddle_bg_color+1 : "");
00043         fprintf(stderr, "d.twiddle_fg_bold == %d\n", d.twiddle_fg_bold);
00044 
00045         fprintf(stderr, "d.datacount_fg_color == %s\n",
00046                 (d.datacount_fg_color != 0) ? d.datacount_fg_color+1 : "");
00047         fprintf(stderr, "d.datacount_bg_color == %s\n",
00048                 (d.datacount_bg_color != 0) ? d.datacount_bg_color+1 : "");
00049         fprintf(stderr, "d.datacount_fg_bold == %d\n", d.datacount_fg_bold);
00050 
00051         fprintf(stderr, "d.throughput_label_fg_color == %s\n",
00052                 (d.throughput_label_fg_color != 0) ? d.throughput_label_fg_color+1 : "");
00053         fprintf(stderr, "d.throughput_label_bg_color == %s\n",
00054                 (d.throughput_label_bg_color != 0) ? d.throughput_label_bg_color+1 : "");
00055         fprintf(stderr, "d.throughput_label_fg_bold == %d\n", d.throughput_label_fg_bold);
00056 
00057         fprintf(stderr, "d.throughput_fg_color == %s\n",
00058                 (d.throughput_fg_color != 0) ? d.throughput_fg_color+1 : "");
00059         fprintf(stderr, "d.throughput_bg_color == %s\n",
00060                 (d.throughput_bg_color != 0) ? d.throughput_bg_color+1 : "");
00061         fprintf(stderr, "d.throughput_fg_bold == %d\n", d.throughput_fg_bold);
00062 
00063         fprintf(stderr, "d.time_label_fg_color == %s\n",
00064                 (d.time_label_fg_color != 0) ? d.time_label_fg_color+1 : "");
00065         fprintf(stderr, "d.time_label_bg_color == %s\n",
00066                 (d.time_label_bg_color != 0) ? d.time_label_bg_color+1 : "");
00067         fprintf(stderr, "d.time_label_fg_bold == %d\n", d.time_label_fg_bold);
00068 
00069         fprintf(stderr, "d.time_fg_color == %s\n",
00070                 (d.time_fg_color != 0) ? d.time_fg_color+1 : "");
00071         fprintf(stderr, "d.time_bg_color == %s\n",
00072                 (d.time_bg_color != 0) ? d.time_bg_color+1 : "");
00073         fprintf(stderr, "d.time_fg_bold == %d\n", d.time_fg_bold);
00074 
00075         fprintf(stderr, "d.percent_fg_color == %s\n",
00076                 (d.percent_fg_color != 0) ? d.percent_fg_color+1 : "");
00077         fprintf(stderr, "d.percent_bg_color == %s\n",
00078                 (d.percent_bg_color != 0) ? d.percent_bg_color+1 : "");
00079         fprintf(stderr, "d.percent_fg_bold == %d\n", d.percent_fg_bold);
00080 
00081         fprintf(stderr, "d.barbrace_fg_color == %s\n",
00082                 (d.barbrace_fg_color != 0) ? d.barbrace_fg_color+1 : "");
00083         fprintf(stderr, "d.barbrace_bg_color == %s\n",
00084                 (d.barbrace_bg_color != 0) ? d.barbrace_bg_color+1 : "");
00085         fprintf(stderr, "d.barbrace_fg_bold == %d\n", d.barbrace_fg_bold);
00086 
00087         fprintf(stderr, "d.bar_fg_color == %s\n",
00088                 (d.bar_fg_color != 0) ? d.bar_fg_color+1 : "");
00089         fprintf(stderr, "d.bar_bg_color == %s\n",
00090                 (d.bar_bg_color != 0) ? d.bar_bg_color+1 : "");
00091         fprintf(stderr, "d.bar_fg_bold == %d\n", d.bar_fg_bold);
00092 
00093         fprintf(stderr, "io.in == %d\n", io.in);
00094         fprintf(stderr, "io.out == %d\n", io.out);
00095         fprintf(stderr, "io.in_ready == %d\n", io.in_ready);
00096         fprintf(stderr, "io.out_ready == %d\n", io.out_ready);
00097         fprintf(stderr, "io.eof_in == %d\n", io.eof_in);
00098         fprintf(stderr, "io.eof_out == %d\n", io.eof_out);
00099         fprintf(stderr, "io.buffer_size == %llu\n", (unsigned long long)io.buffer_size);
00100         /* fprintf(stderr, "io.cbuf == %p\n", io.cbuf); */
00101         fprintf(stderr, "io.last_read == %llu\n", (unsigned long long)io.last_read);
00102         fprintf(stderr, "io.last_write == %llu\n", (unsigned long long)io.last_write);
00103         fprintf(stderr, "io.total_read == %llu\n", (unsigned long long)io.total_read);
00104         fprintf(stderr, "io.total_write == %llu\n", (unsigned long long)io.total_write);
00105         fprintf(stderr, "io.total_size == %llu\n", (unsigned long long)io.total_size);
00106         fprintf(stderr, "io.total_size_known == %d\n", io.total_size_known);
00107         fprintf(stderr, "io.timeout == %llu\n", (unsigned long long)io.timeout);
00108 }
00109 #endif
00110 
00111 int test_parse(FILE *out, char* s, int r, uint64 n)
00112 {
00113         int result_r;
00114         uint64 result_n;
00115 
00116 #ifdef PRINT_ERRORS
00117         if (r != 0) {
00118                 fprintf(out, "\n");
00119                 fprintf(out, "You should see an error message here:\n");
00120                 fprintf(out, "---[ BEGIN ]-----------------------------------\n");
00121         }
00122 #endif
00123         result_r = parse_num(out, s, &result_n, 0, MAX_UINT64);
00124 #ifdef PRINT_ERRORS
00125         if (r != 0) {
00126                 fprintf(out, "---[ END ]-------------------------------------\n");
00127         }
00128 #endif
00129         if ((result_r != r) || (result_n != n)) {
00130 #ifdef PRINT_ERRORS
00131                 fprintf(out, "*** ERROR: Number parse test failed on: %s\n", s);
00132                 fprintf(out, "           Expected result: %d  Got: %d\n", r, result_r);
00133                 fprintf(out, "           Expected number: %llu\n", n);
00134                 fprintf(out, "                Got number: %llu\n", result_n);
00135 #endif
00136                 return(0);
00137         }
00138         return(1);
00139 }
00140 
00141 int test_parse_rc(FILE *out, int r)
00142 {
00143         int result_r = 0;
00144 
00145 #ifdef PRINT_ERRORS
00146         if (r != 0) {
00147                 fprintf(out, "\n");
00148                 fprintf(out, "You should see an error message here: \n");
00149                 fprintf(out, "---[ BEGIN ]-----------------------------------\n");
00150         }
00151 #endif
00152         result_r = parse_rcfile(out,"./test-rcfile.txt");
00153 #ifdef PRINT_ERRORS
00154         if (r != 0) {
00155                 fprintf(out, "---[ END ]-------------------------------------\n");
00156         }
00157 #endif
00158 
00159         return(r == result_r);
00160 }
00161 
00162 
00163 void test1(FILE *out)
00164 {
00165         uint64 k = 1000;
00166         uint64 m = k*k;
00167         uint64 e;
00168 
00169         displayInit();
00170         ioInit();
00171         d.k = k;
00172 
00173         assert(test_parse(out, "", 0, 0));
00174         assert(test_parse(out, "m", 1, 0));
00175         assert(test_parse(out, "1m1", 1, 0));
00176         assert(test_parse(out, ".m", 1, 0));
00177         assert(test_parse(out, ".0m", 0, 0));
00178         assert(test_parse(out, ".1m", 0, 0.1*m));
00179         assert(test_parse(out, ".10m", 0, 0.1*m));
00180         assert(test_parse(out, "1024.38m", 0, 1024.38*m));
00181         assert(test_parse(out, "1024.380m", 0, 1024.38*m));
00182         assert(test_parse(out, "1024.38002m", 0, 1024.38002*m));
00183 
00184         /*
00185          * The following workaround avoids the following compiler warning:
00186          * "warning: decimal constant is so large that it is unsigned" on
00187          * the number 18446744073709551615
00188          */
00189         e = 18;
00190         e *= 1000;
00191         e += 446;
00192         e *= 1000;
00193         e += 744;
00194         e *= 1000;
00195         e += 73;
00196         e *= 1000;
00197         e += 709;
00198         e *= 1000;
00199         e += 551;
00200         e *= 1000;
00201         e += 615;
00202         assert(test_parse(out, "18446744073709551615", 0, e));
00203 
00204         assert(test_parse(out, "18446744073709551616", 1, 0));
00205         assert(test_parse(out, "15.9999999999k", 0, 16000));
00206 
00207         /*
00208          * The following workaround avoids the following compiler warning:
00209          * "warning: decimal constant is so large that it is unsigned" on
00210          * the number 15999999999999999900
00211          */
00212         e = 15;
00213         e *= 1000;
00214         e += 999;
00215         e *= 1000;
00216         e += 999;
00217         e *= 1000;
00218         e += 999;
00219         e *= 1000;
00220         e += 999;
00221         e *= 1000;
00222         e += 999;
00223         e *= 1000;
00224         e += 900;
00225         assert(test_parse(out, "15.9999999999999999e", 0, e));
00226 
00227         /*
00228          * The following workaround avoids the following compiler warning:
00229          * "warning: decimal constant is so large that it is unsigned" on
00230          * the number 15999999999999999999
00231          */
00232         e = 15;
00233         e *= 1000;
00234         e += 999;
00235         e *= 1000;
00236         e += 999;
00237         e *= 1000;
00238         e += 999;
00239         e *= 1000;
00240         e += 999;
00241         e *= 1000;
00242         e += 999;
00243         e *= 1000;
00244         e += 999;
00245         assert(test_parse(out, "15.999999999999999999e", 0, e));
00246 
00247         assert(test_parse(out, "18.44674407370955161e", 0, MAX_UINT64/10*10));
00248 }
00249 
00250 void test2(FILE *out)
00251 {
00252         uint64 k = 1024;
00253         uint64 e;
00254 
00255         displayInit();
00256         ioInit();
00257         d.k = k;
00258 
00259         assert(test_parse(out, "", 0, 0));
00260         assert(test_parse(out, "m", 1, 0));
00261         assert(test_parse(out, "1m1", 1, 0));
00262         assert(test_parse(out, ".m", 1, 0));
00263         assert(test_parse(out, ".0m", 0, 0));
00264         assert(test_parse(out, ".1m", 0, 104858));
00265         assert(test_parse(out, ".10m", 0, 104858));
00266         assert(test_parse(out, "1024.38m", 0, 1074140283));
00267         assert(test_parse(out, "1024.380m", 0, 1074140283));
00268         assert(test_parse(out, "1024.38002m", 0, 1074140304));
00269 
00270         /*
00271          * The following workaround avoids the following compiler warning:
00272          * "warning: decimal constant is so large that it is unsigned" on
00273          * the number 18446744073709551615
00274          */
00275         e = 18;
00276         e *= 1000;
00277         e += 446;
00278         e *= 1000;
00279         e += 744;
00280         e *= 1000;
00281         e += 73;
00282         e *= 1000;
00283         e += 709;
00284         e *= 1000;
00285         e += 551;
00286         e *= 1000;
00287         e += 615;
00288         assert(test_parse(out, "18446744073709551615", 0, e));
00289         assert(test_parse(out, "18446744073709551616", 1, 0));
00290         assert(test_parse(out, "15.9999999999k", 0, 16384));
00291 
00292         /*
00293          * The following workaround avoids the following compiler warning:
00294          * "warning: decimal constant is so large that it is unsigned" on
00295          * the number 18446744073709551500
00296          */
00297         e = 18;
00298         e *= 1000;
00299         e += 446;
00300         e *= 1000;
00301         e += 744;
00302         e *= 1000;
00303         e += 73;
00304         e *= 1000;
00305         e += 709;
00306         e *= 1000;
00307         e += 551;
00308         e *= 1000;
00309         e += 500;
00310         assert(test_parse(out, "15.9999999999999999e", 0, e));
00311 
00312         /*
00313          * The following workaround avoids the following compiler warning:
00314          * "warning: decimal constant is so large that it is unsigned" on
00315          * the number 18446744073709551614
00316          */
00317         e = 18;
00318         e *= 1000;
00319         e += 446;
00320         e *= 1000;
00321         e += 744;
00322         e *= 1000;
00323         e += 73;
00324         e *= 1000;
00325         e += 709;
00326         e *= 1000;
00327         e += 551;
00328         e *= 1000;
00329         e += 614;
00330         assert(test_parse(out, "15.999999999999999999e", 0, e));
00331 
00332         /*
00333          * The following workaround avoids the following compiler warning:
00334          * "warning: decimal constant is so large that it is unsigned"
00335          */
00336         e = 18;
00337         e *= 1000;
00338         e += 446;
00339         e *= 1000;
00340         e += 744;
00341         e *= 1000;
00342         e += 73;
00343         e *= 1000;
00344         e += 709;
00345         e *= 1000;
00346         e += 551;
00347         e *= 1000;
00348         e += 614;
00349         assert(test_parse(out, "15.99999999999999999913e", 0, e));
00350 }
00351 
00352 void test3(FILE* out)
00353 {
00354         displayInit();
00355         ioInit();
00356 
00357 #ifdef PRINT_DEBUG
00358         print();
00359 #endif
00360         assert(d.start_time == 0);
00361         assert(d.total_time == 0);
00362         assert(d.current_time == 0);
00363         assert(d.elapsed_time == 0);
00364         assert(d.percent_complete == 0);
00365         assert(d.display_interval == 1);
00366         assert(d.overtime_flag == 0);
00367         assert(d.k == 1024);
00368         assert(d.twiddle == '-');
00369         assert(d.manual_width == 0);
00370         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
00371         assert(d.display_datacount == 1);
00372         assert(d.display_throughput == 1);
00373         assert(d.display_time == 1);
00374         assert(d.display_percent == 1);
00375         assert(d.display_bar == 1);
00376         assert(d.display_summary == 1);
00377         assert(d.display_ansi == 0);
00378         assert(d.twiddle_fg_color == 0);
00379         assert(d.twiddle_bg_color == 0);
00380         assert(d.twiddle_fg_bold == 0);
00381         assert(d.datacount_fg_color == 0);
00382         assert(d.datacount_bg_color == 0);
00383         assert(d.datacount_fg_bold == 0);
00384         assert(d.throughput_label_fg_color == 0);
00385         assert(d.throughput_label_bg_color == 0);
00386         assert(d.throughput_label_fg_bold == 0);
00387         assert(d.throughput_fg_color == 0);
00388         assert(d.throughput_bg_color == 0);
00389         assert(d.throughput_fg_bold == 0);
00390         assert(d.time_label_fg_color == 0);
00391         assert(d.time_label_bg_color == 0);
00392         assert(d.time_label_fg_bold == 0);
00393         assert(d.percent_fg_color == 0);
00394         assert(d.percent_bg_color == 0);
00395         assert(d.percent_fg_bold == 0);
00396         assert(d.barbrace_fg_color == 0);
00397         assert(d.barbrace_bg_color == 0);
00398         assert(d.barbrace_fg_bold == 0);
00399         assert(d.bar_fg_color == 0);
00400         assert(d.bar_bg_color == 0);
00401         assert(d.bar_fg_bold == 0);
00402         assert(io.in == 0);
00403         assert(io.out == 1);
00404         assert(io.in_ready == 0);
00405         assert(io.out_ready == 0);
00406         assert(io.eof_in == 0);
00407         assert(io.eof_out == 0);
00408         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
00409         /* assert(io.cbuf == 0x0); */
00410         assert(io.last_read == 0);
00411         assert(io.last_write == 0);
00412         assert(io.total_read == 0);
00413         assert(io.total_write == 0);
00414         assert(io.total_size == 0);
00415         assert(io.total_size_known == 0);
00416         assert(io.timeout == 250000);
00417 }
00418 
00419 void test4(FILE* out)
00420 {
00421         int argc = 0;
00422         char *argv[256] = { 0 };
00423 
00424         argv[argc++] = "ProgramName";
00425 
00426         displayInit();
00427         ioInit();
00428 
00429 #ifdef PRINT_DEBUG
00430         print();
00431 #endif
00432         assert(d.start_time == 0);
00433         assert(d.total_time == 0);
00434         assert(d.current_time == 0);
00435         assert(d.elapsed_time == 0);
00436         assert(d.percent_complete == 0);
00437         assert(d.display_interval == 1);
00438         assert(d.overtime_flag == 0);
00439         assert(d.k == 1024);
00440         assert(d.twiddle == '-');
00441         assert(d.manual_width == 0);
00442         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
00443         assert(d.display_datacount == 1);
00444         assert(d.display_throughput == 1);
00445         assert(d.display_time == 1);
00446         assert(d.display_percent == 1);
00447         assert(d.display_bar == 1);
00448         assert(d.display_summary == 1);
00449         assert(d.display_ansi == 0);
00450         assert(d.twiddle_fg_color == 0);
00451         assert(d.twiddle_bg_color == 0);
00452         assert(d.twiddle_fg_bold == 0);
00453         assert(d.datacount_fg_color == 0);
00454         assert(d.datacount_bg_color == 0);
00455         assert(d.datacount_fg_bold == 0);
00456         assert(d.throughput_label_fg_color == 0);
00457         assert(d.throughput_label_bg_color == 0);
00458         assert(d.throughput_label_fg_bold == 0);
00459         assert(d.throughput_fg_color == 0);
00460         assert(d.throughput_bg_color == 0);
00461         assert(d.throughput_fg_bold == 0);
00462         assert(d.time_label_fg_color == 0);
00463         assert(d.time_label_bg_color == 0);
00464         assert(d.time_label_fg_bold == 0);
00465         assert(d.percent_fg_color == 0);
00466         assert(d.percent_bg_color == 0);
00467         assert(d.percent_fg_bold == 0);
00468         assert(d.barbrace_fg_color == 0);
00469         assert(d.barbrace_bg_color == 0);
00470         assert(d.barbrace_fg_bold == 0);
00471         assert(d.bar_fg_color == 0);
00472         assert(d.bar_bg_color == 0);
00473         assert(d.bar_fg_bold == 0);
00474         assert(io.in == 0);
00475         assert(io.out == 1);
00476         assert(io.in_ready == 0);
00477         assert(io.out_ready == 0);
00478         assert(io.eof_in == 0);
00479         assert(io.eof_out == 0);
00480         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
00481         /* assert(io.cbuf == 0x0); */
00482         assert(io.last_read == 0);
00483         assert(io.last_write == 0);
00484         assert(io.total_read == 0);
00485         assert(io.total_write == 0);
00486         assert(io.total_size == 0);
00487         assert(io.total_size_known == 0);
00488         assert(io.timeout == 250000);
00489 
00490         assert(parse_args(out, argc, argv) == 0);
00491 
00492 #ifdef PRINT_DEBUG
00493         print();
00494 #endif
00495         assert(d.start_time == 0);
00496         assert(d.total_time == 0);
00497         assert(d.current_time == 0);
00498         assert(d.elapsed_time == 0);
00499         assert(d.percent_complete == 0);
00500         assert(d.display_interval == 1);
00501         assert(d.overtime_flag == 0);
00502         assert(d.k == 1024);
00503         assert(d.twiddle == '-');
00504         assert(d.manual_width == 0);
00505         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
00506         assert(d.display_datacount == 1);
00507         assert(d.display_throughput == 1);
00508         assert(d.display_time == 1);
00509         assert(d.display_percent == 1);
00510         assert(d.display_bar == 1);
00511         assert(d.display_summary == 1);
00512         assert(d.display_ansi == 0);
00513         assert(d.twiddle_fg_color == 0);
00514         assert(d.twiddle_bg_color == 0);
00515         assert(d.twiddle_fg_bold == 0);
00516         assert(d.datacount_fg_color == 0);
00517         assert(d.datacount_bg_color == 0);
00518         assert(d.datacount_fg_bold == 0);
00519         assert(d.throughput_label_fg_color == 0);
00520         assert(d.throughput_label_bg_color == 0);
00521         assert(d.throughput_label_fg_bold == 0);
00522         assert(d.throughput_fg_color == 0);
00523         assert(d.throughput_bg_color == 0);
00524         assert(d.throughput_fg_bold == 0);
00525         assert(d.time_label_fg_color == 0);
00526         assert(d.time_label_bg_color == 0);
00527         assert(d.time_label_fg_bold == 0);
00528         assert(d.percent_fg_color == 0);
00529         assert(d.percent_bg_color == 0);
00530         assert(d.percent_fg_bold == 0);
00531         assert(d.barbrace_fg_color == 0);
00532         assert(d.barbrace_bg_color == 0);
00533         assert(d.barbrace_fg_bold == 0);
00534         assert(d.bar_fg_color == 0);
00535         assert(d.bar_bg_color == 0);
00536         assert(d.bar_fg_bold == 0);
00537         assert(io.in == 0);
00538         assert(io.out == 1);
00539         assert(io.in_ready == 0);
00540         assert(io.out_ready == 0);
00541         assert(io.eof_in == 0);
00542         assert(io.eof_out == 0);
00543         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
00544         /* assert(io.cbuf == 0x0); */
00545         assert(io.last_read == 0);
00546         assert(io.last_write == 0);
00547         assert(io.total_read == 0);
00548         assert(io.total_write == 0);
00549         assert(io.total_size == 0);
00550         assert(io.total_size_known == 0);
00551         assert(io.timeout == 250000);
00552 }
00553 
00554 void test5(FILE* out)
00555 {
00556         int argc = 0;
00557         char *argv[256] = { 0 };
00558 
00559         argv[argc++] = "ProgramName";
00560         argv[argc++] = "-if";
00561 
00562         displayInit();
00563         ioInit();
00564 
00565 #ifdef PRINT_DEBUG
00566         print();
00567 #endif
00568         assert(d.start_time == 0);
00569         assert(d.total_time == 0);
00570         assert(d.current_time == 0);
00571         assert(d.elapsed_time == 0);
00572         assert(d.percent_complete == 0);
00573         assert(d.display_interval == 1);
00574         assert(d.overtime_flag == 0);
00575         assert(d.k == 1024);
00576         assert(d.twiddle == '-');
00577         assert(d.manual_width == 0);
00578         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
00579         assert(d.display_datacount == 1);
00580         assert(d.display_throughput == 1);
00581         assert(d.display_time == 1);
00582         assert(d.display_percent == 1);
00583         assert(d.display_bar == 1);
00584         assert(d.display_summary == 1);
00585         assert(d.display_ansi == 0);
00586         assert(d.twiddle_fg_color == 0);
00587         assert(d.twiddle_bg_color == 0);
00588         assert(d.twiddle_fg_bold == 0);
00589         assert(d.datacount_fg_color == 0);
00590         assert(d.datacount_bg_color == 0);
00591         assert(d.datacount_fg_bold == 0);
00592         assert(d.throughput_label_fg_color == 0);
00593         assert(d.throughput_label_bg_color == 0);
00594         assert(d.throughput_label_fg_bold == 0);
00595         assert(d.throughput_fg_color == 0);
00596         assert(d.throughput_bg_color == 0);
00597         assert(d.throughput_fg_bold == 0);
00598         assert(d.time_label_fg_color == 0);
00599         assert(d.time_label_bg_color == 0);
00600         assert(d.time_label_fg_bold == 0);
00601         assert(d.percent_fg_color == 0);
00602         assert(d.percent_bg_color == 0);
00603         assert(d.percent_fg_bold == 0);
00604         assert(d.barbrace_fg_color == 0);
00605         assert(d.barbrace_bg_color == 0);
00606         assert(d.barbrace_fg_bold == 0);
00607         assert(d.bar_fg_color == 0);
00608         assert(d.bar_bg_color == 0);
00609         assert(d.bar_fg_bold == 0);
00610         assert(io.in == 0);
00611         assert(io.out == 1);
00612         assert(io.in_ready == 0);
00613         assert(io.out_ready == 0);
00614         assert(io.eof_in == 0);
00615         assert(io.eof_out == 0);
00616         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
00617         /* assert(io.cbuf == 0x0); */
00618         assert(io.last_read == 0);
00619         assert(io.last_write == 0);
00620         assert(io.total_read == 0);
00621         assert(io.total_write == 0);
00622         assert(io.total_size == 0);
00623         assert(io.total_size_known == 0);
00624         assert(io.timeout == 250000);
00625 
00626         assert(parse_args(out, argc, argv) == 1);
00627 
00628 #ifdef PRINT_DEBUG
00629         print();
00630 #endif
00631         assert(d.start_time == 0);
00632         assert(d.total_time == 0);
00633         assert(d.current_time == 0);
00634         assert(d.elapsed_time == 0);
00635         assert(d.percent_complete == 0);
00636         assert(d.display_interval == 1);
00637         assert(d.overtime_flag == 0);
00638         assert(d.k == 1024);
00639         assert(d.twiddle == '-');
00640         assert(d.manual_width == 0);
00641         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
00642         assert(d.display_datacount == 1);
00643         assert(d.display_throughput == 1);
00644         assert(d.display_time == 1);
00645         assert(d.display_percent == 1);
00646         assert(d.display_bar == 1);
00647         assert(d.display_summary == 1);
00648         assert(d.display_ansi == 0);
00649         assert(d.twiddle_fg_color == 0);
00650         assert(d.twiddle_bg_color == 0);
00651         assert(d.twiddle_fg_bold == 0);
00652         assert(d.datacount_fg_color == 0);
00653         assert(d.datacount_bg_color == 0);
00654         assert(d.datacount_fg_bold == 0);
00655         assert(d.throughput_label_fg_color == 0);
00656         assert(d.throughput_label_bg_color == 0);
00657         assert(d.throughput_label_fg_bold == 0);
00658         assert(d.throughput_fg_color == 0);
00659         assert(d.throughput_bg_color == 0);
00660         assert(d.throughput_fg_bold == 0);
00661         assert(d.time_label_fg_color == 0);
00662         assert(d.time_label_bg_color == 0);
00663         assert(d.time_label_fg_bold == 0);
00664         assert(d.percent_fg_color == 0);
00665         assert(d.percent_bg_color == 0);
00666         assert(d.percent_fg_bold == 0);
00667         assert(d.barbrace_fg_color == 0);
00668         assert(d.barbrace_bg_color == 0);
00669         assert(d.barbrace_fg_bold == 0);
00670         assert(d.bar_fg_color == 0);
00671         assert(d.bar_bg_color == 0);
00672         assert(d.bar_fg_bold == 0);
00673         assert(io.in == 0);
00674         assert(io.out == 1);
00675         assert(io.in_ready == 0);
00676         assert(io.out_ready == 0);
00677         assert(io.eof_in == 0);
00678         assert(io.eof_out == 0);
00679         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
00680         /* assert(io.cbuf == 0x0); */
00681         assert(io.last_read == 0);
00682         assert(io.last_write == 0);
00683         assert(io.total_read == 0);
00684         assert(io.total_write == 0);
00685         assert(io.total_size == 0);
00686         assert(io.total_size_known == 0);
00687         assert(io.timeout == 250000);
00688 }
00689 
00690 void test6(FILE* out)
00691 {
00692         int argc = 0;
00693         char *argv[256] = { 0 };
00694 
00695         argv[argc++] = "ProgramName";
00696         argv[argc++] = "/dev/null";
00697 
00698         displayInit();
00699         ioInit();
00700 
00701 #ifdef PRINT_DEBUG
00702         print();
00703 #endif
00704         assert(d.start_time == 0);
00705         assert(d.total_time == 0);
00706         assert(d.current_time == 0);
00707         assert(d.elapsed_time == 0);
00708         assert(d.percent_complete == 0);
00709         assert(d.display_interval == 1);
00710         assert(d.overtime_flag == 0);
00711         assert(d.k == 1024);
00712         assert(d.twiddle == '-');
00713         assert(d.manual_width == 0);
00714         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
00715         assert(d.display_datacount == 1);
00716         assert(d.display_throughput == 1);
00717         assert(d.display_time == 1);
00718         assert(d.display_percent == 1);
00719         assert(d.display_bar == 1);
00720         assert(d.display_summary == 1);
00721         assert(d.display_ansi == 0);
00722         assert(d.twiddle_fg_color == 0);
00723         assert(d.twiddle_bg_color == 0);
00724         assert(d.twiddle_fg_bold == 0);
00725         assert(d.datacount_fg_color == 0);
00726         assert(d.datacount_bg_color == 0);
00727         assert(d.datacount_fg_bold == 0);
00728         assert(d.throughput_label_fg_color == 0);
00729         assert(d.throughput_label_bg_color == 0);
00730         assert(d.throughput_label_fg_bold == 0);
00731         assert(d.throughput_fg_color == 0);
00732         assert(d.throughput_bg_color == 0);
00733         assert(d.throughput_fg_bold == 0);
00734         assert(d.time_label_fg_color == 0);
00735         assert(d.time_label_bg_color == 0);
00736         assert(d.time_label_fg_bold == 0);
00737         assert(d.percent_fg_color == 0);
00738         assert(d.percent_bg_color == 0);
00739         assert(d.percent_fg_bold == 0);
00740         assert(d.barbrace_fg_color == 0);
00741         assert(d.barbrace_bg_color == 0);
00742         assert(d.barbrace_fg_bold == 0);
00743         assert(d.bar_fg_color == 0);
00744         assert(d.bar_bg_color == 0);
00745         assert(d.bar_fg_bold == 0);
00746         assert(io.in == 0);
00747         assert(io.out == 1);
00748         assert(io.in_ready == 0);
00749         assert(io.out_ready == 0);
00750         assert(io.eof_in == 0);
00751         assert(io.eof_out == 0);
00752         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
00753         /* assert(io.cbuf == 0x0); */
00754         assert(io.last_read == 0);
00755         assert(io.last_write == 0);
00756         assert(io.total_read == 0);
00757         assert(io.total_write == 0);
00758         assert(io.total_size == 0);
00759         assert(io.total_size_known == 0);
00760         assert(io.timeout == 250000);
00761 
00762         assert(parse_args(out, argc, argv) == 1);
00763 
00764 #ifdef PRINT_DEBUG
00765         print();
00766 #endif
00767         assert(d.start_time == 0);
00768         assert(d.total_time == 0);
00769         assert(d.current_time == 0);
00770         assert(d.elapsed_time == 0);
00771         assert(d.percent_complete == 0);
00772         assert(d.display_interval == 1);
00773         assert(d.overtime_flag == 0);
00774         assert(d.k == 1024);
00775         assert(d.twiddle == '-');
00776         assert(d.manual_width == 0);
00777         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
00778         assert(d.display_datacount == 1);
00779         assert(d.display_throughput == 1);
00780         assert(d.display_time == 1);
00781         assert(d.display_percent == 1);
00782         assert(d.display_bar == 1);
00783         assert(d.display_summary == 1);
00784         assert(d.display_ansi == 0);
00785         assert(d.twiddle_fg_color == 0);
00786         assert(d.twiddle_bg_color == 0);
00787         assert(d.twiddle_fg_bold == 0);
00788         assert(d.datacount_fg_color == 0);
00789         assert(d.datacount_bg_color == 0);
00790         assert(d.datacount_fg_bold == 0);
00791         assert(d.throughput_label_fg_color == 0);
00792         assert(d.throughput_label_bg_color == 0);
00793         assert(d.throughput_label_fg_bold == 0);
00794         assert(d.throughput_fg_color == 0);
00795         assert(d.throughput_bg_color == 0);
00796         assert(d.throughput_fg_bold == 0);
00797         assert(d.time_label_fg_color == 0);
00798         assert(d.time_label_bg_color == 0);
00799         assert(d.time_label_fg_bold == 0);
00800         assert(d.percent_fg_color == 0);
00801         assert(d.percent_bg_color == 0);
00802         assert(d.percent_fg_bold == 0);
00803         assert(d.barbrace_fg_color == 0);
00804         assert(d.barbrace_bg_color == 0);
00805         assert(d.barbrace_fg_bold == 0);
00806         assert(d.bar_fg_color == 0);
00807         assert(d.bar_bg_color == 0);
00808         assert(d.bar_fg_bold == 0);
00809         assert(io.in == 0);
00810         assert(io.out == 1);
00811         assert(io.in_ready == 0);
00812         assert(io.out_ready == 0);
00813         assert(io.eof_in == 0);
00814         assert(io.eof_out == 0);
00815         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
00816         /* assert(io.cbuf == 0x0); */
00817         assert(io.last_read == 0);
00818         assert(io.last_write == 0);
00819         assert(io.total_read == 0);
00820         assert(io.total_write == 0);
00821         assert(io.total_size == 0);
00822         assert(io.total_size_known == 0);
00823         assert(io.timeout == 250000);
00824 }
00825 
00826 void test7(FILE* out)
00827 {
00828         int argc = 0;
00829         char *argv[256] = { 0 };
00830 
00831         argv[argc++] = "ProgramName";
00832         argv[argc++] = "-if";
00833         argv[argc++] = "/dev/null";
00834 
00835         displayInit();
00836         ioInit();
00837 
00838 #ifdef PRINT_DEBUG
00839         print();
00840 #endif
00841         assert(d.start_time == 0);
00842         assert(d.total_time == 0);
00843         assert(d.current_time == 0);
00844         assert(d.elapsed_time == 0);
00845         assert(d.percent_complete == 0);
00846         assert(d.display_interval == 1);
00847         assert(d.overtime_flag == 0);
00848         assert(d.k == 1024);
00849         assert(d.twiddle == '-');
00850         assert(d.manual_width == 0);
00851         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
00852         assert(d.display_datacount == 1);
00853         assert(d.display_throughput == 1);
00854         assert(d.display_time == 1);
00855         assert(d.display_percent == 1);
00856         assert(d.display_bar == 1);
00857         assert(d.display_summary == 1);
00858         assert(d.display_ansi == 0);
00859         assert(d.twiddle_fg_color == 0);
00860         assert(d.twiddle_bg_color == 0);
00861         assert(d.twiddle_fg_bold == 0);
00862         assert(d.datacount_fg_color == 0);
00863         assert(d.datacount_bg_color == 0);
00864         assert(d.datacount_fg_bold == 0);
00865         assert(d.throughput_label_fg_color == 0);
00866         assert(d.throughput_label_bg_color == 0);
00867         assert(d.throughput_label_fg_bold == 0);
00868         assert(d.throughput_fg_color == 0);
00869         assert(d.throughput_bg_color == 0);
00870         assert(d.throughput_fg_bold == 0);
00871         assert(d.time_label_fg_color == 0);
00872         assert(d.time_label_bg_color == 0);
00873         assert(d.time_label_fg_bold == 0);
00874         assert(d.percent_fg_color == 0);
00875         assert(d.percent_bg_color == 0);
00876         assert(d.percent_fg_bold == 0);
00877         assert(d.barbrace_fg_color == 0);
00878         assert(d.barbrace_bg_color == 0);
00879         assert(d.barbrace_fg_bold == 0);
00880         assert(d.bar_fg_color == 0);
00881         assert(d.bar_bg_color == 0);
00882         assert(d.bar_fg_bold == 0);
00883         assert(io.in == 0);
00884         assert(io.out == 1);
00885         assert(io.in_ready == 0);
00886         assert(io.out_ready == 0);
00887         assert(io.eof_in == 0);
00888         assert(io.eof_out == 0);
00889         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
00890         /* assert(io.cbuf == 0x0); */
00891         assert(io.last_read == 0);
00892         assert(io.last_write == 0);
00893         assert(io.total_read == 0);
00894         assert(io.total_write == 0);
00895         assert(io.total_size == 0);
00896         assert(io.total_size_known == 0);
00897         assert(io.timeout == 250000);
00898 
00899         assert(parse_args(out, argc, argv) == 0);
00900 
00901 #ifdef PRINT_DEBUG
00902         print();
00903 #endif
00904         assert(d.start_time == 0);
00905         assert(d.total_time == 0);
00906         assert(d.current_time == 0);
00907         assert(d.elapsed_time == 0);
00908         assert(d.percent_complete == 0);
00909         assert(d.display_interval == 1);
00910         assert(d.overtime_flag == 0);
00911         assert(d.k == 1024);
00912         assert(d.twiddle == '-');
00913         assert(d.manual_width == 0);
00914         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
00915         assert(d.display_datacount == 1);
00916         assert(d.display_throughput == 1);
00917         assert(d.display_time == 1);
00918         assert(d.display_percent == 1);
00919         assert(d.display_bar == 1);
00920         assert(d.display_summary == 1);
00921         assert(io.in != 0);
00922         assert(io.out == 1);
00923         assert(io.in_ready == 0);
00924         assert(io.out_ready == 0);
00925         assert(io.eof_in == 0);
00926         assert(io.eof_out == 0);
00927         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
00928         /* assert(io.cbuf == 0x0); */
00929         assert(io.last_read == 0);
00930         assert(io.last_write == 0);
00931         assert(io.total_read == 0);
00932         assert(io.total_write == 0);
00933         assert(io.total_size == 0);
00934         assert(io.total_size_known == 0);
00935         assert(io.timeout == 250000);
00936 }
00937 
00938 void test8(FILE* out)
00939 {
00940         int argc = 0;
00941         char *argv[256] = { 0 };
00942 
00943         argv[argc++] = "ProgramName";
00944         argv[argc++] = "-of";
00945 
00946         displayInit();
00947         ioInit();
00948 
00949 #ifdef PRINT_DEBUG
00950         print();
00951 #endif
00952         assert(d.start_time == 0);
00953         assert(d.total_time == 0);
00954         assert(d.current_time == 0);
00955         assert(d.elapsed_time == 0);
00956         assert(d.percent_complete == 0);
00957         assert(d.display_interval == 1);
00958         assert(d.overtime_flag == 0);
00959         assert(d.k == 1024);
00960         assert(d.twiddle == '-');
00961         assert(d.manual_width == 0);
00962         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
00963         assert(d.display_datacount == 1);
00964         assert(d.display_throughput == 1);
00965         assert(d.display_time == 1);
00966         assert(d.display_percent == 1);
00967         assert(d.display_bar == 1);
00968         assert(d.display_summary == 1);
00969         assert(d.display_ansi == 0);
00970         assert(d.twiddle_fg_color == 0);
00971         assert(d.twiddle_bg_color == 0);
00972         assert(d.twiddle_fg_bold == 0);
00973         assert(d.datacount_fg_color == 0);
00974         assert(d.datacount_bg_color == 0);
00975         assert(d.datacount_fg_bold == 0);
00976         assert(d.throughput_label_fg_color == 0);
00977         assert(d.throughput_label_bg_color == 0);
00978         assert(d.throughput_label_fg_bold == 0);
00979         assert(d.throughput_fg_color == 0);
00980         assert(d.throughput_bg_color == 0);
00981         assert(d.throughput_fg_bold == 0);
00982         assert(d.time_label_fg_color == 0);
00983         assert(d.time_label_bg_color == 0);
00984         assert(d.time_label_fg_bold == 0);
00985         assert(d.percent_fg_color == 0);
00986         assert(d.percent_bg_color == 0);
00987         assert(d.percent_fg_bold == 0);
00988         assert(d.barbrace_fg_color == 0);
00989         assert(d.barbrace_bg_color == 0);
00990         assert(d.barbrace_fg_bold == 0);
00991         assert(d.bar_fg_color == 0);
00992         assert(d.bar_bg_color == 0);
00993         assert(d.bar_fg_bold == 0);
00994         assert(io.in == 0);
00995         assert(io.out == 1);
00996         assert(io.in_ready == 0);
00997         assert(io.out_ready == 0);
00998         assert(io.eof_in == 0);
00999         assert(io.eof_out == 0);
01000         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01001         /* assert(io.cbuf == 0x0); */
01002         assert(io.last_read == 0);
01003         assert(io.last_write == 0);
01004         assert(io.total_read == 0);
01005         assert(io.total_write == 0);
01006         assert(io.total_size == 0);
01007         assert(io.total_size_known == 0);
01008         assert(io.timeout == 250000);
01009 
01010         assert(parse_args(out, argc, argv) == 1);
01011 
01012 #ifdef PRINT_DEBUG
01013         print();
01014 #endif
01015         assert(d.start_time == 0);
01016         assert(d.total_time == 0);
01017         assert(d.current_time == 0);
01018         assert(d.elapsed_time == 0);
01019         assert(d.percent_complete == 0);
01020         assert(d.display_interval == 1);
01021         assert(d.overtime_flag == 0);
01022         assert(d.k == 1024);
01023         assert(d.twiddle == '-');
01024         assert(d.manual_width == 0);
01025         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01026         assert(d.display_datacount == 1);
01027         assert(d.display_throughput == 1);
01028         assert(d.display_time == 1);
01029         assert(d.display_percent == 1);
01030         assert(d.display_bar == 1);
01031         assert(d.display_summary == 1);
01032         assert(d.display_ansi == 0);
01033         assert(d.twiddle_fg_color == 0);
01034         assert(d.twiddle_bg_color == 0);
01035         assert(d.twiddle_fg_bold == 0);
01036         assert(d.datacount_fg_color == 0);
01037         assert(d.datacount_bg_color == 0);
01038         assert(d.datacount_fg_bold == 0);
01039         assert(d.throughput_label_fg_color == 0);
01040         assert(d.throughput_label_bg_color == 0);
01041         assert(d.throughput_label_fg_bold == 0);
01042         assert(d.throughput_fg_color == 0);
01043         assert(d.throughput_bg_color == 0);
01044         assert(d.throughput_fg_bold == 0);
01045         assert(d.time_label_fg_color == 0);
01046         assert(d.time_label_bg_color == 0);
01047         assert(d.time_label_fg_bold == 0);
01048         assert(d.percent_fg_color == 0);
01049         assert(d.percent_bg_color == 0);
01050         assert(d.percent_fg_bold == 0);
01051         assert(d.barbrace_fg_color == 0);
01052         assert(d.barbrace_bg_color == 0);
01053         assert(d.barbrace_fg_bold == 0);
01054         assert(d.bar_fg_color == 0);
01055         assert(d.bar_bg_color == 0);
01056         assert(d.bar_fg_bold == 0);
01057         assert(io.in == 0);
01058         assert(io.out == 1);
01059         assert(io.in_ready == 0);
01060         assert(io.out_ready == 0);
01061         assert(io.eof_in == 0);
01062         assert(io.eof_out == 0);
01063         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01064         /* assert(io.cbuf == 0x0); */
01065         assert(io.last_read == 0);
01066         assert(io.last_write == 0);
01067         assert(io.total_read == 0);
01068         assert(io.total_write == 0);
01069         assert(io.total_size == 0);
01070         assert(io.total_size_known == 0);
01071         assert(io.timeout == 250000);
01072 }
01073 
01074 void test9(FILE* out)
01075 {
01076         int argc = 0;
01077         char *argv[256] = { 0 };
01078 
01079         argv[argc++] = "ProgramName";
01080         argv[argc++] = "-of";
01081         argv[argc++] = "/dev/null";
01082 
01083         displayInit();
01084         ioInit();
01085 
01086 #ifdef PRINT_DEBUG
01087         print();
01088 #endif
01089         assert(d.start_time == 0);
01090         assert(d.total_time == 0);
01091         assert(d.current_time == 0);
01092         assert(d.elapsed_time == 0);
01093         assert(d.percent_complete == 0);
01094         assert(d.display_interval == 1);
01095         assert(d.overtime_flag == 0);
01096         assert(d.k == 1024);
01097         assert(d.twiddle == '-');
01098         assert(d.manual_width == 0);
01099         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01100         assert(d.display_datacount == 1);
01101         assert(d.display_throughput == 1);
01102         assert(d.display_time == 1);
01103         assert(d.display_percent == 1);
01104         assert(d.display_bar == 1);
01105         assert(d.display_summary == 1);
01106         assert(d.display_ansi == 0);
01107         assert(d.twiddle_fg_color == 0);
01108         assert(d.twiddle_bg_color == 0);
01109         assert(d.twiddle_fg_bold == 0);
01110         assert(d.datacount_fg_color == 0);
01111         assert(d.datacount_bg_color == 0);
01112         assert(d.datacount_fg_bold == 0);
01113         assert(d.throughput_label_fg_color == 0);
01114         assert(d.throughput_label_bg_color == 0);
01115         assert(d.throughput_label_fg_bold == 0);
01116         assert(d.throughput_fg_color == 0);
01117         assert(d.throughput_bg_color == 0);
01118         assert(d.throughput_fg_bold == 0);
01119         assert(d.time_label_fg_color == 0);
01120         assert(d.time_label_bg_color == 0);
01121         assert(d.time_label_fg_bold == 0);
01122         assert(d.percent_fg_color == 0);
01123         assert(d.percent_bg_color == 0);
01124         assert(d.percent_fg_bold == 0);
01125         assert(d.barbrace_fg_color == 0);
01126         assert(d.barbrace_bg_color == 0);
01127         assert(d.barbrace_fg_bold == 0);
01128         assert(d.bar_fg_color == 0);
01129         assert(d.bar_bg_color == 0);
01130         assert(d.bar_fg_bold == 0);
01131         assert(io.in == 0);
01132         assert(io.out == 1);
01133         assert(io.in_ready == 0);
01134         assert(io.out_ready == 0);
01135         assert(io.eof_in == 0);
01136         assert(io.eof_out == 0);
01137         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01138         /* assert(io.cbuf == 0x0); */
01139         assert(io.last_read == 0);
01140         assert(io.last_write == 0);
01141         assert(io.total_read == 0);
01142         assert(io.total_write == 0);
01143         assert(io.total_size == 0);
01144         assert(io.total_size_known == 0);
01145         assert(io.timeout == 250000);
01146 
01147         assert(parse_args(out, argc, argv) == 0);
01148 
01149 #ifdef PRINT_DEBUG
01150         print();
01151 #endif
01152         assert(d.start_time == 0);
01153         assert(d.total_time == 0);
01154         assert(d.current_time == 0);
01155         assert(d.elapsed_time == 0);
01156         assert(d.percent_complete == 0);
01157         assert(d.display_interval == 1);
01158         assert(d.overtime_flag == 0);
01159         assert(d.k == 1024);
01160         assert(d.twiddle == '-');
01161         assert(d.manual_width == 0);
01162         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01163         assert(d.display_datacount == 1);
01164         assert(d.display_throughput == 1);
01165         assert(d.display_time == 1);
01166         assert(d.display_percent == 1);
01167         assert(d.display_bar == 1);
01168         assert(d.display_summary == 1);
01169         assert(d.display_ansi == 0);
01170         assert(d.twiddle_fg_color == 0);
01171         assert(d.twiddle_bg_color == 0);
01172         assert(d.twiddle_fg_bold == 0);
01173         assert(d.datacount_fg_color == 0);
01174         assert(d.datacount_bg_color == 0);
01175         assert(d.datacount_fg_bold == 0);
01176         assert(d.throughput_label_fg_color == 0);
01177         assert(d.throughput_label_bg_color == 0);
01178         assert(d.throughput_label_fg_bold == 0);
01179         assert(d.throughput_fg_color == 0);
01180         assert(d.throughput_bg_color == 0);
01181         assert(d.throughput_fg_bold == 0);
01182         assert(d.time_label_fg_color == 0);
01183         assert(d.time_label_bg_color == 0);
01184         assert(d.time_label_fg_bold == 0);
01185         assert(d.percent_fg_color == 0);
01186         assert(d.percent_bg_color == 0);
01187         assert(d.percent_fg_bold == 0);
01188         assert(d.barbrace_fg_color == 0);
01189         assert(d.barbrace_bg_color == 0);
01190         assert(d.barbrace_fg_bold == 0);
01191         assert(d.bar_fg_color == 0);
01192         assert(d.bar_bg_color == 0);
01193         assert(d.bar_fg_bold == 0);
01194         assert(io.in == 0);
01195         assert(io.out != 1);
01196         assert(io.in_ready == 0);
01197         assert(io.out_ready == 0);
01198         assert(io.eof_in == 0);
01199         assert(io.eof_out == 0);
01200         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01201         /* assert(io.cbuf == 0x0); */
01202         assert(io.last_read == 0);
01203         assert(io.last_write == 0);
01204         assert(io.total_read == 0);
01205         assert(io.total_write == 0);
01206         assert(io.total_size == 0);
01207         assert(io.total_size_known == 0);
01208         assert(io.timeout == 250000);
01209 }
01210 
01211 void test10(FILE* out)
01212 {
01213         int argc = 0;
01214         char *argv[256] = { 0 };
01215 
01216         argv[argc++] = "ProgramName";
01217         argv[argc++] = "-s";
01218 
01219         displayInit();
01220         ioInit();
01221 
01222 #ifdef PRINT_DEBUG
01223         print();
01224 #endif
01225         assert(d.start_time == 0);
01226         assert(d.total_time == 0);
01227         assert(d.current_time == 0);
01228         assert(d.elapsed_time == 0);
01229         assert(d.percent_complete == 0);
01230         assert(d.display_interval == 1);
01231         assert(d.overtime_flag == 0);
01232         assert(d.k == 1024);
01233         assert(d.twiddle == '-');
01234         assert(d.manual_width == 0);
01235         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01236         assert(d.display_datacount == 1);
01237         assert(d.display_throughput == 1);
01238         assert(d.display_time == 1);
01239         assert(d.display_percent == 1);
01240         assert(d.display_bar == 1);
01241         assert(d.display_summary == 1);
01242         assert(d.display_ansi == 0);
01243         assert(d.twiddle_fg_color == 0);
01244         assert(d.twiddle_bg_color == 0);
01245         assert(d.twiddle_fg_bold == 0);
01246         assert(d.datacount_fg_color == 0);
01247         assert(d.datacount_bg_color == 0);
01248         assert(d.datacount_fg_bold == 0);
01249         assert(d.throughput_label_fg_color == 0);
01250         assert(d.throughput_label_bg_color == 0);
01251         assert(d.throughput_label_fg_bold == 0);
01252         assert(d.throughput_fg_color == 0);
01253         assert(d.throughput_bg_color == 0);
01254         assert(d.throughput_fg_bold == 0);
01255         assert(d.time_label_fg_color == 0);
01256         assert(d.time_label_bg_color == 0);
01257         assert(d.time_label_fg_bold == 0);
01258         assert(d.percent_fg_color == 0);
01259         assert(d.percent_bg_color == 0);
01260         assert(d.percent_fg_bold == 0);
01261         assert(d.barbrace_fg_color == 0);
01262         assert(d.barbrace_bg_color == 0);
01263         assert(d.barbrace_fg_bold == 0);
01264         assert(d.bar_fg_color == 0);
01265         assert(d.bar_bg_color == 0);
01266         assert(d.bar_fg_bold == 0);
01267         assert(io.in == 0);
01268         assert(io.out == 1);
01269         assert(io.in_ready == 0);
01270         assert(io.out_ready == 0);
01271         assert(io.eof_in == 0);
01272         assert(io.eof_out == 0);
01273         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01274         /* assert(io.cbuf == 0x0); */
01275         assert(io.last_read == 0);
01276         assert(io.last_write == 0);
01277         assert(io.total_read == 0);
01278         assert(io.total_write == 0);
01279         assert(io.total_size == 0);
01280         assert(io.total_size_known == 0);
01281         assert(io.timeout == 250000);
01282 
01283         assert(parse_args(out, argc, argv) == 1);
01284 
01285 #ifdef PRINT_DEBUG
01286         print();
01287 #endif
01288         assert(d.start_time == 0);
01289         assert(d.total_time == 0);
01290         assert(d.current_time == 0);
01291         assert(d.elapsed_time == 0);
01292         assert(d.percent_complete == 0);
01293         assert(d.display_interval == 1);
01294         assert(d.overtime_flag == 0);
01295         assert(d.k == 1024);
01296         assert(d.twiddle == '-');
01297         assert(d.manual_width == 0);
01298         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01299         assert(d.display_datacount == 1);
01300         assert(d.display_throughput == 1);
01301         assert(d.display_time == 1);
01302         assert(d.display_percent == 1);
01303         assert(d.display_bar == 1);
01304         assert(d.display_summary == 1);
01305         assert(d.display_ansi == 0);
01306         assert(d.twiddle_fg_color == 0);
01307         assert(d.twiddle_bg_color == 0);
01308         assert(d.twiddle_fg_bold == 0);
01309         assert(d.datacount_fg_color == 0);
01310         assert(d.datacount_bg_color == 0);
01311         assert(d.datacount_fg_bold == 0);
01312         assert(d.throughput_label_fg_color == 0);
01313         assert(d.throughput_label_bg_color == 0);
01314         assert(d.throughput_label_fg_bold == 0);
01315         assert(d.throughput_fg_color == 0);
01316         assert(d.throughput_bg_color == 0);
01317         assert(d.throughput_fg_bold == 0);
01318         assert(d.time_label_fg_color == 0);
01319         assert(d.time_label_bg_color == 0);
01320         assert(d.time_label_fg_bold == 0);
01321         assert(d.percent_fg_color == 0);
01322         assert(d.percent_bg_color == 0);
01323         assert(d.percent_fg_bold == 0);
01324         assert(d.barbrace_fg_color == 0);
01325         assert(d.barbrace_bg_color == 0);
01326         assert(d.barbrace_fg_bold == 0);
01327         assert(d.bar_fg_color == 0);
01328         assert(d.bar_bg_color == 0);
01329         assert(d.bar_fg_bold == 0);
01330         assert(io.in == 0);
01331         assert(io.out == 1);
01332         assert(io.in_ready == 0);
01333         assert(io.out_ready == 0);
01334         assert(io.eof_in == 0);
01335         assert(io.eof_out == 0);
01336         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01337         /* assert(io.cbuf == 0x0); */
01338         assert(io.last_read == 0);
01339         assert(io.last_write == 0);
01340         assert(io.total_read == 0);
01341         assert(io.total_write == 0);
01342         assert(io.total_size == 0);
01343         assert(io.total_size_known == 0);
01344         assert(io.timeout == 250000);
01345 }
01346 
01347 void test11(FILE* out)
01348 {
01349         int argc = 0;
01350         char *argv[256] = { 0 };
01351 
01352         argv[argc++] = "ProgramName";
01353         argv[argc++] = "-s";
01354         argv[argc++] = "/dev/null";
01355 
01356         displayInit();
01357         ioInit();
01358 
01359 #ifdef PRINT_DEBUG
01360         print();
01361 #endif
01362         assert(d.start_time == 0);
01363         assert(d.total_time == 0);
01364         assert(d.current_time == 0);
01365         assert(d.elapsed_time == 0);
01366         assert(d.percent_complete == 0);
01367         assert(d.display_interval == 1);
01368         assert(d.overtime_flag == 0);
01369         assert(d.k == 1024);
01370         assert(d.twiddle == '-');
01371         assert(d.manual_width == 0);
01372         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01373         assert(d.display_datacount == 1);
01374         assert(d.display_throughput == 1);
01375         assert(d.display_time == 1);
01376         assert(d.display_percent == 1);
01377         assert(d.display_bar == 1);
01378         assert(d.display_summary == 1);
01379         assert(d.display_ansi == 0);
01380         assert(d.twiddle_fg_color == 0);
01381         assert(d.twiddle_bg_color == 0);
01382         assert(d.twiddle_fg_bold == 0);
01383         assert(d.datacount_fg_color == 0);
01384         assert(d.datacount_bg_color == 0);
01385         assert(d.datacount_fg_bold == 0);
01386         assert(d.throughput_label_fg_color == 0);
01387         assert(d.throughput_label_bg_color == 0);
01388         assert(d.throughput_label_fg_bold == 0);
01389         assert(d.throughput_fg_color == 0);
01390         assert(d.throughput_bg_color == 0);
01391         assert(d.throughput_fg_bold == 0);
01392         assert(d.time_label_fg_color == 0);
01393         assert(d.time_label_bg_color == 0);
01394         assert(d.time_label_fg_bold == 0);
01395         assert(d.percent_fg_color == 0);
01396         assert(d.percent_bg_color == 0);
01397         assert(d.percent_fg_bold == 0);
01398         assert(d.barbrace_fg_color == 0);
01399         assert(d.barbrace_bg_color == 0);
01400         assert(d.barbrace_fg_bold == 0);
01401         assert(d.bar_fg_color == 0);
01402         assert(d.bar_bg_color == 0);
01403         assert(d.bar_fg_bold == 0);
01404         assert(io.in == 0);
01405         assert(io.out == 1);
01406         assert(io.in_ready == 0);
01407         assert(io.out_ready == 0);
01408         assert(io.eof_in == 0);
01409         assert(io.eof_out == 0);
01410         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01411         /* assert(io.cbuf == 0x0); */
01412         assert(io.last_read == 0);
01413         assert(io.last_write == 0);
01414         assert(io.total_read == 0);
01415         assert(io.total_write == 0);
01416         assert(io.total_size == 0);
01417         assert(io.total_size_known == 0);
01418         assert(io.timeout == 250000);
01419 
01420         assert(parse_args(out, argc, argv) == 0);
01421 
01422 #ifdef PRINT_DEBUG
01423         print();
01424 #endif
01425         assert(d.start_time == 0);
01426         assert(d.total_time == 0);
01427         assert(d.current_time == 0);
01428         assert(d.elapsed_time == 0);
01429         assert(d.percent_complete == 0);
01430         assert(d.display_interval == 1);
01431         assert(d.overtime_flag == 0);
01432         assert(d.k == 1024);
01433         assert(d.twiddle == '-');
01434         assert(d.manual_width == 0);
01435         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01436         assert(d.display_datacount == 1);
01437         assert(d.display_throughput == 1);
01438         assert(d.display_time == 1);
01439         assert(d.display_percent == 1);
01440         assert(d.display_bar == 1);
01441         assert(d.display_summary == 1);
01442         assert(d.display_ansi == 0);
01443         assert(d.twiddle_fg_color == 0);
01444         assert(d.twiddle_bg_color == 0);
01445         assert(d.twiddle_fg_bold == 0);
01446         assert(d.datacount_fg_color == 0);
01447         assert(d.datacount_bg_color == 0);
01448         assert(d.datacount_fg_bold == 0);
01449         assert(d.throughput_label_fg_color == 0);
01450         assert(d.throughput_label_bg_color == 0);
01451         assert(d.throughput_label_fg_bold == 0);
01452         assert(d.throughput_fg_color == 0);
01453         assert(d.throughput_bg_color == 0);
01454         assert(d.throughput_fg_bold == 0);
01455         assert(d.time_label_fg_color == 0);
01456         assert(d.time_label_bg_color == 0);
01457         assert(d.time_label_fg_bold == 0);
01458         assert(d.percent_fg_color == 0);
01459         assert(d.percent_bg_color == 0);
01460         assert(d.percent_fg_bold == 0);
01461         assert(d.barbrace_fg_color == 0);
01462         assert(d.barbrace_bg_color == 0);
01463         assert(d.barbrace_fg_bold == 0);
01464         assert(d.bar_fg_color == 0);
01465         assert(d.bar_bg_color == 0);
01466         assert(d.bar_fg_bold == 0);
01467         assert(io.in == 0);
01468         assert(io.out == 1);
01469         assert(io.in_ready == 0);
01470         assert(io.out_ready == 0);
01471         assert(io.eof_in == 0);
01472         assert(io.eof_out == 0);
01473         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01474         /* assert(io.cbuf == 0x0); */
01475         assert(io.last_read == 0);
01476         assert(io.last_write == 0);
01477         assert(io.total_read == 0);
01478         assert(io.total_write == 0);
01479         assert(io.total_size == 0);
01480         assert(io.total_size_known == 0);
01481         assert(io.timeout == 250000);
01482 }
01483 
01484 void test12(FILE* out)
01485 {
01486         int argc = 0;
01487         char *argv[256] = { 0 };
01488 
01489         argv[argc++] = "ProgramName";
01490         argv[argc++] = "-s";
01491         argv[argc++] = "1024.38002m";
01492 
01493         displayInit();
01494         ioInit();
01495 
01496 #ifdef PRINT_DEBUG
01497         print();
01498 #endif
01499         assert(d.start_time == 0);
01500         assert(d.total_time == 0);
01501         assert(d.current_time == 0);
01502         assert(d.elapsed_time == 0);
01503         assert(d.percent_complete == 0);
01504         assert(d.display_interval == 1);
01505         assert(d.overtime_flag == 0);
01506         assert(d.k == 1024);
01507         assert(d.twiddle == '-');
01508         assert(d.manual_width == 0);
01509         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01510         assert(d.display_datacount == 1);
01511         assert(d.display_throughput == 1);
01512         assert(d.display_time == 1);
01513         assert(d.display_percent == 1);
01514         assert(d.display_bar == 1);
01515         assert(d.display_summary == 1);
01516         assert(d.display_ansi == 0);
01517         assert(d.twiddle_fg_color == 0);
01518         assert(d.twiddle_bg_color == 0);
01519         assert(d.twiddle_fg_bold == 0);
01520         assert(d.datacount_fg_color == 0);
01521         assert(d.datacount_bg_color == 0);
01522         assert(d.datacount_fg_bold == 0);
01523         assert(d.throughput_label_fg_color == 0);
01524         assert(d.throughput_label_bg_color == 0);
01525         assert(d.throughput_label_fg_bold == 0);
01526         assert(d.throughput_fg_color == 0);
01527         assert(d.throughput_bg_color == 0);
01528         assert(d.throughput_fg_bold == 0);
01529         assert(d.time_label_fg_color == 0);
01530         assert(d.time_label_bg_color == 0);
01531         assert(d.time_label_fg_bold == 0);
01532         assert(d.percent_fg_color == 0);
01533         assert(d.percent_bg_color == 0);
01534         assert(d.percent_fg_bold == 0);
01535         assert(d.barbrace_fg_color == 0);
01536         assert(d.barbrace_bg_color == 0);
01537         assert(d.barbrace_fg_bold == 0);
01538         assert(d.bar_fg_color == 0);
01539         assert(d.bar_bg_color == 0);
01540         assert(d.bar_fg_bold == 0);
01541         assert(io.in == 0);
01542         assert(io.out == 1);
01543         assert(io.in_ready == 0);
01544         assert(io.out_ready == 0);
01545         assert(io.eof_in == 0);
01546         assert(io.eof_out == 0);
01547         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01548         /* assert(io.cbuf == 0x0); */
01549         assert(io.last_read == 0);
01550         assert(io.last_write == 0);
01551         assert(io.total_read == 0);
01552         assert(io.total_write == 0);
01553         assert(io.total_size == 0);
01554         assert(io.total_size_known == 0);
01555         assert(io.timeout == 250000);
01556 
01557         assert(parse_args(out, argc, argv) == 0);
01558 
01559 #ifdef PRINT_DEBUG
01560         print();
01561 #endif
01562         assert(d.start_time == 0);
01563         assert(d.total_time == 0);
01564         assert(d.current_time == 0);
01565         assert(d.elapsed_time == 0);
01566         assert(d.percent_complete == 0);
01567         assert(d.display_interval == 1);
01568         assert(d.overtime_flag == 0);
01569         assert(d.k == 1024);
01570         assert(d.twiddle == '-');
01571         assert(d.manual_width == 0);
01572         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01573         assert(d.display_datacount == 1);
01574         assert(d.display_throughput == 1);
01575         assert(d.display_time == 1);
01576         assert(d.display_percent == 1);
01577         assert(d.display_bar == 1);
01578         assert(d.display_summary == 1);
01579         assert(d.display_ansi == 0);
01580         assert(d.twiddle_fg_color == 0);
01581         assert(d.twiddle_bg_color == 0);
01582         assert(d.twiddle_fg_bold == 0);
01583         assert(d.datacount_fg_color == 0);
01584         assert(d.datacount_bg_color == 0);
01585         assert(d.datacount_fg_bold == 0);
01586         assert(d.throughput_label_fg_color == 0);
01587         assert(d.throughput_label_bg_color == 0);
01588         assert(d.throughput_label_fg_bold == 0);
01589         assert(d.throughput_fg_color == 0);
01590         assert(d.throughput_bg_color == 0);
01591         assert(d.throughput_fg_bold == 0);
01592         assert(d.time_label_fg_color == 0);
01593         assert(d.time_label_bg_color == 0);
01594         assert(d.time_label_fg_bold == 0);
01595         assert(d.percent_fg_color == 0);
01596         assert(d.percent_bg_color == 0);
01597         assert(d.percent_fg_bold == 0);
01598         assert(d.barbrace_fg_color == 0);
01599         assert(d.barbrace_bg_color == 0);
01600         assert(d.barbrace_fg_bold == 0);
01601         assert(d.bar_fg_color == 0);
01602         assert(d.bar_bg_color == 0);
01603         assert(d.bar_fg_bold == 0);
01604         assert(io.in == 0);
01605         assert(io.out == 1);
01606         assert(io.in_ready == 0);
01607         assert(io.out_ready == 0);
01608         assert(io.eof_in == 0);
01609         assert(io.eof_out == 0);
01610         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01611         /* assert(io.cbuf == 0x0); */
01612         assert(io.last_read == 0);
01613         assert(io.last_write == 0);
01614         assert(io.total_read == 0);
01615         assert(io.total_write == 0);
01616         assert(io.total_size == 1074140304);
01617         assert(io.total_size_known == 1);
01618         assert(io.timeout == 250000);
01619 }
01620 
01621 void test13(FILE* out)
01622 {
01623         int argc = 0;
01624         char *argv[256] = { 0 };
01625 
01626         argv[argc++] = "ProgramName";
01627         argv[argc++] = "-bs";
01628 
01629         displayInit();
01630         ioInit();
01631 
01632 #ifdef PRINT_DEBUG
01633         print();
01634 #endif
01635         assert(d.start_time == 0);
01636         assert(d.total_time == 0);
01637         assert(d.current_time == 0);
01638         assert(d.elapsed_time == 0);
01639         assert(d.percent_complete == 0);
01640         assert(d.display_interval == 1);
01641         assert(d.overtime_flag == 0);
01642         assert(d.k == 1024);
01643         assert(d.twiddle == '-');
01644         assert(d.manual_width == 0);
01645         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01646         assert(d.display_datacount == 1);
01647         assert(d.display_throughput == 1);
01648         assert(d.display_time == 1);
01649         assert(d.display_percent == 1);
01650         assert(d.display_bar == 1);
01651         assert(d.display_summary == 1);
01652         assert(d.display_ansi == 0);
01653         assert(d.twiddle_fg_color == 0);
01654         assert(d.twiddle_bg_color == 0);
01655         assert(d.twiddle_fg_bold == 0);
01656         assert(d.datacount_fg_color == 0);
01657         assert(d.datacount_bg_color == 0);
01658         assert(d.datacount_fg_bold == 0);
01659         assert(d.throughput_label_fg_color == 0);
01660         assert(d.throughput_label_bg_color == 0);
01661         assert(d.throughput_label_fg_bold == 0);
01662         assert(d.throughput_fg_color == 0);
01663         assert(d.throughput_bg_color == 0);
01664         assert(d.throughput_fg_bold == 0);
01665         assert(d.time_label_fg_color == 0);
01666         assert(d.time_label_bg_color == 0);
01667         assert(d.time_label_fg_bold == 0);
01668         assert(d.percent_fg_color == 0);
01669         assert(d.percent_bg_color == 0);
01670         assert(d.percent_fg_bold == 0);
01671         assert(d.barbrace_fg_color == 0);
01672         assert(d.barbrace_bg_color == 0);
01673         assert(d.barbrace_fg_bold == 0);
01674         assert(d.bar_fg_color == 0);
01675         assert(d.bar_bg_color == 0);
01676         assert(d.bar_fg_bold == 0);
01677         assert(io.in == 0);
01678         assert(io.out == 1);
01679         assert(io.in_ready == 0);
01680         assert(io.out_ready == 0);
01681         assert(io.eof_in == 0);
01682         assert(io.eof_out == 0);
01683         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01684         /* assert(io.cbuf == 0x0); */
01685         assert(io.last_read == 0);
01686         assert(io.last_write == 0);
01687         assert(io.total_read == 0);
01688         assert(io.total_write == 0);
01689         assert(io.total_size == 0);
01690         assert(io.total_size_known == 0);
01691         assert(io.timeout == 250000);
01692 
01693         assert(parse_args(out, argc, argv) == 1);
01694 
01695 #ifdef PRINT_DEBUG
01696         print();
01697 #endif
01698         assert(d.start_time == 0);
01699         assert(d.total_time == 0);
01700         assert(d.current_time == 0);
01701         assert(d.elapsed_time == 0);
01702         assert(d.percent_complete == 0);
01703         assert(d.display_interval == 1);
01704         assert(d.overtime_flag == 0);
01705         assert(d.k == 1024);
01706         assert(d.twiddle == '-');
01707         assert(d.manual_width == 0);
01708         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01709         assert(d.display_datacount == 1);
01710         assert(d.display_throughput == 1);
01711         assert(d.display_time == 1);
01712         assert(d.display_percent == 1);
01713         assert(d.display_bar == 1);
01714         assert(d.display_summary == 1);
01715         assert(d.display_ansi == 0);
01716         assert(d.twiddle_fg_color == 0);
01717         assert(d.twiddle_bg_color == 0);
01718         assert(d.twiddle_fg_bold == 0);
01719         assert(d.datacount_fg_color == 0);
01720         assert(d.datacount_bg_color == 0);
01721         assert(d.datacount_fg_bold == 0);
01722         assert(d.throughput_label_fg_color == 0);
01723         assert(d.throughput_label_bg_color == 0);
01724         assert(d.throughput_label_fg_bold == 0);
01725         assert(d.throughput_fg_color == 0);
01726         assert(d.throughput_bg_color == 0);
01727         assert(d.throughput_fg_bold == 0);
01728         assert(d.time_label_fg_color == 0);
01729         assert(d.time_label_bg_color == 0);
01730         assert(d.time_label_fg_bold == 0);
01731         assert(d.percent_fg_color == 0);
01732         assert(d.percent_bg_color == 0);
01733         assert(d.percent_fg_bold == 0);
01734         assert(d.barbrace_fg_color == 0);
01735         assert(d.barbrace_bg_color == 0);
01736         assert(d.barbrace_fg_bold == 0);
01737         assert(d.bar_fg_color == 0);
01738         assert(d.bar_bg_color == 0);
01739         assert(d.bar_fg_bold == 0);
01740         assert(io.in == 0);
01741         assert(io.out == 1);
01742         assert(io.in_ready == 0);
01743         assert(io.out_ready == 0);
01744         assert(io.eof_in == 0);
01745         assert(io.eof_out == 0);
01746         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01747         /* assert(io.cbuf == 0x0); */
01748         assert(io.last_read == 0);
01749         assert(io.last_write == 0);
01750         assert(io.total_read == 0);
01751         assert(io.total_write == 0);
01752         assert(io.total_size == 0);
01753         assert(io.total_size_known == 0);
01754         assert(io.timeout == 250000);
01755 }
01756 
01757 void test14(FILE* out)
01758 {
01759         int argc = 0;
01760         char *argv[256] = { 0 };
01761 
01762         argv[argc++] = "ProgramName";
01763         argv[argc++] = "-bs";
01764         argv[argc++] = "/dev/null";
01765 
01766         displayInit();
01767         ioInit();
01768 
01769 #ifdef PRINT_DEBUG
01770         print();
01771 #endif
01772         assert(d.start_time == 0);
01773         assert(d.total_time == 0);
01774         assert(d.current_time == 0);
01775         assert(d.elapsed_time == 0);
01776         assert(d.percent_complete == 0);
01777         assert(d.display_interval == 1);
01778         assert(d.overtime_flag == 0);
01779         assert(d.k == 1024);
01780         assert(d.twiddle == '-');
01781         assert(d.manual_width == 0);
01782         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01783         assert(d.display_datacount == 1);
01784         assert(d.display_throughput == 1);
01785         assert(d.display_time == 1);
01786         assert(d.display_percent == 1);
01787         assert(d.display_bar == 1);
01788         assert(d.display_summary == 1);
01789         assert(d.display_ansi == 0);
01790         assert(d.twiddle_fg_color == 0);
01791         assert(d.twiddle_bg_color == 0);
01792         assert(d.twiddle_fg_bold == 0);
01793         assert(d.datacount_fg_color == 0);
01794         assert(d.datacount_bg_color == 0);
01795         assert(d.datacount_fg_bold == 0);
01796         assert(d.throughput_label_fg_color == 0);
01797         assert(d.throughput_label_bg_color == 0);
01798         assert(d.throughput_label_fg_bold == 0);
01799         assert(d.throughput_fg_color == 0);
01800         assert(d.throughput_bg_color == 0);
01801         assert(d.throughput_fg_bold == 0);
01802         assert(d.time_label_fg_color == 0);
01803         assert(d.time_label_bg_color == 0);
01804         assert(d.time_label_fg_bold == 0);
01805         assert(d.percent_fg_color == 0);
01806         assert(d.percent_bg_color == 0);
01807         assert(d.percent_fg_bold == 0);
01808         assert(d.barbrace_fg_color == 0);
01809         assert(d.barbrace_bg_color == 0);
01810         assert(d.barbrace_fg_bold == 0);
01811         assert(d.bar_fg_color == 0);
01812         assert(d.bar_bg_color == 0);
01813         assert(d.bar_fg_bold == 0);
01814         assert(io.in == 0);
01815         assert(io.out == 1);
01816         assert(io.in_ready == 0);
01817         assert(io.out_ready == 0);
01818         assert(io.eof_in == 0);
01819         assert(io.eof_out == 0);
01820         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01821         /* assert(io.cbuf == 0x0); */
01822         assert(io.last_read == 0);
01823         assert(io.last_write == 0);
01824         assert(io.total_read == 0);
01825         assert(io.total_write == 0);
01826         assert(io.total_size == 0);
01827         assert(io.total_size_known == 0);
01828         assert(io.timeout == 250000);
01829 
01830         assert(parse_args(out, argc, argv) == 0);
01831 
01832 #ifdef PRINT_DEBUG
01833         print();
01834 #endif
01835         assert(d.start_time == 0);
01836         assert(d.total_time == 0);
01837         assert(d.current_time == 0);
01838         assert(d.elapsed_time == 0);
01839         assert(d.percent_complete == 0);
01840         assert(d.display_interval == 1);
01841         assert(d.overtime_flag == 0);
01842         assert(d.k == 1024);
01843         assert(d.twiddle == '-');
01844         assert(d.manual_width == 0);
01845         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01846         assert(d.display_datacount == 1);
01847         assert(d.display_throughput == 1);
01848         assert(d.display_time == 1);
01849         assert(d.display_percent == 1);
01850         assert(d.display_bar == 1);
01851         assert(d.display_summary == 1);
01852         assert(d.display_ansi == 0);
01853         assert(d.twiddle_fg_color == 0);
01854         assert(d.twiddle_bg_color == 0);
01855         assert(d.twiddle_fg_bold == 0);
01856         assert(d.datacount_fg_color == 0);
01857         assert(d.datacount_bg_color == 0);
01858         assert(d.datacount_fg_bold == 0);
01859         assert(d.throughput_label_fg_color == 0);
01860         assert(d.throughput_label_bg_color == 0);
01861         assert(d.throughput_label_fg_bold == 0);
01862         assert(d.throughput_fg_color == 0);
01863         assert(d.throughput_bg_color == 0);
01864         assert(d.throughput_fg_bold == 0);
01865         assert(d.time_label_fg_color == 0);
01866         assert(d.time_label_bg_color == 0);
01867         assert(d.time_label_fg_bold == 0);
01868         assert(d.percent_fg_color == 0);
01869         assert(d.percent_bg_color == 0);
01870         assert(d.percent_fg_bold == 0);
01871         assert(d.barbrace_fg_color == 0);
01872         assert(d.barbrace_bg_color == 0);
01873         assert(d.barbrace_fg_bold == 0);
01874         assert(d.bar_fg_color == 0);
01875         assert(d.bar_bg_color == 0);
01876         assert(d.bar_fg_bold == 0);
01877         assert(io.in == 0);
01878         assert(io.out == 1);
01879         assert(io.in_ready == 0);
01880         assert(io.out_ready == 0);
01881         assert(io.eof_in == 0);
01882         assert(io.eof_out == 0);
01883         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01884         /* assert(io.cbuf == 0x0); */
01885         assert(io.last_read == 0);
01886         assert(io.last_write == 0);
01887         assert(io.total_read == 0);
01888         assert(io.total_write == 0);
01889         assert(io.total_size == 0);
01890         assert(io.total_size_known == 0);
01891         assert(io.timeout == 250000);
01892 }
01893 
01894 void test15(FILE* out)
01895 {
01896         int argc = 0;
01897         char *argv[256] = { 0 };
01898 
01899         argv[argc++] = "ProgramName";
01900         argv[argc++] = "-bs";
01901         argv[argc++] = "1024.38002m";
01902 
01903         displayInit();
01904         ioInit();
01905 
01906 #ifdef PRINT_DEBUG
01907         print();
01908 #endif
01909         assert(d.start_time == 0);
01910         assert(d.total_time == 0);
01911         assert(d.current_time == 0);
01912         assert(d.elapsed_time == 0);
01913         assert(d.percent_complete == 0);
01914         assert(d.display_interval == 1);
01915         assert(d.overtime_flag == 0);
01916         assert(d.k == 1024);
01917         assert(d.twiddle == '-');
01918         assert(d.manual_width == 0);
01919         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01920         assert(d.display_datacount == 1);
01921         assert(d.display_throughput == 1);
01922         assert(d.display_time == 1);
01923         assert(d.display_percent == 1);
01924         assert(d.display_bar == 1);
01925         assert(d.display_summary == 1);
01926         assert(d.display_ansi == 0);
01927         assert(d.twiddle_fg_color == 0);
01928         assert(d.twiddle_bg_color == 0);
01929         assert(d.twiddle_fg_bold == 0);
01930         assert(d.datacount_fg_color == 0);
01931         assert(d.datacount_bg_color == 0);
01932         assert(d.datacount_fg_bold == 0);
01933         assert(d.throughput_label_fg_color == 0);
01934         assert(d.throughput_label_bg_color == 0);
01935         assert(d.throughput_label_fg_bold == 0);
01936         assert(d.throughput_fg_color == 0);
01937         assert(d.throughput_bg_color == 0);
01938         assert(d.throughput_fg_bold == 0);
01939         assert(d.time_label_fg_color == 0);
01940         assert(d.time_label_bg_color == 0);
01941         assert(d.time_label_fg_bold == 0);
01942         assert(d.percent_fg_color == 0);
01943         assert(d.percent_bg_color == 0);
01944         assert(d.percent_fg_bold == 0);
01945         assert(d.barbrace_fg_color == 0);
01946         assert(d.barbrace_bg_color == 0);
01947         assert(d.barbrace_fg_bold == 0);
01948         assert(d.bar_fg_color == 0);
01949         assert(d.bar_bg_color == 0);
01950         assert(d.bar_fg_bold == 0);
01951         assert(io.in == 0);
01952         assert(io.out == 1);
01953         assert(io.in_ready == 0);
01954         assert(io.out_ready == 0);
01955         assert(io.eof_in == 0);
01956         assert(io.eof_out == 0);
01957         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
01958         /* assert(io.cbuf == 0x0); */
01959         assert(io.last_read == 0);
01960         assert(io.last_write == 0);
01961         assert(io.total_read == 0);
01962         assert(io.total_write == 0);
01963         assert(io.total_size == 0);
01964         assert(io.total_size_known == 0);
01965         assert(io.timeout == 250000);
01966 
01967         assert(parse_args(out, argc, argv) == 0);
01968 
01969 #ifdef PRINT_DEBUG
01970         print();
01971 #endif
01972         assert(d.start_time == 0);
01973         assert(d.total_time == 0);
01974         assert(d.current_time == 0);
01975         assert(d.elapsed_time == 0);
01976         assert(d.percent_complete == 0);
01977         assert(d.display_interval == 1);
01978         assert(d.overtime_flag == 0);
01979         assert(d.k == 1024);
01980         assert(d.twiddle == '-');
01981         assert(d.manual_width == 0);
01982         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
01983         assert(d.display_datacount == 1);
01984         assert(d.display_throughput == 1);
01985         assert(d.display_time == 1);
01986         assert(d.display_percent == 1);
01987         assert(d.display_bar == 1);
01988         assert(d.display_summary == 1);
01989         assert(d.display_ansi == 0);
01990         assert(d.twiddle_fg_color == 0);
01991         assert(d.twiddle_bg_color == 0);
01992         assert(d.twiddle_fg_bold == 0);
01993         assert(d.datacount_fg_color == 0);
01994         assert(d.datacount_bg_color == 0);
01995         assert(d.datacount_fg_bold == 0);
01996         assert(d.throughput_label_fg_color == 0);
01997         assert(d.throughput_label_bg_color == 0);
01998         assert(d.throughput_label_fg_bold == 0);
01999         assert(d.throughput_fg_color == 0);
02000         assert(d.throughput_bg_color == 0);
02001         assert(d.throughput_fg_bold == 0);
02002         assert(d.time_label_fg_color == 0);
02003         assert(d.time_label_bg_color == 0);
02004         assert(d.time_label_fg_bold == 0);
02005         assert(d.percent_fg_color == 0);
02006         assert(d.percent_bg_color == 0);
02007         assert(d.percent_fg_bold == 0);
02008         assert(d.barbrace_fg_color == 0);
02009         assert(d.barbrace_bg_color == 0);
02010         assert(d.barbrace_fg_bold == 0);
02011         assert(d.bar_fg_color == 0);
02012         assert(d.bar_bg_color == 0);
02013         assert(d.bar_fg_bold == 0);
02014         assert(io.in == 0);
02015         assert(io.out == 1);
02016         assert(io.in_ready == 0);
02017         assert(io.out_ready == 0);
02018         assert(io.eof_in == 0);
02019         assert(io.eof_out == 0);
02020         assert(io.buffer_size == 1074140304);
02021         /* assert(io.cbuf == 0x0); */
02022         assert(io.last_read == 0);
02023         assert(io.last_write == 0);
02024         assert(io.total_read == 0);
02025         assert(io.total_write == 0);
02026         assert(io.total_size == 0);
02027         assert(io.total_size_known == 0);
02028         assert(io.timeout == 250000);
02029 }
02030 
02031 void test16(FILE* out)
02032 {
02033         int argc = 0;
02034         char *argv[256] = { 0 };
02035 
02036         argv[argc++] = "ProgramName";
02037         argv[argc++] = "-i";
02038 
02039         displayInit();
02040         ioInit();
02041 
02042 #ifdef PRINT_DEBUG
02043         print();
02044 #endif
02045         assert(d.start_time == 0);
02046         assert(d.total_time == 0);
02047         assert(d.current_time == 0);
02048         assert(d.elapsed_time == 0);
02049         assert(d.percent_complete == 0);
02050         assert(d.display_interval == 1);
02051         assert(d.overtime_flag == 0);
02052         assert(d.k == 1024);
02053         assert(d.twiddle == '-');
02054         assert(d.manual_width == 0);
02055         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02056         assert(d.display_datacount == 1);
02057         assert(d.display_throughput == 1);
02058         assert(d.display_time == 1);
02059         assert(d.display_percent == 1);
02060         assert(d.display_bar == 1);
02061         assert(d.display_summary == 1);
02062         assert(d.display_ansi == 0);
02063         assert(d.twiddle_fg_color == 0);
02064         assert(d.twiddle_bg_color == 0);
02065         assert(d.twiddle_fg_bold == 0);
02066         assert(d.datacount_fg_color == 0);
02067         assert(d.datacount_bg_color == 0);
02068         assert(d.datacount_fg_bold == 0);
02069         assert(d.throughput_label_fg_color == 0);
02070         assert(d.throughput_label_bg_color == 0);
02071         assert(d.throughput_label_fg_bold == 0);
02072         assert(d.throughput_fg_color == 0);
02073         assert(d.throughput_bg_color == 0);
02074         assert(d.throughput_fg_bold == 0);
02075         assert(d.time_label_fg_color == 0);
02076         assert(d.time_label_bg_color == 0);
02077         assert(d.time_label_fg_bold == 0);
02078         assert(d.percent_fg_color == 0);
02079         assert(d.percent_bg_color == 0);
02080         assert(d.percent_fg_bold == 0);
02081         assert(d.barbrace_fg_color == 0);
02082         assert(d.barbrace_bg_color == 0);
02083         assert(d.barbrace_fg_bold == 0);
02084         assert(d.bar_fg_color == 0);
02085         assert(d.bar_bg_color == 0);
02086         assert(d.bar_fg_bold == 0);
02087         assert(io.in == 0);
02088         assert(io.out == 1);
02089         assert(io.in_ready == 0);
02090         assert(io.out_ready == 0);
02091         assert(io.eof_in == 0);
02092         assert(io.eof_out == 0);
02093         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02094         /* assert(io.cbuf == 0x0); */
02095         assert(io.last_read == 0);
02096         assert(io.last_write == 0);
02097         assert(io.total_read == 0);
02098         assert(io.total_write == 0);
02099         assert(io.total_size == 0);
02100         assert(io.total_size_known == 0);
02101         assert(io.timeout == 250000);
02102 
02103         assert(parse_args(out, argc, argv) == 1);
02104 
02105 #ifdef PRINT_DEBUG
02106         print();
02107 #endif
02108         assert(d.start_time == 0);
02109         assert(d.total_time == 0);
02110         assert(d.current_time == 0);
02111         assert(d.elapsed_time == 0);
02112         assert(d.percent_complete == 0);
02113         assert(d.display_interval == 1);
02114         assert(d.overtime_flag == 0);
02115         assert(d.k == 1024);
02116         assert(d.twiddle == '-');
02117         assert(d.manual_width == 0);
02118         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02119         assert(d.display_datacount == 1);
02120         assert(d.display_throughput == 1);
02121         assert(d.display_time == 1);
02122         assert(d.display_percent == 1);
02123         assert(d.display_bar == 1);
02124         assert(d.display_summary == 1);
02125         assert(d.display_ansi == 0);
02126         assert(d.twiddle_fg_color == 0);
02127         assert(d.twiddle_bg_color == 0);
02128         assert(d.twiddle_fg_bold == 0);
02129         assert(d.datacount_fg_color == 0);
02130         assert(d.datacount_bg_color == 0);
02131         assert(d.datacount_fg_bold == 0);
02132         assert(d.throughput_label_fg_color == 0);
02133         assert(d.throughput_label_bg_color == 0);
02134         assert(d.throughput_label_fg_bold == 0);
02135         assert(d.throughput_fg_color == 0);
02136         assert(d.throughput_bg_color == 0);
02137         assert(d.throughput_fg_bold == 0);
02138         assert(d.time_label_fg_color == 0);
02139         assert(d.time_label_bg_color == 0);
02140         assert(d.time_label_fg_bold == 0);
02141         assert(d.percent_fg_color == 0);
02142         assert(d.percent_bg_color == 0);
02143         assert(d.percent_fg_bold == 0);
02144         assert(d.barbrace_fg_color == 0);
02145         assert(d.barbrace_bg_color == 0);
02146         assert(d.barbrace_fg_bold == 0);
02147         assert(d.bar_fg_color == 0);
02148         assert(d.bar_bg_color == 0);
02149         assert(d.bar_fg_bold == 0);
02150         assert(io.in == 0);
02151         assert(io.out == 1);
02152         assert(io.in_ready == 0);
02153         assert(io.out_ready == 0);
02154         assert(io.eof_in == 0);
02155         assert(io.eof_out == 0);
02156         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02157         /* assert(io.cbuf == 0x0); */
02158         assert(io.last_read == 0);
02159         assert(io.last_write == 0);
02160         assert(io.total_read == 0);
02161         assert(io.total_write == 0);
02162         assert(io.total_size == 0);
02163         assert(io.total_size_known == 0);
02164         assert(io.timeout == 250000);
02165 }
02166 
02167 void test17(FILE* out)
02168 {
02169         int argc = 0;
02170         char *argv[256] = { 0 };
02171 
02172         argv[argc++] = "ProgramName";
02173         argv[argc++] = "-i";
02174         argv[argc++] = "/dev/null";
02175 
02176         displayInit();
02177         ioInit();
02178 
02179 #ifdef PRINT_DEBUG
02180         print();
02181 #endif
02182         assert(d.start_time == 0);
02183         assert(d.total_time == 0);
02184         assert(d.current_time == 0);
02185         assert(d.elapsed_time == 0);
02186         assert(d.percent_complete == 0);
02187         assert(d.display_interval == 1);
02188         assert(d.overtime_flag == 0);
02189         assert(d.k == 1024);
02190         assert(d.twiddle == '-');
02191         assert(d.manual_width == 0);
02192         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02193         assert(d.display_datacount == 1);
02194         assert(d.display_throughput == 1);
02195         assert(d.display_time == 1);
02196         assert(d.display_percent == 1);
02197         assert(d.display_bar == 1);
02198         assert(d.display_summary == 1);
02199         assert(d.display_ansi == 0);
02200         assert(d.twiddle_fg_color == 0);
02201         assert(d.twiddle_bg_color == 0);
02202         assert(d.twiddle_fg_bold == 0);
02203         assert(d.datacount_fg_color == 0);
02204         assert(d.datacount_bg_color == 0);
02205         assert(d.datacount_fg_bold == 0);
02206         assert(d.throughput_label_fg_color == 0);
02207         assert(d.throughput_label_bg_color == 0);
02208         assert(d.throughput_label_fg_bold == 0);
02209         assert(d.throughput_fg_color == 0);
02210         assert(d.throughput_bg_color == 0);
02211         assert(d.throughput_fg_bold == 0);
02212         assert(d.time_label_fg_color == 0);
02213         assert(d.time_label_bg_color == 0);
02214         assert(d.time_label_fg_bold == 0);
02215         assert(d.percent_fg_color == 0);
02216         assert(d.percent_bg_color == 0);
02217         assert(d.percent_fg_bold == 0);
02218         assert(d.barbrace_fg_color == 0);
02219         assert(d.barbrace_bg_color == 0);
02220         assert(d.barbrace_fg_bold == 0);
02221         assert(d.bar_fg_color == 0);
02222         assert(d.bar_bg_color == 0);
02223         assert(d.bar_fg_bold == 0);
02224         assert(io.in == 0);
02225         assert(io.out == 1);
02226         assert(io.in_ready == 0);
02227         assert(io.out_ready == 0);
02228         assert(io.eof_in == 0);
02229         assert(io.eof_out == 0);
02230         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02231         /* assert(io.cbuf == 0x0); */
02232         assert(io.last_read == 0);
02233         assert(io.last_write == 0);
02234         assert(io.total_read == 0);
02235         assert(io.total_write == 0);
02236         assert(io.total_size == 0);
02237         assert(io.total_size_known == 0);
02238         assert(io.timeout == 250000);
02239 
02240         assert(parse_args(out, argc, argv) == 0);
02241 
02242 #ifdef PRINT_DEBUG
02243         print();
02244 #endif
02245         assert(d.start_time == 0);
02246         assert(d.total_time == 0);
02247         assert(d.current_time == 0);
02248         assert(d.elapsed_time == 0);
02249         assert(d.percent_complete == 0);
02250         assert(d.display_interval == 1);
02251         assert(d.overtime_flag == 0);
02252         assert(d.k == 1024);
02253         assert(d.twiddle == '-');
02254         assert(d.manual_width == 0);
02255         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02256         assert(d.display_datacount == 1);
02257         assert(d.display_throughput == 1);
02258         assert(d.display_time == 1);
02259         assert(d.display_percent == 1);
02260         assert(d.display_bar == 1);
02261         assert(d.display_summary == 1);
02262         assert(d.display_ansi == 0);
02263         assert(d.twiddle_fg_color == 0);
02264         assert(d.twiddle_bg_color == 0);
02265         assert(d.twiddle_fg_bold == 0);
02266         assert(d.datacount_fg_color == 0);
02267         assert(d.datacount_bg_color == 0);
02268         assert(d.datacount_fg_bold == 0);
02269         assert(d.throughput_label_fg_color == 0);
02270         assert(d.throughput_label_bg_color == 0);
02271         assert(d.throughput_label_fg_bold == 0);
02272         assert(d.throughput_fg_color == 0);
02273         assert(d.throughput_bg_color == 0);
02274         assert(d.throughput_fg_bold == 0);
02275         assert(d.time_label_fg_color == 0);
02276         assert(d.time_label_bg_color == 0);
02277         assert(d.time_label_fg_bold == 0);
02278         assert(d.percent_fg_color == 0);
02279         assert(d.percent_bg_color == 0);
02280         assert(d.percent_fg_bold == 0);
02281         assert(d.barbrace_fg_color == 0);
02282         assert(d.barbrace_bg_color == 0);
02283         assert(d.barbrace_fg_bold == 0);
02284         assert(d.bar_fg_color == 0);
02285         assert(d.bar_bg_color == 0);
02286         assert(d.bar_fg_bold == 0);
02287         assert(io.in == 0);
02288         assert(io.out == 1);
02289         assert(io.in_ready == 0);
02290         assert(io.out_ready == 0);
02291         assert(io.eof_in == 0);
02292         assert(io.eof_out == 0);
02293         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02294         /* assert(io.cbuf == 0x0); */
02295         assert(io.last_read == 0);
02296         assert(io.last_write == 0);
02297         assert(io.total_read == 0);
02298         assert(io.total_write == 0);
02299         assert(io.total_size == 0);
02300         assert(io.total_size_known == 0);
02301         assert(io.timeout == 250000);
02302 }
02303 
02304 void test18(FILE* out)
02305 {
02306         int argc = 0;
02307         char *argv[256] = { 0 };
02308 
02309         argv[argc++] = "ProgramName";
02310         argv[argc++] = "-i";
02311         argv[argc++] = "1024.38002m";
02312 
02313         displayInit();
02314         ioInit();
02315 
02316 #ifdef PRINT_DEBUG
02317         print();
02318 #endif
02319         assert(d.start_time == 0);
02320         assert(d.total_time == 0);
02321         assert(d.current_time == 0);
02322         assert(d.elapsed_time == 0);
02323         assert(d.percent_complete == 0);
02324         assert(d.display_interval == 1);
02325         assert(d.overtime_flag == 0);
02326         assert(d.k == 1024);
02327         assert(d.twiddle == '-');
02328         assert(d.manual_width == 0);
02329         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02330         assert(d.display_datacount == 1);
02331         assert(d.display_throughput == 1);
02332         assert(d.display_time == 1);
02333         assert(d.display_percent == 1);
02334         assert(d.display_bar == 1);
02335         assert(d.display_summary == 1);
02336         assert(d.display_ansi == 0);
02337         assert(d.twiddle_fg_color == 0);
02338         assert(d.twiddle_bg_color == 0);
02339         assert(d.twiddle_fg_bold == 0);
02340         assert(d.datacount_fg_color == 0);
02341         assert(d.datacount_bg_color == 0);
02342         assert(d.datacount_fg_bold == 0);
02343         assert(d.throughput_label_fg_color == 0);
02344         assert(d.throughput_label_bg_color == 0);
02345         assert(d.throughput_label_fg_bold == 0);
02346         assert(d.throughput_fg_color == 0);
02347         assert(d.throughput_bg_color == 0);
02348         assert(d.throughput_fg_bold == 0);
02349         assert(d.time_label_fg_color == 0);
02350         assert(d.time_label_bg_color == 0);
02351         assert(d.time_label_fg_bold == 0);
02352         assert(d.percent_fg_color == 0);
02353         assert(d.percent_bg_color == 0);
02354         assert(d.percent_fg_bold == 0);
02355         assert(d.barbrace_fg_color == 0);
02356         assert(d.barbrace_bg_color == 0);
02357         assert(d.barbrace_fg_bold == 0);
02358         assert(d.bar_fg_color == 0);
02359         assert(d.bar_bg_color == 0);
02360         assert(d.bar_fg_bold == 0);
02361         assert(io.in == 0);
02362         assert(io.out == 1);
02363         assert(io.in_ready == 0);
02364         assert(io.out_ready == 0);
02365         assert(io.eof_in == 0);
02366         assert(io.eof_out == 0);
02367         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02368         /* assert(io.cbuf == 0x0); */
02369         assert(io.last_read == 0);
02370         assert(io.last_write == 0);
02371         assert(io.total_read == 0);
02372         assert(io.total_write == 0);
02373         assert(io.total_size == 0);
02374         assert(io.total_size_known == 0);
02375         assert(io.timeout == 250000);
02376 
02377         assert(parse_args(out, argc, argv) == 0);
02378 
02379 #ifdef PRINT_DEBUG
02380         print();
02381 #endif
02382         assert(d.start_time == 0);
02383         assert(d.total_time == 0);
02384         assert(d.current_time == 0);
02385         assert(d.elapsed_time == 0);
02386         assert(d.percent_complete == 0);
02387         assert(d.display_interval == 1);
02388         assert(d.overtime_flag == 0);
02389         assert(d.k == 1024);
02390         assert(d.twiddle == '-');
02391         assert(d.manual_width == 0);
02392         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02393         assert(d.display_datacount == 1);
02394         assert(d.display_throughput == 1);
02395         assert(d.display_time == 1);
02396         assert(d.display_percent == 1);
02397         assert(d.display_bar == 1);
02398         assert(d.display_summary == 1);
02399         assert(d.display_ansi == 0);
02400         assert(d.twiddle_fg_color == 0);
02401         assert(d.twiddle_bg_color == 0);
02402         assert(d.twiddle_fg_bold == 0);
02403         assert(d.datacount_fg_color == 0);
02404         assert(d.datacount_bg_color == 0);
02405         assert(d.datacount_fg_bold == 0);
02406         assert(d.throughput_label_fg_color == 0);
02407         assert(d.throughput_label_bg_color == 0);
02408         assert(d.throughput_label_fg_bold == 0);
02409         assert(d.throughput_fg_color == 0);
02410         assert(d.throughput_bg_color == 0);
02411         assert(d.throughput_fg_bold == 0);
02412         assert(d.time_label_fg_color == 0);
02413         assert(d.time_label_bg_color == 0);
02414         assert(d.time_label_fg_bold == 0);
02415         assert(d.percent_fg_color == 0);
02416         assert(d.percent_bg_color == 0);
02417         assert(d.percent_fg_bold == 0);
02418         assert(d.barbrace_fg_color == 0);
02419         assert(d.barbrace_bg_color == 0);
02420         assert(d.barbrace_fg_bold == 0);
02421         assert(d.bar_fg_color == 0);
02422         assert(d.bar_bg_color == 0);
02423         assert(d.bar_fg_bold == 0);
02424         assert(io.in == 0);
02425         assert(io.out == 1);
02426         assert(io.in_ready == 0);
02427         assert(io.out_ready == 0);
02428         assert(io.eof_in == 0);
02429         assert(io.eof_out == 0);
02430         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02431         /* assert(io.cbuf == 0x0); */
02432         assert(io.last_read == 0);
02433         assert(io.last_write == 0);
02434         assert(io.total_read == 0);
02435         assert(io.total_write == 0);
02436         assert(io.total_size == 0);
02437         assert(io.total_size_known == 0);
02438         assert(io.timeout == 250000);
02439 }
02440 
02441 void test19(FILE* out)
02442 {
02443         int argc = 0;
02444         char *argv[256] = { 0 };
02445 
02446         argv[argc++] = "ProgramName";
02447         argv[argc++] = "-i";
02448         argv[argc++] = "1024.38002";
02449 
02450         displayInit();
02451         ioInit();
02452 
02453 #ifdef PRINT_DEBUG
02454         print();
02455 #endif
02456         assert(d.start_time == 0);
02457         assert(d.total_time == 0);
02458         assert(d.current_time == 0);
02459         assert(d.elapsed_time == 0);
02460         assert(d.percent_complete == 0);
02461         assert(d.display_interval == 1);
02462         assert(d.overtime_flag == 0);
02463         assert(d.k == 1024);
02464         assert(d.twiddle == '-');
02465         assert(d.manual_width == 0);
02466         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02467         assert(d.display_datacount == 1);
02468         assert(d.display_throughput == 1);
02469         assert(d.display_time == 1);
02470         assert(d.display_percent == 1);
02471         assert(d.display_bar == 1);
02472         assert(d.display_summary == 1);
02473         assert(d.display_ansi == 0);
02474         assert(d.twiddle_fg_color == 0);
02475         assert(d.twiddle_bg_color == 0);
02476         assert(d.twiddle_fg_bold == 0);
02477         assert(d.datacount_fg_color == 0);
02478         assert(d.datacount_bg_color == 0);
02479         assert(d.datacount_fg_bold == 0);
02480         assert(d.throughput_label_fg_color == 0);
02481         assert(d.throughput_label_bg_color == 0);
02482         assert(d.throughput_label_fg_bold == 0);
02483         assert(d.throughput_fg_color == 0);
02484         assert(d.throughput_bg_color == 0);
02485         assert(d.throughput_fg_bold == 0);
02486         assert(d.time_label_fg_color == 0);
02487         assert(d.time_label_bg_color == 0);
02488         assert(d.time_label_fg_bold == 0);
02489         assert(d.percent_fg_color == 0);
02490         assert(d.percent_bg_color == 0);
02491         assert(d.percent_fg_bold == 0);
02492         assert(d.barbrace_fg_color == 0);
02493         assert(d.barbrace_bg_color == 0);
02494         assert(d.barbrace_fg_bold == 0);
02495         assert(d.bar_fg_color == 0);
02496         assert(d.bar_bg_color == 0);
02497         assert(d.bar_fg_bold == 0);
02498         assert(io.in == 0);
02499         assert(io.out == 1);
02500         assert(io.in_ready == 0);
02501         assert(io.out_ready == 0);
02502         assert(io.eof_in == 0);
02503         assert(io.eof_out == 0);
02504         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02505         /* assert(io.cbuf == 0x0); */
02506         assert(io.last_read == 0);
02507         assert(io.last_write == 0);
02508         assert(io.total_read == 0);
02509         assert(io.total_write == 0);
02510         assert(io.total_size == 0);
02511         assert(io.total_size_known == 0);
02512         assert(io.timeout == 250000);
02513 
02514         assert(parse_args(out, argc, argv) == 0);
02515 
02516 #ifdef PRINT_DEBUG
02517         print();
02518 #endif
02519         assert(d.start_time == 0);
02520         assert(d.total_time == 0);
02521         assert(d.current_time == 0);
02522         assert(d.elapsed_time == 0);
02523         assert(d.percent_complete == 0);
02524         assert(d.display_interval == 1);
02525         assert(d.overtime_flag == 0);
02526         assert(d.k == 1024);
02527         assert(d.twiddle == '-');
02528         assert(d.manual_width == 0);
02529         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02530         assert(d.display_datacount == 1);
02531         assert(d.display_throughput == 1);
02532         assert(d.display_time == 1);
02533         assert(d.display_percent == 1);
02534         assert(d.display_bar == 1);
02535         assert(d.display_summary == 1);
02536         assert(d.display_ansi == 0);
02537         assert(d.twiddle_fg_color == 0);
02538         assert(d.twiddle_bg_color == 0);
02539         assert(d.twiddle_fg_bold == 0);
02540         assert(d.datacount_fg_color == 0);
02541         assert(d.datacount_bg_color == 0);
02542         assert(d.datacount_fg_bold == 0);
02543         assert(d.throughput_label_fg_color == 0);
02544         assert(d.throughput_label_bg_color == 0);
02545         assert(d.throughput_label_fg_bold == 0);
02546         assert(d.throughput_fg_color == 0);
02547         assert(d.throughput_bg_color == 0);
02548         assert(d.throughput_fg_bold == 0);
02549         assert(d.time_label_fg_color == 0);
02550         assert(d.time_label_bg_color == 0);
02551         assert(d.time_label_fg_bold == 0);
02552         assert(d.percent_fg_color == 0);
02553         assert(d.percent_bg_color == 0);
02554         assert(d.percent_fg_bold == 0);
02555         assert(d.barbrace_fg_color == 0);
02556         assert(d.barbrace_bg_color == 0);
02557         assert(d.barbrace_fg_bold == 0);
02558         assert(d.bar_fg_color == 0);
02559         assert(d.bar_bg_color == 0);
02560         assert(d.bar_fg_bold == 0);
02561         assert(io.in == 0);
02562         assert(io.out == 1);
02563         assert(io.in_ready == 0);
02564         assert(io.out_ready == 0);
02565         assert(io.eof_in == 0);
02566         assert(io.eof_out == 0);
02567         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02568         /* assert(io.cbuf == 0x0); */
02569         assert(io.last_read == 0);
02570         assert(io.last_write == 0);
02571         assert(io.total_read == 0);
02572         assert(io.total_write == 0);
02573         assert(io.total_size == 0);
02574         assert(io.total_size_known == 0);
02575         assert(io.timeout == 250000);
02576 }
02577 
02578 void test20(FILE* out)
02579 {
02580         int argc = 0;
02581         char *argv[256] = { 0 };
02582 
02583         argv[argc++] = "ProgramName";
02584         argv[argc++] = "-i";
02585         argv[argc++] = "30";
02586 
02587         displayInit();
02588         ioInit();
02589 
02590 #ifdef PRINT_DEBUG
02591         print();
02592 #endif
02593         assert(d.start_time == 0);
02594         assert(d.total_time == 0);
02595         assert(d.current_time == 0);
02596         assert(d.elapsed_time == 0);
02597         assert(d.percent_complete == 0);
02598         assert(d.display_interval == 1);
02599         assert(d.overtime_flag == 0);
02600         assert(d.k == 1024);
02601         assert(d.twiddle == '-');
02602         assert(d.manual_width == 0);
02603         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02604         assert(d.display_datacount == 1);
02605         assert(d.display_throughput == 1);
02606         assert(d.display_time == 1);
02607         assert(d.display_percent == 1);
02608         assert(d.display_bar == 1);
02609         assert(d.display_summary == 1);
02610         assert(d.display_ansi == 0);
02611         assert(d.twiddle_fg_color == 0);
02612         assert(d.twiddle_bg_color == 0);
02613         assert(d.twiddle_fg_bold == 0);
02614         assert(d.datacount_fg_color == 0);
02615         assert(d.datacount_bg_color == 0);
02616         assert(d.datacount_fg_bold == 0);
02617         assert(d.throughput_label_fg_color == 0);
02618         assert(d.throughput_label_bg_color == 0);
02619         assert(d.throughput_label_fg_bold == 0);
02620         assert(d.throughput_fg_color == 0);
02621         assert(d.throughput_bg_color == 0);
02622         assert(d.throughput_fg_bold == 0);
02623         assert(d.time_label_fg_color == 0);
02624         assert(d.time_label_bg_color == 0);
02625         assert(d.time_label_fg_bold == 0);
02626         assert(d.percent_fg_color == 0);
02627         assert(d.percent_bg_color == 0);
02628         assert(d.percent_fg_bold == 0);
02629         assert(d.barbrace_fg_color == 0);
02630         assert(d.barbrace_bg_color == 0);
02631         assert(d.barbrace_fg_bold == 0);
02632         assert(d.bar_fg_color == 0);
02633         assert(d.bar_bg_color == 0);
02634         assert(d.bar_fg_bold == 0);
02635         assert(io.in == 0);
02636         assert(io.out == 1);
02637         assert(io.in_ready == 0);
02638         assert(io.out_ready == 0);
02639         assert(io.eof_in == 0);
02640         assert(io.eof_out == 0);
02641         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02642         /* assert(io.cbuf == 0x0); */
02643         assert(io.last_read == 0);
02644         assert(io.last_write == 0);
02645         assert(io.total_read == 0);
02646         assert(io.total_write == 0);
02647         assert(io.total_size == 0);
02648         assert(io.total_size_known == 0);
02649         assert(io.timeout == 250000);
02650 
02651         assert(parse_args(out, argc, argv) == 0);
02652 
02653 #ifdef PRINT_DEBUG
02654         print();
02655 #endif
02656         assert(d.start_time == 0);
02657         assert(d.total_time == 0);
02658         assert(d.current_time == 0);
02659         assert(d.elapsed_time == 0);
02660         assert(d.percent_complete == 0);
02661         assert(d.display_interval == 30);
02662         assert(d.overtime_flag == 0);
02663         assert(d.k == 1024);
02664         assert(d.twiddle == '-');
02665         assert(d.manual_width == 0);
02666         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02667         assert(d.display_datacount == 1);
02668         assert(d.display_throughput == 1);
02669         assert(d.display_time == 1);
02670         assert(d.display_percent == 1);
02671         assert(d.display_bar == 1);
02672         assert(d.display_summary == 1);
02673         assert(d.display_ansi == 0);
02674         assert(d.twiddle_fg_color == 0);
02675         assert(d.twiddle_bg_color == 0);
02676         assert(d.twiddle_fg_bold == 0);
02677         assert(d.datacount_fg_color == 0);
02678         assert(d.datacount_bg_color == 0);
02679         assert(d.datacount_fg_bold == 0);
02680         assert(d.throughput_label_fg_color == 0);
02681         assert(d.throughput_label_bg_color == 0);
02682         assert(d.throughput_label_fg_bold == 0);
02683         assert(d.throughput_fg_color == 0);
02684         assert(d.throughput_bg_color == 0);
02685         assert(d.throughput_fg_bold == 0);
02686         assert(d.time_label_fg_color == 0);
02687         assert(d.time_label_bg_color == 0);
02688         assert(d.time_label_fg_bold == 0);
02689         assert(d.percent_fg_color == 0);
02690         assert(d.percent_bg_color == 0);
02691         assert(d.percent_fg_bold == 0);
02692         assert(d.barbrace_fg_color == 0);
02693         assert(d.barbrace_bg_color == 0);
02694         assert(d.barbrace_fg_bold == 0);
02695         assert(d.bar_fg_color == 0);
02696         assert(d.bar_bg_color == 0);
02697         assert(d.bar_fg_bold == 0);
02698         assert(io.in == 0);
02699         assert(io.out == 1);
02700         assert(io.in_ready == 0);
02701         assert(io.out_ready == 0);
02702         assert(io.eof_in == 0);
02703         assert(io.eof_out == 0);
02704         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02705         /* assert(io.cbuf == 0x0); */
02706         assert(io.last_read == 0);
02707         assert(io.last_write == 0);
02708         assert(io.total_read == 0);
02709         assert(io.total_write == 0);
02710         assert(io.total_size == 0);
02711         assert(io.total_size_known == 0);
02712         assert(io.timeout == 250000);
02713 }
02714 
02715 void test21(FILE* out)
02716 {
02717         int argc = 0;
02718         char *argv[256] = { 0 };
02719 
02720         argv[argc++] = "ProgramName";
02721         argv[argc++] = "-t";
02722 
02723         displayInit();
02724         ioInit();
02725 
02726 #ifdef PRINT_DEBUG
02727         print();
02728 #endif
02729         assert(d.start_time == 0);
02730         assert(d.total_time == 0);
02731         assert(d.current_time == 0);
02732         assert(d.elapsed_time == 0);
02733         assert(d.percent_complete == 0);
02734         assert(d.display_interval == 1);
02735         assert(d.overtime_flag == 0);
02736         assert(d.k == 1024);
02737         assert(d.twiddle == '-');
02738         assert(d.manual_width == 0);
02739         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02740         assert(d.display_datacount == 1);
02741         assert(d.display_throughput == 1);
02742         assert(d.display_time == 1);
02743         assert(d.display_percent == 1);
02744         assert(d.display_bar == 1);
02745         assert(d.display_summary == 1);
02746         assert(d.display_ansi == 0);
02747         assert(d.twiddle_fg_color == 0);
02748         assert(d.twiddle_bg_color == 0);
02749         assert(d.twiddle_fg_bold == 0);
02750         assert(d.datacount_fg_color == 0);
02751         assert(d.datacount_bg_color == 0);
02752         assert(d.datacount_fg_bold == 0);
02753         assert(d.throughput_label_fg_color == 0);
02754         assert(d.throughput_label_bg_color == 0);
02755         assert(d.throughput_label_fg_bold == 0);
02756         assert(d.throughput_fg_color == 0);
02757         assert(d.throughput_bg_color == 0);
02758         assert(d.throughput_fg_bold == 0);
02759         assert(d.time_label_fg_color == 0);
02760         assert(d.time_label_bg_color == 0);
02761         assert(d.time_label_fg_bold == 0);
02762         assert(d.percent_fg_color == 0);
02763         assert(d.percent_bg_color == 0);
02764         assert(d.percent_fg_bold == 0);
02765         assert(d.barbrace_fg_color == 0);
02766         assert(d.barbrace_bg_color == 0);
02767         assert(d.barbrace_fg_bold == 0);
02768         assert(d.bar_fg_color == 0);
02769         assert(d.bar_bg_color == 0);
02770         assert(d.bar_fg_bold == 0);
02771         assert(io.in == 0);
02772         assert(io.out == 1);
02773         assert(io.in_ready == 0);
02774         assert(io.out_ready == 0);
02775         assert(io.eof_in == 0);
02776         assert(io.eof_out == 0);
02777         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02778         /* assert(io.cbuf == 0x0); */
02779         assert(io.last_read == 0);
02780         assert(io.last_write == 0);
02781         assert(io.total_read == 0);
02782         assert(io.total_write == 0);
02783         assert(io.total_size == 0);
02784         assert(io.total_size_known == 0);
02785         assert(io.timeout == 250000);
02786 
02787         assert(parse_args(out, argc, argv) == 1);
02788 
02789 #ifdef PRINT_DEBUG
02790         print();
02791 #endif
02792         assert(d.start_time == 0);
02793         assert(d.total_time == 0);
02794         assert(d.current_time == 0);
02795         assert(d.elapsed_time == 0);
02796         assert(d.percent_complete == 0);
02797         assert(d.display_interval == 1);
02798         assert(d.overtime_flag == 0);
02799         assert(d.k == 1024);
02800         assert(d.twiddle == '-');
02801         assert(d.manual_width == 0);
02802         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02803         assert(d.display_datacount == 1);
02804         assert(d.display_throughput == 1);
02805         assert(d.display_time == 1);
02806         assert(d.display_percent == 1);
02807         assert(d.display_bar == 1);
02808         assert(d.display_summary == 1);
02809         assert(d.display_ansi == 0);
02810         assert(d.twiddle_fg_color == 0);
02811         assert(d.twiddle_bg_color == 0);
02812         assert(d.twiddle_fg_bold == 0);
02813         assert(d.datacount_fg_color == 0);
02814         assert(d.datacount_bg_color == 0);
02815         assert(d.datacount_fg_bold == 0);
02816         assert(d.throughput_label_fg_color == 0);
02817         assert(d.throughput_label_bg_color == 0);
02818         assert(d.throughput_label_fg_bold == 0);
02819         assert(d.throughput_fg_color == 0);
02820         assert(d.throughput_bg_color == 0);
02821         assert(d.throughput_fg_bold == 0);
02822         assert(d.time_label_fg_color == 0);
02823         assert(d.time_label_bg_color == 0);
02824         assert(d.time_label_fg_bold == 0);
02825         assert(d.percent_fg_color == 0);
02826         assert(d.percent_bg_color == 0);
02827         assert(d.percent_fg_bold == 0);
02828         assert(d.barbrace_fg_color == 0);
02829         assert(d.barbrace_bg_color == 0);
02830         assert(d.barbrace_fg_bold == 0);
02831         assert(d.bar_fg_color == 0);
02832         assert(d.bar_bg_color == 0);
02833         assert(d.bar_fg_bold == 0);
02834         assert(io.in == 0);
02835         assert(io.out == 1);
02836         assert(io.in_ready == 0);
02837         assert(io.out_ready == 0);
02838         assert(io.eof_in == 0);
02839         assert(io.eof_out == 0);
02840         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02841         /* assert(io.cbuf == 0x0); */
02842         assert(io.last_read == 0);
02843         assert(io.last_write == 0);
02844         assert(io.total_read == 0);
02845         assert(io.total_write == 0);
02846         assert(io.total_size == 0);
02847         assert(io.total_size_known == 0);
02848         assert(io.timeout == 250000);
02849 }
02850 
02851 void test22(FILE* out)
02852 {
02853         int argc = 0;
02854         char *argv[256] = { 0 };
02855 
02856         argv[argc++] = "ProgramName";
02857         argv[argc++] = "-t";
02858         argv[argc++] = "/dev/null";
02859 
02860         displayInit();
02861         ioInit();
02862 
02863 #ifdef PRINT_DEBUG
02864         print();
02865 #endif
02866         assert(d.start_time == 0);
02867         assert(d.total_time == 0);
02868         assert(d.current_time == 0);
02869         assert(d.elapsed_time == 0);
02870         assert(d.percent_complete == 0);
02871         assert(d.display_interval == 1);
02872         assert(d.overtime_flag == 0);
02873         assert(d.k == 1024);
02874         assert(d.twiddle == '-');
02875         assert(d.manual_width == 0);
02876         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02877         assert(d.display_datacount == 1);
02878         assert(d.display_throughput == 1);
02879         assert(d.display_time == 1);
02880         assert(d.display_percent == 1);
02881         assert(d.display_bar == 1);
02882         assert(d.display_summary == 1);
02883         assert(d.display_ansi == 0);
02884         assert(d.twiddle_fg_color == 0);
02885         assert(d.twiddle_bg_color == 0);
02886         assert(d.twiddle_fg_bold == 0);
02887         assert(d.datacount_fg_color == 0);
02888         assert(d.datacount_bg_color == 0);
02889         assert(d.datacount_fg_bold == 0);
02890         assert(d.throughput_label_fg_color == 0);
02891         assert(d.throughput_label_bg_color == 0);
02892         assert(d.throughput_label_fg_bold == 0);
02893         assert(d.throughput_fg_color == 0);
02894         assert(d.throughput_bg_color == 0);
02895         assert(d.throughput_fg_bold == 0);
02896         assert(d.time_label_fg_color == 0);
02897         assert(d.time_label_bg_color == 0);
02898         assert(d.time_label_fg_bold == 0);
02899         assert(d.percent_fg_color == 0);
02900         assert(d.percent_bg_color == 0);
02901         assert(d.percent_fg_bold == 0);
02902         assert(d.barbrace_fg_color == 0);
02903         assert(d.barbrace_bg_color == 0);
02904         assert(d.barbrace_fg_bold == 0);
02905         assert(d.bar_fg_color == 0);
02906         assert(d.bar_bg_color == 0);
02907         assert(d.bar_fg_bold == 0);
02908         assert(io.in == 0);
02909         assert(io.out == 1);
02910         assert(io.in_ready == 0);
02911         assert(io.out_ready == 0);
02912         assert(io.eof_in == 0);
02913         assert(io.eof_out == 0);
02914         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02915         /* assert(io.cbuf == 0x0); */
02916         assert(io.last_read == 0);
02917         assert(io.last_write == 0);
02918         assert(io.total_read == 0);
02919         assert(io.total_write == 0);
02920         assert(io.total_size == 0);
02921         assert(io.total_size_known == 0);
02922         assert(io.timeout == 250000);
02923 
02924         assert(parse_args(out, argc, argv) == 0);
02925 
02926 #ifdef PRINT_DEBUG
02927         print();
02928 #endif
02929         assert(d.start_time == 0);
02930         assert(d.total_time == 0);
02931         assert(d.current_time == 0);
02932         assert(d.elapsed_time == 0);
02933         assert(d.percent_complete == 0);
02934         assert(d.display_interval == 1);
02935         assert(d.overtime_flag == 0);
02936         assert(d.k == 1024);
02937         assert(d.twiddle == '-');
02938         assert(d.manual_width == 0);
02939         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
02940         assert(d.display_datacount == 1);
02941         assert(d.display_throughput == 1);
02942         assert(d.display_time == 1);
02943         assert(d.display_percent == 1);
02944         assert(d.display_bar == 1);
02945         assert(d.display_summary == 1);
02946         assert(d.display_ansi == 0);
02947         assert(d.twiddle_fg_color == 0);
02948         assert(d.twiddle_bg_color == 0);
02949         assert(d.twiddle_fg_bold == 0);
02950         assert(d.datacount_fg_color == 0);
02951         assert(d.datacount_bg_color == 0);
02952         assert(d.datacount_fg_bold == 0);
02953         assert(d.throughput_label_fg_color == 0);
02954         assert(d.throughput_label_bg_color == 0);
02955         assert(d.throughput_label_fg_bold == 0);
02956         assert(d.throughput_fg_color == 0);
02957         assert(d.throughput_bg_color == 0);
02958         assert(d.throughput_fg_bold == 0);
02959         assert(d.time_label_fg_color == 0);
02960         assert(d.time_label_bg_color == 0);
02961         assert(d.time_label_fg_bold == 0);
02962         assert(d.percent_fg_color == 0);
02963         assert(d.percent_bg_color == 0);
02964         assert(d.percent_fg_bold == 0);
02965         assert(d.barbrace_fg_color == 0);
02966         assert(d.barbrace_bg_color == 0);
02967         assert(d.barbrace_fg_bold == 0);
02968         assert(d.bar_fg_color == 0);
02969         assert(d.bar_bg_color == 0);
02970         assert(d.bar_fg_bold == 0);
02971         assert(io.in == 0);
02972         assert(io.out == 1);
02973         assert(io.in_ready == 0);
02974         assert(io.out_ready == 0);
02975         assert(io.eof_in == 0);
02976         assert(io.eof_out == 0);
02977         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
02978         /* assert(io.cbuf == 0x0); */
02979         assert(io.last_read == 0);
02980         assert(io.last_write == 0);
02981         assert(io.total_read == 0);
02982         assert(io.total_write == 0);
02983         assert(io.total_size == 0);
02984         assert(io.total_size_known == 0);
02985         assert(io.timeout == 250000);
02986 }
02987 
02988 void test23(FILE* out)
02989 {
02990         int argc = 0;
02991         char *argv[256] = { 0 };
02992 
02993         argv[argc++] = "ProgramName";
02994         argv[argc++] = "-t";
02995         argv[argc++] = "1024.38002m";
02996 
02997         displayInit();
02998         ioInit();
02999 
03000 #ifdef PRINT_DEBUG
03001         print();
03002 #endif
03003         assert(d.start_time == 0);
03004         assert(d.total_time == 0);
03005         assert(d.current_time == 0);
03006         assert(d.elapsed_time == 0);
03007         assert(d.percent_complete == 0);
03008         assert(d.display_interval == 1);
03009         assert(d.overtime_flag == 0);
03010         assert(d.k == 1024);
03011         assert(d.twiddle == '-');
03012         assert(d.manual_width == 0);
03013         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03014         assert(d.display_datacount == 1);
03015         assert(d.display_throughput == 1);
03016         assert(d.display_time == 1);
03017         assert(d.display_percent == 1);
03018         assert(d.display_bar == 1);
03019         assert(d.display_summary == 1);
03020         assert(d.display_ansi == 0);
03021         assert(d.twiddle_fg_color == 0);
03022         assert(d.twiddle_bg_color == 0);
03023         assert(d.twiddle_fg_bold == 0);
03024         assert(d.datacount_fg_color == 0);
03025         assert(d.datacount_bg_color == 0);
03026         assert(d.datacount_fg_bold == 0);
03027         assert(d.throughput_label_fg_color == 0);
03028         assert(d.throughput_label_bg_color == 0);
03029         assert(d.throughput_label_fg_bold == 0);
03030         assert(d.throughput_fg_color == 0);
03031         assert(d.throughput_bg_color == 0);
03032         assert(d.throughput_fg_bold == 0);
03033         assert(d.time_label_fg_color == 0);
03034         assert(d.time_label_bg_color == 0);
03035         assert(d.time_label_fg_bold == 0);
03036         assert(d.percent_fg_color == 0);
03037         assert(d.percent_bg_color == 0);
03038         assert(d.percent_fg_bold == 0);
03039         assert(d.barbrace_fg_color == 0);
03040         assert(d.barbrace_bg_color == 0);
03041         assert(d.barbrace_fg_bold == 0);
03042         assert(d.bar_fg_color == 0);
03043         assert(d.bar_bg_color == 0);
03044         assert(d.bar_fg_bold == 0);
03045         assert(io.in == 0);
03046         assert(io.out == 1);
03047         assert(io.in_ready == 0);
03048         assert(io.out_ready == 0);
03049         assert(io.eof_in == 0);
03050         assert(io.eof_out == 0);
03051         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03052         /* assert(io.cbuf == 0x0); */
03053         assert(io.last_read == 0);
03054         assert(io.last_write == 0);
03055         assert(io.total_read == 0);
03056         assert(io.total_write == 0);
03057         assert(io.total_size == 0);
03058         assert(io.total_size_known == 0);
03059         assert(io.timeout == 250000);
03060 
03061         assert(parse_args(out, argc, argv) == 0);
03062 
03063 #ifdef PRINT_DEBUG
03064         print();
03065 #endif
03066         assert(d.start_time == 0);
03067         assert(d.total_time == 0);
03068         assert(d.current_time == 0);
03069         assert(d.elapsed_time == 0);
03070         assert(d.percent_complete == 0);
03071         assert(d.display_interval == 1);
03072         assert(d.overtime_flag == 0);
03073         assert(d.k == 1024);
03074         assert(d.twiddle == '-');
03075         assert(d.manual_width == 0);
03076         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03077         assert(d.display_datacount == 1);
03078         assert(d.display_throughput == 1);
03079         assert(d.display_time == 1);
03080         assert(d.display_percent == 1);
03081         assert(d.display_bar == 1);
03082         assert(d.display_summary == 1);
03083         assert(d.display_ansi == 0);
03084         assert(d.twiddle_fg_color == 0);
03085         assert(d.twiddle_bg_color == 0);
03086         assert(d.twiddle_fg_bold == 0);
03087         assert(d.datacount_fg_color == 0);
03088         assert(d.datacount_bg_color == 0);
03089         assert(d.datacount_fg_bold == 0);
03090         assert(d.throughput_label_fg_color == 0);
03091         assert(d.throughput_label_bg_color == 0);
03092         assert(d.throughput_label_fg_bold == 0);
03093         assert(d.throughput_fg_color == 0);
03094         assert(d.throughput_bg_color == 0);
03095         assert(d.throughput_fg_bold == 0);
03096         assert(d.time_label_fg_color == 0);
03097         assert(d.time_label_bg_color == 0);
03098         assert(d.time_label_fg_bold == 0);
03099         assert(d.percent_fg_color == 0);
03100         assert(d.percent_bg_color == 0);
03101         assert(d.percent_fg_bold == 0);
03102         assert(d.barbrace_fg_color == 0);
03103         assert(d.barbrace_bg_color == 0);
03104         assert(d.barbrace_fg_bold == 0);
03105         assert(d.bar_fg_color == 0);
03106         assert(d.bar_bg_color == 0);
03107         assert(d.bar_fg_bold == 0);
03108         assert(io.in == 0);
03109         assert(io.out == 1);
03110         assert(io.in_ready == 0);
03111         assert(io.out_ready == 0);
03112         assert(io.eof_in == 0);
03113         assert(io.eof_out == 0);
03114         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03115         /* assert(io.cbuf == 0x0); */
03116         assert(io.last_read == 0);
03117         assert(io.last_write == 0);
03118         assert(io.total_read == 0);
03119         assert(io.total_write == 0);
03120         assert(io.total_size == 0);
03121         assert(io.total_size_known == 0);
03122         assert(io.timeout == 250000);
03123 }
03124 
03125 void test24(FILE* out)
03126 {
03127         int argc = 0;
03128         char *argv[256] = { 0 };
03129 
03130         argv[argc++] = "ProgramName";
03131         argv[argc++] = "-t";
03132         argv[argc++] = "1024.38002";
03133 
03134         displayInit();
03135         ioInit();
03136 
03137 #ifdef PRINT_DEBUG
03138         print();
03139 #endif
03140         assert(d.start_time == 0);
03141         assert(d.total_time == 0);
03142         assert(d.current_time == 0);
03143         assert(d.elapsed_time == 0);
03144         assert(d.percent_complete == 0);
03145         assert(d.display_interval == 1);
03146         assert(d.overtime_flag == 0);
03147         assert(d.k == 1024);
03148         assert(d.twiddle == '-');
03149         assert(d.manual_width == 0);
03150         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03151         assert(d.display_datacount == 1);
03152         assert(d.display_throughput == 1);
03153         assert(d.display_time == 1);
03154         assert(d.display_percent == 1);
03155         assert(d.display_bar == 1);
03156         assert(d.display_summary == 1);
03157         assert(d.display_ansi == 0);
03158         assert(d.twiddle_fg_color == 0);
03159         assert(d.twiddle_bg_color == 0);
03160         assert(d.twiddle_fg_bold == 0);
03161         assert(d.datacount_fg_color == 0);
03162         assert(d.datacount_bg_color == 0);
03163         assert(d.datacount_fg_bold == 0);
03164         assert(d.throughput_label_fg_color == 0);
03165         assert(d.throughput_label_bg_color == 0);
03166         assert(d.throughput_label_fg_bold == 0);
03167         assert(d.throughput_fg_color == 0);
03168         assert(d.throughput_bg_color == 0);
03169         assert(d.throughput_fg_bold == 0);
03170         assert(d.time_label_fg_color == 0);
03171         assert(d.time_label_bg_color == 0);
03172         assert(d.time_label_fg_bold == 0);
03173         assert(d.percent_fg_color == 0);
03174         assert(d.percent_bg_color == 0);
03175         assert(d.percent_fg_bold == 0);
03176         assert(d.barbrace_fg_color == 0);
03177         assert(d.barbrace_bg_color == 0);
03178         assert(d.barbrace_fg_bold == 0);
03179         assert(d.bar_fg_color == 0);
03180         assert(d.bar_bg_color == 0);
03181         assert(d.bar_fg_bold == 0);
03182         assert(io.in == 0);
03183         assert(io.out == 1);
03184         assert(io.in_ready == 0);
03185         assert(io.out_ready == 0);
03186         assert(io.eof_in == 0);
03187         assert(io.eof_out == 0);
03188         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03189         /* assert(io.cbuf == 0x0); */
03190         assert(io.last_read == 0);
03191         assert(io.last_write == 0);
03192         assert(io.total_read == 0);
03193         assert(io.total_write == 0);
03194         assert(io.total_size == 0);
03195         assert(io.total_size_known == 0);
03196         assert(io.timeout == 250000);
03197 
03198         assert(parse_args(out, argc, argv) == 0);
03199 
03200 #ifdef PRINT_DEBUG
03201         print();
03202 #endif
03203         assert(d.start_time == 0);
03204         assert(d.total_time == 0);
03205         assert(d.current_time == 0);
03206         assert(d.elapsed_time == 0);
03207         assert(d.percent_complete == 0);
03208         assert(d.display_interval == 1);
03209         assert(d.overtime_flag == 0);
03210         assert(d.k == 1024);
03211         assert(d.twiddle == '-');
03212         assert(d.manual_width == 0);
03213         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03214         assert(d.display_datacount == 1);
03215         assert(d.display_throughput == 1);
03216         assert(d.display_time == 1);
03217         assert(d.display_percent == 1);
03218         assert(d.display_bar == 1);
03219         assert(d.display_summary == 1);
03220         assert(d.display_ansi == 0);
03221         assert(d.twiddle_fg_color == 0);
03222         assert(d.twiddle_bg_color == 0);
03223         assert(d.twiddle_fg_bold == 0);
03224         assert(d.datacount_fg_color == 0);
03225         assert(d.datacount_bg_color == 0);
03226         assert(d.datacount_fg_bold == 0);
03227         assert(d.throughput_label_fg_color == 0);
03228         assert(d.throughput_label_bg_color == 0);
03229         assert(d.throughput_label_fg_bold == 0);
03230         assert(d.throughput_fg_color == 0);
03231         assert(d.throughput_bg_color == 0);
03232         assert(d.throughput_fg_bold == 0);
03233         assert(d.time_label_fg_color == 0);
03234         assert(d.time_label_bg_color == 0);
03235         assert(d.time_label_fg_bold == 0);
03236         assert(d.percent_fg_color == 0);
03237         assert(d.percent_bg_color == 0);
03238         assert(d.percent_fg_bold == 0);
03239         assert(d.barbrace_fg_color == 0);
03240         assert(d.barbrace_bg_color == 0);
03241         assert(d.barbrace_fg_bold == 0);
03242         assert(d.bar_fg_color == 0);
03243         assert(d.bar_bg_color == 0);
03244         assert(d.bar_fg_bold == 0);
03245         assert(io.in == 0);
03246         assert(io.out == 1);
03247         assert(io.in_ready == 0);
03248         assert(io.out_ready == 0);
03249         assert(io.eof_in == 0);
03250         assert(io.eof_out == 0);
03251         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03252         /* assert(io.cbuf == 0x0); */
03253         assert(io.last_read == 0);
03254         assert(io.last_write == 0);
03255         assert(io.total_read == 0);
03256         assert(io.total_write == 0);
03257         assert(io.total_size == 0);
03258         assert(io.total_size_known == 0);
03259         assert(io.timeout == 250000);
03260 }
03261 
03262 void test25(FILE* out)
03263 {
03264         int argc = 0;
03265         char *argv[256] = { 0 };
03266 
03267         argv[argc++] = "ProgramName";
03268         argv[argc++] = "-t";
03269         argv[argc++] = "30";
03270 
03271         displayInit();
03272         ioInit();
03273 
03274 #ifdef PRINT_DEBUG
03275         print();
03276 #endif
03277         assert(d.start_time == 0);
03278         assert(d.total_time == 0);
03279         assert(d.current_time == 0);
03280         assert(d.elapsed_time == 0);
03281         assert(d.percent_complete == 0);
03282         assert(d.display_interval == 1);
03283         assert(d.overtime_flag == 0);
03284         assert(d.k == 1024);
03285         assert(d.twiddle == '-');
03286         assert(d.manual_width == 0);
03287         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03288         assert(d.display_datacount == 1);
03289         assert(d.display_throughput == 1);
03290         assert(d.display_time == 1);
03291         assert(d.display_percent == 1);
03292         assert(d.display_bar == 1);
03293         assert(d.display_summary == 1);
03294         assert(d.display_ansi == 0);
03295         assert(d.twiddle_fg_color == 0);
03296         assert(d.twiddle_bg_color == 0);
03297         assert(d.twiddle_fg_bold == 0);
03298         assert(d.datacount_fg_color == 0);
03299         assert(d.datacount_bg_color == 0);
03300         assert(d.datacount_fg_bold == 0);
03301         assert(d.throughput_label_fg_color == 0);
03302         assert(d.throughput_label_bg_color == 0);
03303         assert(d.throughput_label_fg_bold == 0);
03304         assert(d.throughput_fg_color == 0);
03305         assert(d.throughput_bg_color == 0);
03306         assert(d.throughput_fg_bold == 0);
03307         assert(d.time_label_fg_color == 0);
03308         assert(d.time_label_bg_color == 0);
03309         assert(d.time_label_fg_bold == 0);
03310         assert(d.percent_fg_color == 0);
03311         assert(d.percent_bg_color == 0);
03312         assert(d.percent_fg_bold == 0);
03313         assert(d.barbrace_fg_color == 0);
03314         assert(d.barbrace_bg_color == 0);
03315         assert(d.barbrace_fg_bold == 0);
03316         assert(d.bar_fg_color == 0);
03317         assert(d.bar_bg_color == 0);
03318         assert(d.bar_fg_bold == 0);
03319         assert(io.in == 0);
03320         assert(io.out == 1);
03321         assert(io.in_ready == 0);
03322         assert(io.out_ready == 0);
03323         assert(io.eof_in == 0);
03324         assert(io.eof_out == 0);
03325         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03326         /* assert(io.cbuf == 0x0); */
03327         assert(io.last_read == 0);
03328         assert(io.last_write == 0);
03329         assert(io.total_read == 0);
03330         assert(io.total_write == 0);
03331         assert(io.total_size == 0);
03332         assert(io.total_size_known == 0);
03333         assert(io.timeout == 250000);
03334 
03335         assert(parse_args(out, argc, argv) == 0);
03336 
03337 #ifdef PRINT_DEBUG
03338         print();
03339 #endif
03340         assert(d.start_time == 0);
03341         assert(d.total_time == 0);
03342         assert(d.current_time == 0);
03343         assert(d.elapsed_time == 0);
03344         assert(d.percent_complete == 0);
03345         assert(d.display_interval == 1);
03346         assert(d.overtime_flag == 0);
03347         assert(d.k == 1024);
03348         assert(d.twiddle == '-');
03349         assert(d.manual_width == 0);
03350         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03351         assert(d.display_datacount == 1);
03352         assert(d.display_throughput == 1);
03353         assert(d.display_time == 1);
03354         assert(d.display_percent == 1);
03355         assert(d.display_bar == 1);
03356         assert(d.display_summary == 1);
03357         assert(d.display_ansi == 0);
03358         assert(d.twiddle_fg_color == 0);
03359         assert(d.twiddle_bg_color == 0);
03360         assert(d.twiddle_fg_bold == 0);
03361         assert(d.datacount_fg_color == 0);
03362         assert(d.datacount_bg_color == 0);
03363         assert(d.datacount_fg_bold == 0);
03364         assert(d.throughput_label_fg_color == 0);
03365         assert(d.throughput_label_bg_color == 0);
03366         assert(d.throughput_label_fg_bold == 0);
03367         assert(d.throughput_fg_color == 0);
03368         assert(d.throughput_bg_color == 0);
03369         assert(d.throughput_fg_bold == 0);
03370         assert(d.time_label_fg_color == 0);
03371         assert(d.time_label_bg_color == 0);
03372         assert(d.time_label_fg_bold == 0);
03373         assert(d.percent_fg_color == 0);
03374         assert(d.percent_bg_color == 0);
03375         assert(d.percent_fg_bold == 0);
03376         assert(d.barbrace_fg_color == 0);
03377         assert(d.barbrace_bg_color == 0);
03378         assert(d.barbrace_fg_bold == 0);
03379         assert(d.bar_fg_color == 0);
03380         assert(d.bar_bg_color == 0);
03381         assert(d.bar_fg_bold == 0);
03382         assert(io.in == 0);
03383         assert(io.out == 1);
03384         assert(io.in_ready == 0);
03385         assert(io.out_ready == 0);
03386         assert(io.eof_in == 0);
03387         assert(io.eof_out == 0);
03388         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03389         /* assert(io.cbuf == 0x0); */
03390         assert(io.last_read == 0);
03391         assert(io.last_write == 0);
03392         assert(io.total_read == 0);
03393         assert(io.total_write == 0);
03394         assert(io.total_size == 0);
03395         assert(io.total_size_known == 0);
03396         assert(io.timeout == 30);
03397 }
03398 
03399 void test26(FILE* out)
03400 {
03401         int argc = 0;
03402         char *argv[256] = { 0 };
03403 
03404         argv[argc++] = "ProgramName";
03405         argv[argc++] = "-k";
03406 
03407         displayInit();
03408         ioInit();
03409 
03410 #ifdef PRINT_DEBUG
03411         print();
03412 #endif
03413         assert(d.start_time == 0);
03414         assert(d.total_time == 0);
03415         assert(d.current_time == 0);
03416         assert(d.elapsed_time == 0);
03417         assert(d.percent_complete == 0);
03418         assert(d.display_interval == 1);
03419         assert(d.overtime_flag == 0);
03420         assert(d.k == 1024);
03421         assert(d.twiddle == '-');
03422         assert(d.manual_width == 0);
03423         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03424         assert(d.display_datacount == 1);
03425         assert(d.display_throughput == 1);
03426         assert(d.display_time == 1);
03427         assert(d.display_percent == 1);
03428         assert(d.display_bar == 1);
03429         assert(d.display_summary == 1);
03430         assert(d.display_ansi == 0);
03431         assert(d.twiddle_fg_color == 0);
03432         assert(d.twiddle_bg_color == 0);
03433         assert(d.twiddle_fg_bold == 0);
03434         assert(d.datacount_fg_color == 0);
03435         assert(d.datacount_bg_color == 0);
03436         assert(d.datacount_fg_bold == 0);
03437         assert(d.throughput_label_fg_color == 0);
03438         assert(d.throughput_label_bg_color == 0);
03439         assert(d.throughput_label_fg_bold == 0);
03440         assert(d.throughput_fg_color == 0);
03441         assert(d.throughput_bg_color == 0);
03442         assert(d.throughput_fg_bold == 0);
03443         assert(d.time_label_fg_color == 0);
03444         assert(d.time_label_bg_color == 0);
03445         assert(d.time_label_fg_bold == 0);
03446         assert(d.percent_fg_color == 0);
03447         assert(d.percent_bg_color == 0);
03448         assert(d.percent_fg_bold == 0);
03449         assert(d.barbrace_fg_color == 0);
03450         assert(d.barbrace_bg_color == 0);
03451         assert(d.barbrace_fg_bold == 0);
03452         assert(d.bar_fg_color == 0);
03453         assert(d.bar_bg_color == 0);
03454         assert(d.bar_fg_bold == 0);
03455         assert(io.in == 0);
03456         assert(io.out == 1);
03457         assert(io.in_ready == 0);
03458         assert(io.out_ready == 0);
03459         assert(io.eof_in == 0);
03460         assert(io.eof_out == 0);
03461         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03462         /* assert(io.cbuf == 0x0); */
03463         assert(io.last_read == 0);
03464         assert(io.last_write == 0);
03465         assert(io.total_read == 0);
03466         assert(io.total_write == 0);
03467         assert(io.total_size == 0);
03468         assert(io.total_size_known == 0);
03469         assert(io.timeout == 250000);
03470 
03471         assert(parse_args(out, argc, argv) == 1);
03472 
03473 #ifdef PRINT_DEBUG
03474         print();
03475 #endif
03476         assert(d.start_time == 0);
03477         assert(d.total_time == 0);
03478         assert(d.current_time == 0);
03479         assert(d.elapsed_time == 0);
03480         assert(d.percent_complete == 0);
03481         assert(d.display_interval == 1);
03482         assert(d.overtime_flag == 0);
03483         assert(d.k == 1024);
03484         assert(d.twiddle == '-');
03485         assert(d.manual_width == 0);
03486         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03487         assert(d.display_datacount == 1);
03488         assert(d.display_throughput == 1);
03489         assert(d.display_time == 1);
03490         assert(d.display_percent == 1);
03491         assert(d.display_bar == 1);
03492         assert(d.display_summary == 1);
03493         assert(d.display_ansi == 0);
03494         assert(d.twiddle_fg_color == 0);
03495         assert(d.twiddle_bg_color == 0);
03496         assert(d.twiddle_fg_bold == 0);
03497         assert(d.datacount_fg_color == 0);
03498         assert(d.datacount_bg_color == 0);
03499         assert(d.datacount_fg_bold == 0);
03500         assert(d.throughput_label_fg_color == 0);
03501         assert(d.throughput_label_bg_color == 0);
03502         assert(d.throughput_label_fg_bold == 0);
03503         assert(d.throughput_fg_color == 0);
03504         assert(d.throughput_bg_color == 0);
03505         assert(d.throughput_fg_bold == 0);
03506         assert(d.time_label_fg_color == 0);
03507         assert(d.time_label_bg_color == 0);
03508         assert(d.time_label_fg_bold == 0);
03509         assert(d.percent_fg_color == 0);
03510         assert(d.percent_bg_color == 0);
03511         assert(d.percent_fg_bold == 0);
03512         assert(d.barbrace_fg_color == 0);
03513         assert(d.barbrace_bg_color == 0);
03514         assert(d.barbrace_fg_bold == 0);
03515         assert(d.bar_fg_color == 0);
03516         assert(d.bar_bg_color == 0);
03517         assert(d.bar_fg_bold == 0);
03518         assert(io.in == 0);
03519         assert(io.out == 1);
03520         assert(io.in_ready == 0);
03521         assert(io.out_ready == 0);
03522         assert(io.eof_in == 0);
03523         assert(io.eof_out == 0);
03524         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03525         /* assert(io.cbuf == 0x0); */
03526         assert(io.last_read == 0);
03527         assert(io.last_write == 0);
03528         assert(io.total_read == 0);
03529         assert(io.total_write == 0);
03530         assert(io.total_size == 0);
03531         assert(io.total_size_known == 0);
03532         assert(io.timeout == 250000);
03533 }
03534 
03535 void test27(FILE* out)
03536 {
03537         int argc = 0;
03538         char *argv[256] = { 0 };
03539 
03540         argv[argc++] = "ProgramName";
03541         argv[argc++] = "-k";
03542         argv[argc++] = "10";
03543 
03544         displayInit();
03545         ioInit();
03546 
03547 #ifdef PRINT_DEBUG
03548         print();
03549 #endif
03550         assert(d.start_time == 0);
03551         assert(d.total_time == 0);
03552         assert(d.current_time == 0);
03553         assert(d.elapsed_time == 0);
03554         assert(d.percent_complete == 0);
03555         assert(d.display_interval == 1);
03556         assert(d.overtime_flag == 0);
03557         assert(d.k == 1024);
03558         assert(d.twiddle == '-');
03559         assert(d.manual_width == 0);
03560         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03561         assert(d.display_datacount == 1);
03562         assert(d.display_throughput == 1);
03563         assert(d.display_time == 1);
03564         assert(d.display_percent == 1);
03565         assert(d.display_bar == 1);
03566         assert(d.display_summary == 1);
03567         assert(d.display_ansi == 0);
03568         assert(d.twiddle_fg_color == 0);
03569         assert(d.twiddle_bg_color == 0);
03570         assert(d.twiddle_fg_bold == 0);
03571         assert(d.datacount_fg_color == 0);
03572         assert(d.datacount_bg_color == 0);
03573         assert(d.datacount_fg_bold == 0);
03574         assert(d.throughput_label_fg_color == 0);
03575         assert(d.throughput_label_bg_color == 0);
03576         assert(d.throughput_label_fg_bold == 0);
03577         assert(d.throughput_fg_color == 0);
03578         assert(d.throughput_bg_color == 0);
03579         assert(d.throughput_fg_bold == 0);
03580         assert(d.time_label_fg_color == 0);
03581         assert(d.time_label_bg_color == 0);
03582         assert(d.time_label_fg_bold == 0);
03583         assert(d.percent_fg_color == 0);
03584         assert(d.percent_bg_color == 0);
03585         assert(d.percent_fg_bold == 0);
03586         assert(d.barbrace_fg_color == 0);
03587         assert(d.barbrace_bg_color == 0);
03588         assert(d.barbrace_fg_bold == 0);
03589         assert(d.bar_fg_color == 0);
03590         assert(d.bar_bg_color == 0);
03591         assert(d.bar_fg_bold == 0);
03592         assert(io.in == 0);
03593         assert(io.out == 1);
03594         assert(io.in_ready == 0);
03595         assert(io.out_ready == 0);
03596         assert(io.eof_in == 0);
03597         assert(io.eof_out == 0);
03598         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03599         /* assert(io.cbuf == 0x0); */
03600         assert(io.last_read == 0);
03601         assert(io.last_write == 0);
03602         assert(io.total_read == 0);
03603         assert(io.total_write == 0);
03604         assert(io.total_size == 0);
03605         assert(io.total_size_known == 0);
03606         assert(io.timeout == 250000);
03607 
03608         assert(parse_args(out, argc, argv) == 1);
03609 
03610 #ifdef PRINT_DEBUG
03611         print();
03612 #endif
03613         assert(d.start_time == 0);
03614         assert(d.total_time == 0);
03615         assert(d.current_time == 0);
03616         assert(d.elapsed_time == 0);
03617         assert(d.percent_complete == 0);
03618         assert(d.display_interval == 1);
03619         assert(d.overtime_flag == 0);
03620         assert(d.k == 1024);
03621         assert(d.twiddle == '-');
03622         assert(d.manual_width == 0);
03623         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03624         assert(d.display_datacount == 1);
03625         assert(d.display_throughput == 1);
03626         assert(d.display_time == 1);
03627         assert(d.display_percent == 1);
03628         assert(d.display_bar == 1);
03629         assert(d.display_summary == 1);
03630         assert(d.display_ansi == 0);
03631         assert(d.twiddle_fg_color == 0);
03632         assert(d.twiddle_bg_color == 0);
03633         assert(d.twiddle_fg_bold == 0);
03634         assert(d.datacount_fg_color == 0);
03635         assert(d.datacount_bg_color == 0);
03636         assert(d.datacount_fg_bold == 0);
03637         assert(d.throughput_label_fg_color == 0);
03638         assert(d.throughput_label_bg_color == 0);
03639         assert(d.throughput_label_fg_bold == 0);
03640         assert(d.throughput_fg_color == 0);
03641         assert(d.throughput_bg_color == 0);
03642         assert(d.throughput_fg_bold == 0);
03643         assert(d.time_label_fg_color == 0);
03644         assert(d.time_label_bg_color == 0);
03645         assert(d.time_label_fg_bold == 0);
03646         assert(d.percent_fg_color == 0);
03647         assert(d.percent_bg_color == 0);
03648         assert(d.percent_fg_bold == 0);
03649         assert(d.barbrace_fg_color == 0);
03650         assert(d.barbrace_bg_color == 0);
03651         assert(d.barbrace_fg_bold == 0);
03652         assert(d.bar_fg_color == 0);
03653         assert(d.bar_bg_color == 0);
03654         assert(d.bar_fg_bold == 0);
03655         assert(io.in == 0);
03656         assert(io.out == 1);
03657         assert(io.in_ready == 0);
03658         assert(io.out_ready == 0);
03659         assert(io.eof_in == 0);
03660         assert(io.eof_out == 0);
03661         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03662         /* assert(io.cbuf == 0x0); */
03663         assert(io.last_read == 0);
03664         assert(io.last_write == 0);
03665         assert(io.total_read == 0);
03666         assert(io.total_write == 0);
03667         assert(io.total_size == 0);
03668         assert(io.total_size_known == 0);
03669         assert(io.timeout == 250000);
03670 }
03671 
03672 void test28(FILE* out)
03673 {
03674         int argc = 0;
03675         char *argv[256] = { 0 };
03676 
03677         argv[argc++] = "ProgramName";
03678         argv[argc++] = "-k";
03679         argv[argc++] = "1000";
03680 
03681         displayInit();
03682         ioInit();
03683 
03684 #ifdef PRINT_DEBUG
03685         print();
03686 #endif
03687         assert(d.start_time == 0);
03688         assert(d.total_time == 0);
03689         assert(d.current_time == 0);
03690         assert(d.elapsed_time == 0);
03691         assert(d.percent_complete == 0);
03692         assert(d.display_interval == 1);
03693         assert(d.overtime_flag == 0);
03694         assert(d.k == 1024);
03695         assert(d.twiddle == '-');
03696         assert(d.manual_width == 0);
03697         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03698         assert(d.display_datacount == 1);
03699         assert(d.display_throughput == 1);
03700         assert(d.display_time == 1);
03701         assert(d.display_percent == 1);
03702         assert(d.display_bar == 1);
03703         assert(d.display_summary == 1);
03704         assert(d.display_ansi == 0);
03705         assert(d.twiddle_fg_color == 0);
03706         assert(d.twiddle_bg_color == 0);
03707         assert(d.twiddle_fg_bold == 0);
03708         assert(d.datacount_fg_color == 0);
03709         assert(d.datacount_bg_color == 0);
03710         assert(d.datacount_fg_bold == 0);
03711         assert(d.throughput_label_fg_color == 0);
03712         assert(d.throughput_label_bg_color == 0);
03713         assert(d.throughput_label_fg_bold == 0);
03714         assert(d.throughput_fg_color == 0);
03715         assert(d.throughput_bg_color == 0);
03716         assert(d.throughput_fg_bold == 0);
03717         assert(d.time_label_fg_color == 0);
03718         assert(d.time_label_bg_color == 0);
03719         assert(d.time_label_fg_bold == 0);
03720         assert(d.percent_fg_color == 0);
03721         assert(d.percent_bg_color == 0);
03722         assert(d.percent_fg_bold == 0);
03723         assert(d.barbrace_fg_color == 0);
03724         assert(d.barbrace_bg_color == 0);
03725         assert(d.barbrace_fg_bold == 0);
03726         assert(d.bar_fg_color == 0);
03727         assert(d.bar_bg_color == 0);
03728         assert(d.bar_fg_bold == 0);
03729         assert(io.in == 0);
03730         assert(io.out == 1);
03731         assert(io.in_ready == 0);
03732         assert(io.out_ready == 0);
03733         assert(io.eof_in == 0);
03734         assert(io.eof_out == 0);
03735         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03736         /* assert(io.cbuf == 0x0); */
03737         assert(io.last_read == 0);
03738         assert(io.last_write == 0);
03739         assert(io.total_read == 0);
03740         assert(io.total_write == 0);
03741         assert(io.total_size == 0);
03742         assert(io.total_size_known == 0);
03743         assert(io.timeout == 250000);
03744 
03745         assert(parse_args(out, argc, argv) == 0);
03746 
03747 #ifdef PRINT_DEBUG
03748         print();
03749 #endif
03750         assert(d.start_time == 0);
03751         assert(d.total_time == 0);
03752         assert(d.current_time == 0);
03753         assert(d.elapsed_time == 0);
03754         assert(d.percent_complete == 0);
03755         assert(d.display_interval == 1);
03756         assert(d.overtime_flag == 0);
03757         assert(d.k == 1000);
03758         assert(d.twiddle == '-');
03759         assert(d.manual_width == 0);
03760         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03761         assert(d.display_datacount == 1);
03762         assert(d.display_throughput == 1);
03763         assert(d.display_time == 1);
03764         assert(d.display_percent == 1);
03765         assert(d.display_bar == 1);
03766         assert(d.display_summary == 1);
03767         assert(d.display_ansi == 0);
03768         assert(d.twiddle_fg_color == 0);
03769         assert(d.twiddle_bg_color == 0);
03770         assert(d.twiddle_fg_bold == 0);
03771         assert(d.datacount_fg_color == 0);
03772         assert(d.datacount_bg_color == 0);
03773         assert(d.datacount_fg_bold == 0);
03774         assert(d.throughput_label_fg_color == 0);
03775         assert(d.throughput_label_bg_color == 0);
03776         assert(d.throughput_label_fg_bold == 0);
03777         assert(d.throughput_fg_color == 0);
03778         assert(d.throughput_bg_color == 0);
03779         assert(d.throughput_fg_bold == 0);
03780         assert(d.time_label_fg_color == 0);
03781         assert(d.time_label_bg_color == 0);
03782         assert(d.time_label_fg_bold == 0);
03783         assert(d.percent_fg_color == 0);
03784         assert(d.percent_bg_color == 0);
03785         assert(d.percent_fg_bold == 0);
03786         assert(d.barbrace_fg_color == 0);
03787         assert(d.barbrace_bg_color == 0);
03788         assert(d.barbrace_fg_bold == 0);
03789         assert(d.bar_fg_color == 0);
03790         assert(d.bar_bg_color == 0);
03791         assert(d.bar_fg_bold == 0);
03792         assert(io.in == 0);
03793         assert(io.out == 1);
03794         assert(io.in_ready == 0);
03795         assert(io.out_ready == 0);
03796         assert(io.eof_in == 0);
03797         assert(io.eof_out == 0);
03798         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03799         /* assert(io.cbuf == 0x0); */
03800         assert(io.last_read == 0);
03801         assert(io.last_write == 0);
03802         assert(io.total_read == 0);
03803         assert(io.total_write == 0);
03804         assert(io.total_size == 0);
03805         assert(io.total_size_known == 0);
03806         assert(io.timeout == 250000);
03807 }
03808 
03809 void test29(FILE* out)
03810 {
03811         int argc = 0;
03812         char *argv[256] = { 0 };
03813 
03814         argv[argc++] = "ProgramName";
03815         argv[argc++] = "-k";
03816         argv[argc++] = "1024";
03817 
03818         displayInit();
03819         ioInit();
03820 
03821 #ifdef PRINT_DEBUG
03822         print();
03823 #endif
03824         assert(d.start_time == 0);
03825         assert(d.total_time == 0);
03826         assert(d.current_time == 0);
03827         assert(d.elapsed_time == 0);
03828         assert(d.percent_complete == 0);
03829         assert(d.display_interval == 1);
03830         assert(d.overtime_flag == 0);
03831         assert(d.k == 1024);
03832         assert(d.twiddle == '-');
03833         assert(d.manual_width == 0);
03834         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03835         assert(d.display_datacount == 1);
03836         assert(d.display_throughput == 1);
03837         assert(d.display_time == 1);
03838         assert(d.display_percent == 1);
03839         assert(d.display_bar == 1);
03840         assert(d.display_summary == 1);
03841         assert(d.display_ansi == 0);
03842         assert(d.twiddle_fg_color == 0);
03843         assert(d.twiddle_bg_color == 0);
03844         assert(d.twiddle_fg_bold == 0);
03845         assert(d.datacount_fg_color == 0);
03846         assert(d.datacount_bg_color == 0);
03847         assert(d.datacount_fg_bold == 0);
03848         assert(d.throughput_label_fg_color == 0);
03849         assert(d.throughput_label_bg_color == 0);
03850         assert(d.throughput_label_fg_bold == 0);
03851         assert(d.throughput_fg_color == 0);
03852         assert(d.throughput_bg_color == 0);
03853         assert(d.throughput_fg_bold == 0);
03854         assert(d.time_label_fg_color == 0);
03855         assert(d.time_label_bg_color == 0);
03856         assert(d.time_label_fg_bold == 0);
03857         assert(d.percent_fg_color == 0);
03858         assert(d.percent_bg_color == 0);
03859         assert(d.percent_fg_bold == 0);
03860         assert(d.barbrace_fg_color == 0);
03861         assert(d.barbrace_bg_color == 0);
03862         assert(d.barbrace_fg_bold == 0);
03863         assert(d.bar_fg_color == 0);
03864         assert(d.bar_bg_color == 0);
03865         assert(d.bar_fg_bold == 0);
03866         assert(io.in == 0);
03867         assert(io.out == 1);
03868         assert(io.in_ready == 0);
03869         assert(io.out_ready == 0);
03870         assert(io.eof_in == 0);
03871         assert(io.eof_out == 0);
03872         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03873         /* assert(io.cbuf == 0x0); */
03874         assert(io.last_read == 0);
03875         assert(io.last_write == 0);
03876         assert(io.total_read == 0);
03877         assert(io.total_write == 0);
03878         assert(io.total_size == 0);
03879         assert(io.total_size_known == 0);
03880         assert(io.timeout == 250000);
03881 
03882         d.k = 1000;
03883         assert(parse_args(out, argc, argv) == 0);
03884 
03885 #ifdef PRINT_DEBUG
03886         print();
03887 #endif
03888         assert(d.start_time == 0);
03889         assert(d.total_time == 0);
03890         assert(d.current_time == 0);
03891         assert(d.elapsed_time == 0);
03892         assert(d.percent_complete == 0);
03893         assert(d.display_interval == 1);
03894         assert(d.overtime_flag == 0);
03895         assert(d.k == 1024);
03896         assert(d.twiddle == '-');
03897         assert(d.manual_width == 0);
03898         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03899         assert(d.display_datacount == 1);
03900         assert(d.display_throughput == 1);
03901         assert(d.display_time == 1);
03902         assert(d.display_percent == 1);
03903         assert(d.display_bar == 1);
03904         assert(d.display_summary == 1);
03905         assert(d.display_ansi == 0);
03906         assert(d.twiddle_fg_color == 0);
03907         assert(d.twiddle_bg_color == 0);
03908         assert(d.twiddle_fg_bold == 0);
03909         assert(d.datacount_fg_color == 0);
03910         assert(d.datacount_bg_color == 0);
03911         assert(d.datacount_fg_bold == 0);
03912         assert(d.throughput_label_fg_color == 0);
03913         assert(d.throughput_label_bg_color == 0);
03914         assert(d.throughput_label_fg_bold == 0);
03915         assert(d.throughput_fg_color == 0);
03916         assert(d.throughput_bg_color == 0);
03917         assert(d.throughput_fg_bold == 0);
03918         assert(d.time_label_fg_color == 0);
03919         assert(d.time_label_bg_color == 0);
03920         assert(d.time_label_fg_bold == 0);
03921         assert(d.percent_fg_color == 0);
03922         assert(d.percent_bg_color == 0);
03923         assert(d.percent_fg_bold == 0);
03924         assert(d.barbrace_fg_color == 0);
03925         assert(d.barbrace_bg_color == 0);
03926         assert(d.barbrace_fg_bold == 0);
03927         assert(d.bar_fg_color == 0);
03928         assert(d.bar_bg_color == 0);
03929         assert(d.bar_fg_bold == 0);
03930         assert(io.in == 0);
03931         assert(io.out == 1);
03932         assert(io.in_ready == 0);
03933         assert(io.out_ready == 0);
03934         assert(io.eof_in == 0);
03935         assert(io.eof_out == 0);
03936         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
03937         /* assert(io.cbuf == 0x0); */
03938         assert(io.last_read == 0);
03939         assert(io.last_write == 0);
03940         assert(io.total_read == 0);
03941         assert(io.total_write == 0);
03942         assert(io.total_size == 0);
03943         assert(io.total_size_known == 0);
03944         assert(io.timeout == 250000);
03945 }
03946 
03947 void test30(FILE* out)
03948 {
03949         int argc = 0;
03950         char *argv[256] = { 0 };
03951 
03952         argv[argc++] = "ProgramName";
03953         argv[argc++] = "-sw";
03954 
03955         displayInit();
03956         ioInit();
03957 
03958 #ifdef PRINT_DEBUG
03959         print();
03960 #endif
03961         assert(d.start_time == 0);
03962         assert(d.total_time == 0);
03963         assert(d.current_time == 0);
03964         assert(d.elapsed_time == 0);
03965         assert(d.percent_complete == 0);
03966         assert(d.display_interval == 1);
03967         assert(d.overtime_flag == 0);
03968         assert(d.k == 1024);
03969         assert(d.twiddle == '-');
03970         assert(d.manual_width == 0);
03971         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
03972         assert(d.display_datacount == 1);
03973         assert(d.display_throughput == 1);
03974         assert(d.display_time == 1);
03975         assert(d.display_percent == 1);
03976         assert(d.display_bar == 1);
03977         assert(d.display_summary == 1);
03978         assert(d.display_ansi == 0);
03979         assert(d.twiddle_fg_color == 0);
03980         assert(d.twiddle_bg_color == 0);
03981         assert(d.twiddle_fg_bold == 0);
03982         assert(d.datacount_fg_color == 0);
03983         assert(d.datacount_bg_color == 0);
03984         assert(d.datacount_fg_bold == 0);
03985         assert(d.throughput_label_fg_color == 0);
03986         assert(d.throughput_label_bg_color == 0);
03987         assert(d.throughput_label_fg_bold == 0);
03988         assert(d.throughput_fg_color == 0);
03989         assert(d.throughput_bg_color == 0);
03990         assert(d.throughput_fg_bold == 0);
03991         assert(d.time_label_fg_color == 0);
03992         assert(d.time_label_bg_color == 0);
03993         assert(d.time_label_fg_bold == 0);
03994         assert(d.percent_fg_color == 0);
03995         assert(d.percent_bg_color == 0);
03996         assert(d.percent_fg_bold == 0);
03997         assert(d.barbrace_fg_color == 0);
03998         assert(d.barbrace_bg_color == 0);
03999         assert(d.barbrace_fg_bold == 0);
04000         assert(d.bar_fg_color == 0);
04001         assert(d.bar_bg_color == 0);
04002         assert(d.bar_fg_bold == 0);
04003         assert(io.in == 0);
04004         assert(io.out == 1);
04005         assert(io.in_ready == 0);
04006         assert(io.out_ready == 0);
04007         assert(io.eof_in == 0);
04008         assert(io.eof_out == 0);
04009         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04010         /* assert(io.cbuf == 0x0); */
04011         assert(io.last_read == 0);
04012         assert(io.last_write == 0);
04013         assert(io.total_read == 0);
04014         assert(io.total_write == 0);
04015         assert(io.total_size == 0);
04016         assert(io.total_size_known == 0);
04017         assert(io.timeout == 250000);
04018 
04019         assert(parse_args(out, argc, argv) == 1);
04020 
04021 #ifdef PRINT_DEBUG
04022         print();
04023 #endif
04024         assert(d.start_time == 0);
04025         assert(d.total_time == 0);
04026         assert(d.current_time == 0);
04027         assert(d.elapsed_time == 0);
04028         assert(d.percent_complete == 0);
04029         assert(d.display_interval == 1);
04030         assert(d.overtime_flag == 0);
04031         assert(d.k == 1024);
04032         assert(d.twiddle == '-');
04033         assert(d.manual_width == 0);
04034         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04035         assert(d.display_datacount == 1);
04036         assert(d.display_throughput == 1);
04037         assert(d.display_time == 1);
04038         assert(d.display_percent == 1);
04039         assert(d.display_bar == 1);
04040         assert(d.display_summary == 1);
04041         assert(d.display_ansi == 0);
04042         assert(d.twiddle_fg_color == 0);
04043         assert(d.twiddle_bg_color == 0);
04044         assert(d.twiddle_fg_bold == 0);
04045         assert(d.datacount_fg_color == 0);
04046         assert(d.datacount_bg_color == 0);
04047         assert(d.datacount_fg_bold == 0);
04048         assert(d.throughput_label_fg_color == 0);
04049         assert(d.throughput_label_bg_color == 0);
04050         assert(d.throughput_label_fg_bold == 0);
04051         assert(d.throughput_fg_color == 0);
04052         assert(d.throughput_bg_color == 0);
04053         assert(d.throughput_fg_bold == 0);
04054         assert(d.time_label_fg_color == 0);
04055         assert(d.time_label_bg_color == 0);
04056         assert(d.time_label_fg_bold == 0);
04057         assert(d.percent_fg_color == 0);
04058         assert(d.percent_bg_color == 0);
04059         assert(d.percent_fg_bold == 0);
04060         assert(d.barbrace_fg_color == 0);
04061         assert(d.barbrace_bg_color == 0);
04062         assert(d.barbrace_fg_bold == 0);
04063         assert(d.bar_fg_color == 0);
04064         assert(d.bar_bg_color == 0);
04065         assert(d.bar_fg_bold == 0);
04066         assert(io.in == 0);
04067         assert(io.out == 1);
04068         assert(io.in_ready == 0);
04069         assert(io.out_ready == 0);
04070         assert(io.eof_in == 0);
04071         assert(io.eof_out == 0);
04072         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04073         /* assert(io.cbuf == 0x0); */
04074         assert(io.last_read == 0);
04075         assert(io.last_write == 0);
04076         assert(io.total_read == 0);
04077         assert(io.total_write == 0);
04078         assert(io.total_size == 0);
04079         assert(io.total_size_known == 0);
04080         assert(io.timeout == 250000);
04081 }
04082 
04083 void test31(FILE* out)
04084 {
04085         int argc = 0;
04086         char *argv[256] = { 0 };
04087 
04088         argv[argc++] = "ProgramName";
04089         argv[argc++] = "-sw";
04090         argv[argc++] = "0";
04091 
04092         displayInit();
04093         ioInit();
04094 
04095 #ifdef PRINT_DEBUG
04096         print();
04097 #endif
04098         assert(d.start_time == 0);
04099         assert(d.total_time == 0);
04100         assert(d.current_time == 0);
04101         assert(d.elapsed_time == 0);
04102         assert(d.percent_complete == 0);
04103         assert(d.display_interval == 1);
04104         assert(d.overtime_flag == 0);
04105         assert(d.k == 1024);
04106         assert(d.twiddle == '-');
04107         assert(d.manual_width == 0);
04108         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04109         assert(d.display_datacount == 1);
04110         assert(d.display_throughput == 1);
04111         assert(d.display_time == 1);
04112         assert(d.display_percent == 1);
04113         assert(d.display_bar == 1);
04114         assert(d.display_summary == 1);
04115         assert(d.display_ansi == 0);
04116         assert(d.twiddle_fg_color == 0);
04117         assert(d.twiddle_bg_color == 0);
04118         assert(d.twiddle_fg_bold == 0);
04119         assert(d.datacount_fg_color == 0);
04120         assert(d.datacount_bg_color == 0);
04121         assert(d.datacount_fg_bold == 0);
04122         assert(d.throughput_label_fg_color == 0);
04123         assert(d.throughput_label_bg_color == 0);
04124         assert(d.throughput_label_fg_bold == 0);
04125         assert(d.throughput_fg_color == 0);
04126         assert(d.throughput_bg_color == 0);
04127         assert(d.throughput_fg_bold == 0);
04128         assert(d.time_label_fg_color == 0);
04129         assert(d.time_label_bg_color == 0);
04130         assert(d.time_label_fg_bold == 0);
04131         assert(d.percent_fg_color == 0);
04132         assert(d.percent_bg_color == 0);
04133         assert(d.percent_fg_bold == 0);
04134         assert(d.barbrace_fg_color == 0);
04135         assert(d.barbrace_bg_color == 0);
04136         assert(d.barbrace_fg_bold == 0);
04137         assert(d.bar_fg_color == 0);
04138         assert(d.bar_bg_color == 0);
04139         assert(d.bar_fg_bold == 0);
04140         assert(io.in == 0);
04141         assert(io.out == 1);
04142         assert(io.in_ready == 0);
04143         assert(io.out_ready == 0);
04144         assert(io.eof_in == 0);
04145         assert(io.eof_out == 0);
04146         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04147         /* assert(io.cbuf == 0x0); */
04148         assert(io.last_read == 0);
04149         assert(io.last_write == 0);
04150         assert(io.total_read == 0);
04151         assert(io.total_write == 0);
04152         assert(io.total_size == 0);
04153         assert(io.total_size_known == 0);
04154         assert(io.timeout == 250000);
04155 
04156         assert(parse_args(out, argc, argv) == 1);
04157 
04158 #ifdef PRINT_DEBUG
04159         print();
04160 #endif
04161         assert(d.start_time == 0);
04162         assert(d.total_time == 0);
04163         assert(d.current_time == 0);
04164         assert(d.elapsed_time == 0);
04165         assert(d.percent_complete == 0);
04166         assert(d.display_interval == 1);
04167         assert(d.overtime_flag == 0);
04168         assert(d.k == 1024);
04169         assert(d.twiddle == '-');
04170         assert(d.manual_width == 0);
04171         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04172         assert(d.display_datacount == 1);
04173         assert(d.display_throughput == 1);
04174         assert(d.display_time == 1);
04175         assert(d.display_percent == 1);
04176         assert(d.display_bar == 1);
04177         assert(d.display_summary == 1);
04178         assert(d.display_ansi == 0);
04179         assert(d.twiddle_fg_color == 0);
04180         assert(d.twiddle_bg_color == 0);
04181         assert(d.twiddle_fg_bold == 0);
04182         assert(d.datacount_fg_color == 0);
04183         assert(d.datacount_bg_color == 0);
04184         assert(d.datacount_fg_bold == 0);
04185         assert(d.throughput_label_fg_color == 0);
04186         assert(d.throughput_label_bg_color == 0);
04187         assert(d.throughput_label_fg_bold == 0);
04188         assert(d.throughput_fg_color == 0);
04189         assert(d.throughput_bg_color == 0);
04190         assert(d.throughput_fg_bold == 0);
04191         assert(d.time_label_fg_color == 0);
04192         assert(d.time_label_bg_color == 0);
04193         assert(d.time_label_fg_bold == 0);
04194         assert(d.percent_fg_color == 0);
04195         assert(d.percent_bg_color == 0);
04196         assert(d.percent_fg_bold == 0);
04197         assert(d.barbrace_fg_color == 0);
04198         assert(d.barbrace_bg_color == 0);
04199         assert(d.barbrace_fg_bold == 0);
04200         assert(d.bar_fg_color == 0);
04201         assert(d.bar_bg_color == 0);
04202         assert(d.bar_fg_bold == 0);
04203         assert(io.in == 0);
04204         assert(io.out == 1);
04205         assert(io.in_ready == 0);
04206         assert(io.out_ready == 0);
04207         assert(io.eof_in == 0);
04208         assert(io.eof_out == 0);
04209         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04210         /* assert(io.cbuf == 0x0); */
04211         assert(io.last_read == 0);
04212         assert(io.last_write == 0);
04213         assert(io.total_read == 0);
04214         assert(io.total_write == 0);
04215         assert(io.total_size == 0);
04216         assert(io.total_size_known == 0);
04217         assert(io.timeout == 250000);
04218 }
04219 
04220 void test32(FILE* out)
04221 {
04222         int argc = 0;
04223         char *argv[256] = { 0 };
04224 
04225         argv[argc++] = "ProgramName";
04226         argv[argc++] = "-sw";
04227         argv[argc++] = "1";
04228 
04229         displayInit();
04230         ioInit();
04231 
04232 #ifdef PRINT_DEBUG
04233         print();
04234 #endif
04235         assert(d.start_time == 0);
04236         assert(d.total_time == 0);
04237         assert(d.current_time == 0);
04238         assert(d.elapsed_time == 0);
04239         assert(d.percent_complete == 0);
04240         assert(d.display_interval == 1);
04241         assert(d.overtime_flag == 0);
04242         assert(d.k == 1024);
04243         assert(d.twiddle == '-');
04244         assert(d.manual_width == 0);
04245         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04246         assert(d.display_datacount == 1);
04247         assert(d.display_throughput == 1);
04248         assert(d.display_time == 1);
04249         assert(d.display_percent == 1);
04250         assert(d.display_bar == 1);
04251         assert(d.display_summary == 1);
04252         assert(d.display_ansi == 0);
04253         assert(d.twiddle_fg_color == 0);
04254         assert(d.twiddle_bg_color == 0);
04255         assert(d.twiddle_fg_bold == 0);
04256         assert(d.datacount_fg_color == 0);
04257         assert(d.datacount_bg_color == 0);
04258         assert(d.datacount_fg_bold == 0);
04259         assert(d.throughput_label_fg_color == 0);
04260         assert(d.throughput_label_bg_color == 0);
04261         assert(d.throughput_label_fg_bold == 0);
04262         assert(d.throughput_fg_color == 0);
04263         assert(d.throughput_bg_color == 0);
04264         assert(d.throughput_fg_bold == 0);
04265         assert(d.time_label_fg_color == 0);
04266         assert(d.time_label_bg_color == 0);
04267         assert(d.time_label_fg_bold == 0);
04268         assert(d.percent_fg_color == 0);
04269         assert(d.percent_bg_color == 0);
04270         assert(d.percent_fg_bold == 0);
04271         assert(d.barbrace_fg_color == 0);
04272         assert(d.barbrace_bg_color == 0);
04273         assert(d.barbrace_fg_bold == 0);
04274         assert(d.bar_fg_color == 0);
04275         assert(d.bar_bg_color == 0);
04276         assert(d.bar_fg_bold == 0);
04277         assert(io.in == 0);
04278         assert(io.out == 1);
04279         assert(io.in_ready == 0);
04280         assert(io.out_ready == 0);
04281         assert(io.eof_in == 0);
04282         assert(io.eof_out == 0);
04283         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04284         /* assert(io.cbuf == 0x0); */
04285         assert(io.last_read == 0);
04286         assert(io.last_write == 0);
04287         assert(io.total_read == 0);
04288         assert(io.total_write == 0);
04289         assert(io.total_size == 0);
04290         assert(io.total_size_known == 0);
04291         assert(io.timeout == 250000);
04292 
04293         assert(parse_args(out, argc, argv) == 0);
04294 
04295 #ifdef PRINT_DEBUG
04296         print();
04297 #endif
04298         assert(d.start_time == 0);
04299         assert(d.total_time == 0);
04300         assert(d.current_time == 0);
04301         assert(d.elapsed_time == 0);
04302         assert(d.percent_complete == 0);
04303         assert(d.display_interval == 1);
04304         assert(d.overtime_flag == 0);
04305         assert(d.k == 1024);
04306         assert(d.twiddle == '-');
04307         assert(d.screen_width == 1);
04308         assert(d.manual_width == 1);
04309         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04310         assert(d.display_datacount == 1);
04311         assert(d.display_throughput == 1);
04312         assert(d.display_time == 1);
04313         assert(d.display_percent == 1);
04314         assert(d.display_bar == 1);
04315         assert(d.display_summary == 1);
04316         assert(d.display_ansi == 0);
04317         assert(d.twiddle_fg_color == 0);
04318         assert(d.twiddle_bg_color == 0);
04319         assert(d.twiddle_fg_bold == 0);
04320         assert(d.datacount_fg_color == 0);
04321         assert(d.datacount_bg_color == 0);
04322         assert(d.datacount_fg_bold == 0);
04323         assert(d.throughput_label_fg_color == 0);
04324         assert(d.throughput_label_bg_color == 0);
04325         assert(d.throughput_label_fg_bold == 0);
04326         assert(d.throughput_fg_color == 0);
04327         assert(d.throughput_bg_color == 0);
04328         assert(d.throughput_fg_bold == 0);
04329         assert(d.time_label_fg_color == 0);
04330         assert(d.time_label_bg_color == 0);
04331         assert(d.time_label_fg_bold == 0);
04332         assert(d.percent_fg_color == 0);
04333         assert(d.percent_bg_color == 0);
04334         assert(d.percent_fg_bold == 0);
04335         assert(d.barbrace_fg_color == 0);
04336         assert(d.barbrace_bg_color == 0);
04337         assert(d.barbrace_fg_bold == 0);
04338         assert(d.bar_fg_color == 0);
04339         assert(d.bar_bg_color == 0);
04340         assert(d.bar_fg_bold == 0);
04341         assert(io.in == 0);
04342         assert(io.out == 1);
04343         assert(io.in_ready == 0);
04344         assert(io.out_ready == 0);
04345         assert(io.eof_in == 0);
04346         assert(io.eof_out == 0);
04347         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04348         /* assert(io.cbuf == 0x0); */
04349         assert(io.last_read == 0);
04350         assert(io.last_write == 0);
04351         assert(io.total_read == 0);
04352         assert(io.total_write == 0);
04353         assert(io.total_size == 0);
04354         assert(io.total_size_known == 0);
04355         assert(io.timeout == 250000);
04356 }
04357 
04358 void test33(FILE* out)
04359 {
04360         int argc = 0;
04361         char *argv[256] = { 0 };
04362 
04363         argv[argc++] = "ProgramName";
04364         argv[argc++] = "-dtw";
04365 
04366         displayInit();
04367         ioInit();
04368 
04369 #ifdef PRINT_DEBUG
04370         print();
04371 #endif
04372         assert(d.start_time == 0);
04373         assert(d.total_time == 0);
04374         assert(d.current_time == 0);
04375         assert(d.elapsed_time == 0);
04376         assert(d.percent_complete == 0);
04377         assert(d.display_interval == 1);
04378         assert(d.overtime_flag == 0);
04379         assert(d.k == 1024);
04380         assert(d.twiddle == '-');
04381         assert(d.manual_width == 0);
04382         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04383         assert(d.display_datacount == 1);
04384         assert(d.display_throughput == 1);
04385         assert(d.display_time == 1);
04386         assert(d.display_percent == 1);
04387         assert(d.display_bar == 1);
04388         assert(d.display_summary == 1);
04389         assert(d.display_ansi == 0);
04390         assert(d.twiddle_fg_color == 0);
04391         assert(d.twiddle_bg_color == 0);
04392         assert(d.twiddle_fg_bold == 0);
04393         assert(d.datacount_fg_color == 0);
04394         assert(d.datacount_bg_color == 0);
04395         assert(d.datacount_fg_bold == 0);
04396         assert(d.throughput_label_fg_color == 0);
04397         assert(d.throughput_label_bg_color == 0);
04398         assert(d.throughput_label_fg_bold == 0);
04399         assert(d.throughput_fg_color == 0);
04400         assert(d.throughput_bg_color == 0);
04401         assert(d.throughput_fg_bold == 0);
04402         assert(d.time_label_fg_color == 0);
04403         assert(d.time_label_bg_color == 0);
04404         assert(d.time_label_fg_bold == 0);
04405         assert(d.percent_fg_color == 0);
04406         assert(d.percent_bg_color == 0);
04407         assert(d.percent_fg_bold == 0);
04408         assert(d.barbrace_fg_color == 0);
04409         assert(d.barbrace_bg_color == 0);
04410         assert(d.barbrace_fg_bold == 0);
04411         assert(d.bar_fg_color == 0);
04412         assert(d.bar_bg_color == 0);
04413         assert(d.bar_fg_bold == 0);
04414         assert(io.in == 0);
04415         assert(io.out == 1);
04416         assert(io.in_ready == 0);
04417         assert(io.out_ready == 0);
04418         assert(io.eof_in == 0);
04419         assert(io.eof_out == 0);
04420         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04421         /* assert(io.cbuf == 0x0); */
04422         assert(io.last_read == 0);
04423         assert(io.last_write == 0);
04424         assert(io.total_read == 0);
04425         assert(io.total_write == 0);
04426         assert(io.total_size == 0);
04427         assert(io.total_size_known == 0);
04428         assert(io.timeout == 250000);
04429 
04430         d.display_twiddle = 0;
04431         assert(parse_args(out, argc, argv) == 0);
04432 
04433 #ifdef PRINT_DEBUG
04434         print();
04435 #endif
04436         assert(d.start_time == 0);
04437         assert(d.total_time == 0);
04438         assert(d.current_time == 0);
04439         assert(d.elapsed_time == 0);
04440         assert(d.percent_complete == 0);
04441         assert(d.display_interval == 1);
04442         assert(d.overtime_flag == 0);
04443         assert(d.k == 1024);
04444         assert(d.twiddle == '-');
04445         assert(d.manual_width == 0); 
04446         assert(d.display_twiddle == 1);
04447         assert(d.display_datacount == 1);
04448         assert(d.display_throughput == 1);
04449         assert(d.display_time == 1);
04450         assert(d.display_percent == 1);
04451         assert(d.display_bar == 1);
04452         assert(d.display_summary == 1);
04453         assert(d.display_ansi == 0);
04454         assert(d.twiddle_fg_color == 0);
04455         assert(d.twiddle_bg_color == 0);
04456         assert(d.twiddle_fg_bold == 0);
04457         assert(d.datacount_fg_color == 0);
04458         assert(d.datacount_bg_color == 0);
04459         assert(d.datacount_fg_bold == 0);
04460         assert(d.throughput_label_fg_color == 0);
04461         assert(d.throughput_label_bg_color == 0);
04462         assert(d.throughput_label_fg_bold == 0);
04463         assert(d.throughput_fg_color == 0);
04464         assert(d.throughput_bg_color == 0);
04465         assert(d.throughput_fg_bold == 0);
04466         assert(d.time_label_fg_color == 0);
04467         assert(d.time_label_bg_color == 0);
04468         assert(d.time_label_fg_bold == 0);
04469         assert(d.percent_fg_color == 0);
04470         assert(d.percent_bg_color == 0);
04471         assert(d.percent_fg_bold == 0);
04472         assert(d.barbrace_fg_color == 0);
04473         assert(d.barbrace_bg_color == 0);
04474         assert(d.barbrace_fg_bold == 0);
04475         assert(d.bar_fg_color == 0);
04476         assert(d.bar_bg_color == 0);
04477         assert(d.bar_fg_bold == 0);
04478         assert(io.in == 0);
04479         assert(io.out == 1);
04480         assert(io.in_ready == 0);
04481         assert(io.out_ready == 0);
04482         assert(io.eof_in == 0);
04483         assert(io.eof_out == 0);
04484         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04485         /* assert(io.cbuf == 0x0); */
04486         assert(io.last_read == 0);
04487         assert(io.last_write == 0);
04488         assert(io.total_read == 0);
04489         assert(io.total_write == 0);
04490         assert(io.total_size == 0);
04491         assert(io.total_size_known == 0);
04492         assert(io.timeout == 250000);
04493 }
04494 
04495 void test34(FILE* out)
04496 {
04497         int argc = 0;
04498         char *argv[256] = { 0 };
04499 
04500         argv[argc++] = "ProgramName";
04501         argv[argc++] = "-ntw";
04502 
04503         displayInit();
04504         ioInit();
04505 
04506 #ifdef PRINT_DEBUG
04507         print();
04508 #endif
04509         assert(d.start_time == 0);
04510         assert(d.total_time == 0);
04511         assert(d.current_time == 0);
04512         assert(d.elapsed_time == 0);
04513         assert(d.percent_complete == 0);
04514         assert(d.display_interval == 1);
04515         assert(d.overtime_flag == 0);
04516         assert(d.k == 1024);
04517         assert(d.twiddle == '-');
04518         assert(d.manual_width == 0);
04519         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04520         assert(d.display_datacount == 1);
04521         assert(d.display_throughput == 1);
04522         assert(d.display_time == 1);
04523         assert(d.display_percent == 1);
04524         assert(d.display_bar == 1);
04525         assert(d.display_summary == 1);
04526         assert(d.display_ansi == 0);
04527         assert(d.twiddle_fg_color == 0);
04528         assert(d.twiddle_bg_color == 0);
04529         assert(d.twiddle_fg_bold == 0);
04530         assert(d.datacount_fg_color == 0);
04531         assert(d.datacount_bg_color == 0);
04532         assert(d.datacount_fg_bold == 0);
04533         assert(d.throughput_label_fg_color == 0);
04534         assert(d.throughput_label_bg_color == 0);
04535         assert(d.throughput_label_fg_bold == 0);
04536         assert(d.throughput_fg_color == 0);
04537         assert(d.throughput_bg_color == 0);
04538         assert(d.throughput_fg_bold == 0);
04539         assert(d.time_label_fg_color == 0);
04540         assert(d.time_label_bg_color == 0);
04541         assert(d.time_label_fg_bold == 0);
04542         assert(d.percent_fg_color == 0);
04543         assert(d.percent_bg_color == 0);
04544         assert(d.percent_fg_bold == 0);
04545         assert(d.barbrace_fg_color == 0);
04546         assert(d.barbrace_bg_color == 0);
04547         assert(d.barbrace_fg_bold == 0);
04548         assert(d.bar_fg_color == 0);
04549         assert(d.bar_bg_color == 0);
04550         assert(d.bar_fg_bold == 0);
04551         assert(io.in == 0);
04552         assert(io.out == 1);
04553         assert(io.in_ready == 0);
04554         assert(io.out_ready == 0);
04555         assert(io.eof_in == 0);
04556         assert(io.eof_out == 0);
04557         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04558         /* assert(io.cbuf == 0x0); */
04559         assert(io.last_read == 0);
04560         assert(io.last_write == 0);
04561         assert(io.total_read == 0);
04562         assert(io.total_write == 0);
04563         assert(io.total_size == 0);
04564         assert(io.total_size_known == 0);
04565         assert(io.timeout == 250000);
04566 
04567         assert(parse_args(out, argc, argv) == 0);
04568 
04569 #ifdef PRINT_DEBUG
04570         print();
04571 #endif
04572         assert(d.start_time == 0);
04573         assert(d.total_time == 0);
04574         assert(d.current_time == 0);
04575         assert(d.elapsed_time == 0);
04576         assert(d.percent_complete == 0);
04577         assert(d.display_interval == 1);
04578         assert(d.overtime_flag == 0);
04579         assert(d.k == 1024);
04580         assert(d.twiddle == '-');
04581         assert(d.manual_width == 0); 
04582         assert(d.display_twiddle == 0);
04583         assert(d.display_datacount == 1);
04584         assert(d.display_throughput == 1);
04585         assert(d.display_time == 1);
04586         assert(d.display_percent == 1);
04587         assert(d.display_bar == 1);
04588         assert(d.display_summary == 1);
04589         assert(d.display_ansi == 0);
04590         assert(d.twiddle_fg_color == 0);
04591         assert(d.twiddle_bg_color == 0);
04592         assert(d.twiddle_fg_bold == 0);
04593         assert(d.datacount_fg_color == 0);
04594         assert(d.datacount_bg_color == 0);
04595         assert(d.datacount_fg_bold == 0);
04596         assert(d.throughput_label_fg_color == 0);
04597         assert(d.throughput_label_bg_color == 0);
04598         assert(d.throughput_label_fg_bold == 0);
04599         assert(d.throughput_fg_color == 0);
04600         assert(d.throughput_bg_color == 0);
04601         assert(d.throughput_fg_bold == 0);
04602         assert(d.time_label_fg_color == 0);
04603         assert(d.time_label_bg_color == 0);
04604         assert(d.time_label_fg_bold == 0);
04605         assert(d.percent_fg_color == 0);
04606         assert(d.percent_bg_color == 0);
04607         assert(d.percent_fg_bold == 0);
04608         assert(d.barbrace_fg_color == 0);
04609         assert(d.barbrace_bg_color == 0);
04610         assert(d.barbrace_fg_bold == 0);
04611         assert(d.bar_fg_color == 0);
04612         assert(d.bar_bg_color == 0);
04613         assert(d.bar_fg_bold == 0);
04614         assert(io.in == 0);
04615         assert(io.out == 1);
04616         assert(io.in_ready == 0);
04617         assert(io.out_ready == 0);
04618         assert(io.eof_in == 0);
04619         assert(io.eof_out == 0);
04620         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04621         /* assert(io.cbuf == 0x0); */
04622         assert(io.last_read == 0);
04623         assert(io.last_write == 0);
04624         assert(io.total_read == 0);
04625         assert(io.total_write == 0);
04626         assert(io.total_size == 0);
04627         assert(io.total_size_known == 0);
04628         assert(io.timeout == 250000);
04629 }
04630 
04631 void test35(FILE* out)
04632 {
04633         int argc = 0;
04634         char *argv[256] = { 0 };
04635 
04636         argv[argc++] = "ProgramName";
04637         argv[argc++] = "-dc";
04638 
04639         displayInit();
04640         ioInit();
04641 
04642 #ifdef PRINT_DEBUG
04643         print();
04644 #endif
04645         assert(d.start_time == 0);
04646         assert(d.total_time == 0);
04647         assert(d.current_time == 0);
04648         assert(d.elapsed_time == 0);
04649         assert(d.percent_complete == 0);
04650         assert(d.display_interval == 1);
04651         assert(d.overtime_flag == 0);
04652         assert(d.k == 1024);
04653         assert(d.twiddle == '-');
04654         assert(d.manual_width == 0);
04655         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04656         assert(d.display_datacount == 1);
04657         assert(d.display_throughput == 1);
04658         assert(d.display_time == 1);
04659         assert(d.display_percent == 1);
04660         assert(d.display_bar == 1);
04661         assert(d.display_summary == 1);
04662         assert(d.display_ansi == 0);
04663         assert(d.twiddle_fg_color == 0);
04664         assert(d.twiddle_bg_color == 0);
04665         assert(d.twiddle_fg_bold == 0);
04666         assert(d.datacount_fg_color == 0);
04667         assert(d.datacount_bg_color == 0);
04668         assert(d.datacount_fg_bold == 0);
04669         assert(d.throughput_label_fg_color == 0);
04670         assert(d.throughput_label_bg_color == 0);
04671         assert(d.throughput_label_fg_bold == 0);
04672         assert(d.throughput_fg_color == 0);
04673         assert(d.throughput_bg_color == 0);
04674         assert(d.throughput_fg_bold == 0);
04675         assert(d.time_label_fg_color == 0);
04676         assert(d.time_label_bg_color == 0);
04677         assert(d.time_label_fg_bold == 0);
04678         assert(d.percent_fg_color == 0);
04679         assert(d.percent_bg_color == 0);
04680         assert(d.percent_fg_bold == 0);
04681         assert(d.barbrace_fg_color == 0);
04682         assert(d.barbrace_bg_color == 0);
04683         assert(d.barbrace_fg_bold == 0);
04684         assert(d.bar_fg_color == 0);
04685         assert(d.bar_bg_color == 0);
04686         assert(d.bar_fg_bold == 0);
04687         assert(io.in == 0);
04688         assert(io.out == 1);
04689         assert(io.in_ready == 0);
04690         assert(io.out_ready == 0);
04691         assert(io.eof_in == 0);
04692         assert(io.eof_out == 0);
04693         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04694         /* assert(io.cbuf == 0x0); */
04695         assert(io.last_read == 0);
04696         assert(io.last_write == 0);
04697         assert(io.total_read == 0);
04698         assert(io.total_write == 0);
04699         assert(io.total_size == 0);
04700         assert(io.total_size_known == 0);
04701         assert(io.timeout == 250000);
04702 
04703         d.display_datacount = 0;
04704         assert(parse_args(out, argc, argv) == 0);
04705 
04706 #ifdef PRINT_DEBUG
04707         print();
04708 #endif
04709         assert(d.start_time == 0);
04710         assert(d.total_time == 0);
04711         assert(d.current_time == 0);
04712         assert(d.elapsed_time == 0);
04713         assert(d.percent_complete == 0);
04714         assert(d.display_interval == 1);
04715         assert(d.overtime_flag == 0);
04716         assert(d.k == 1024);
04717         assert(d.twiddle == '-');
04718         assert(d.manual_width == 0); 
04719         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04720         assert(d.display_datacount == 1);
04721         assert(d.display_throughput == 1);
04722         assert(d.display_time == 1);
04723         assert(d.display_percent == 1);
04724         assert(d.display_bar == 1);
04725         assert(d.display_summary == 1);
04726         assert(d.display_ansi == 0);
04727         assert(d.twiddle_fg_color == 0);
04728         assert(d.twiddle_bg_color == 0);
04729         assert(d.twiddle_fg_bold == 0);
04730         assert(d.datacount_fg_color == 0);
04731         assert(d.datacount_bg_color == 0);
04732         assert(d.datacount_fg_bold == 0);
04733         assert(d.throughput_label_fg_color == 0);
04734         assert(d.throughput_label_bg_color == 0);
04735         assert(d.throughput_label_fg_bold == 0);
04736         assert(d.throughput_fg_color == 0);
04737         assert(d.throughput_bg_color == 0);
04738         assert(d.throughput_fg_bold == 0);
04739         assert(d.time_label_fg_color == 0);
04740         assert(d.time_label_bg_color == 0);
04741         assert(d.time_label_fg_bold == 0);
04742         assert(d.percent_fg_color == 0);
04743         assert(d.percent_bg_color == 0);
04744         assert(d.percent_fg_bold == 0);
04745         assert(d.barbrace_fg_color == 0);
04746         assert(d.barbrace_bg_color == 0);
04747         assert(d.barbrace_fg_bold == 0);
04748         assert(d.bar_fg_color == 0);
04749         assert(d.bar_bg_color == 0);
04750         assert(d.bar_fg_bold == 0);
04751         assert(io.in == 0);
04752         assert(io.out == 1);
04753         assert(io.in_ready == 0);
04754         assert(io.out_ready == 0);
04755         assert(io.eof_in == 0);
04756         assert(io.eof_out == 0);
04757         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04758         /* assert(io.cbuf == 0x0); */
04759         assert(io.last_read == 0);
04760         assert(io.last_write == 0);
04761         assert(io.total_read == 0);
04762         assert(io.total_write == 0);
04763         assert(io.total_size == 0);
04764         assert(io.total_size_known == 0);
04765         assert(io.timeout == 250000);
04766 }
04767 
04768 void test36(FILE* out)
04769 {
04770         int argc = 0;
04771         char *argv[256] = { 0 };
04772 
04773         argv[argc++] = "ProgramName";
04774         argv[argc++] = "-nc";
04775 
04776         displayInit();
04777         ioInit();
04778 
04779 #ifdef PRINT_DEBUG
04780         print();
04781 #endif
04782         assert(d.start_time == 0);
04783         assert(d.total_time == 0);
04784         assert(d.current_time == 0);
04785         assert(d.elapsed_time == 0);
04786         assert(d.percent_complete == 0);
04787         assert(d.display_interval == 1);
04788         assert(d.overtime_flag == 0);
04789         assert(d.k == 1024);
04790         assert(d.twiddle == '-');
04791         assert(d.manual_width == 0);
04792         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04793         assert(d.display_datacount == 1);
04794         assert(d.display_throughput == 1);
04795         assert(d.display_time == 1);
04796         assert(d.display_percent == 1);
04797         assert(d.display_bar == 1);
04798         assert(d.display_summary == 1);
04799         assert(d.display_ansi == 0);
04800         assert(d.twiddle_fg_color == 0);
04801         assert(d.twiddle_bg_color == 0);
04802         assert(d.twiddle_fg_bold == 0);
04803         assert(d.datacount_fg_color == 0);
04804         assert(d.datacount_bg_color == 0);
04805         assert(d.datacount_fg_bold == 0);
04806         assert(d.throughput_label_fg_color == 0);
04807         assert(d.throughput_label_bg_color == 0);
04808         assert(d.throughput_label_fg_bold == 0);
04809         assert(d.throughput_fg_color == 0);
04810         assert(d.throughput_bg_color == 0);
04811         assert(d.throughput_fg_bold == 0);
04812         assert(d.time_label_fg_color == 0);
04813         assert(d.time_label_bg_color == 0);
04814         assert(d.time_label_fg_bold == 0);
04815         assert(d.percent_fg_color == 0);
04816         assert(d.percent_bg_color == 0);
04817         assert(d.percent_fg_bold == 0);
04818         assert(d.barbrace_fg_color == 0);
04819         assert(d.barbrace_bg_color == 0);
04820         assert(d.barbrace_fg_bold == 0);
04821         assert(d.bar_fg_color == 0);
04822         assert(d.bar_bg_color == 0);
04823         assert(d.bar_fg_bold == 0);
04824         assert(io.in == 0);
04825         assert(io.out == 1);
04826         assert(io.in_ready == 0);
04827         assert(io.out_ready == 0);
04828         assert(io.eof_in == 0);
04829         assert(io.eof_out == 0);
04830         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04831         /* assert(io.cbuf == 0x0); */
04832         assert(io.last_read == 0);
04833         assert(io.last_write == 0);
04834         assert(io.total_read == 0);
04835         assert(io.total_write == 0);
04836         assert(io.total_size == 0);
04837         assert(io.total_size_known == 0);
04838         assert(io.timeout == 250000);
04839 
04840         assert(parse_args(out, argc, argv) == 0);
04841 
04842 #ifdef PRINT_DEBUG
04843         print();
04844 #endif
04845         assert(d.start_time == 0);
04846         assert(d.total_time == 0);
04847         assert(d.current_time == 0);
04848         assert(d.elapsed_time == 0);
04849         assert(d.percent_complete == 0);
04850         assert(d.display_interval == 1);
04851         assert(d.overtime_flag == 0);
04852         assert(d.k == 1024);
04853         assert(d.twiddle == '-');
04854         assert(d.manual_width == 0); 
04855         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04856         assert(d.display_datacount == 0);
04857         assert(d.display_throughput == 1);
04858         assert(d.display_time == 1);
04859         assert(d.display_percent == 1);
04860         assert(d.display_bar == 1);
04861         assert(d.display_summary == 1);
04862         assert(d.display_ansi == 0);
04863         assert(d.twiddle_fg_color == 0);
04864         assert(d.twiddle_bg_color == 0);
04865         assert(d.twiddle_fg_bold == 0);
04866         assert(d.datacount_fg_color == 0);
04867         assert(d.datacount_bg_color == 0);
04868         assert(d.datacount_fg_bold == 0);
04869         assert(d.throughput_label_fg_color == 0);
04870         assert(d.throughput_label_bg_color == 0);
04871         assert(d.throughput_label_fg_bold == 0);
04872         assert(d.throughput_fg_color == 0);
04873         assert(d.throughput_bg_color == 0);
04874         assert(d.throughput_fg_bold == 0);
04875         assert(d.time_label_fg_color == 0);
04876         assert(d.time_label_bg_color == 0);
04877         assert(d.time_label_fg_bold == 0);
04878         assert(d.percent_fg_color == 0);
04879         assert(d.percent_bg_color == 0);
04880         assert(d.percent_fg_bold == 0);
04881         assert(d.barbrace_fg_color == 0);
04882         assert(d.barbrace_bg_color == 0);
04883         assert(d.barbrace_fg_bold == 0);
04884         assert(d.bar_fg_color == 0);
04885         assert(d.bar_bg_color == 0);
04886         assert(d.bar_fg_bold == 0);
04887         assert(io.in == 0);
04888         assert(io.out == 1);
04889         assert(io.in_ready == 0);
04890         assert(io.out_ready == 0);
04891         assert(io.eof_in == 0);
04892         assert(io.eof_out == 0);
04893         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04894         /* assert(io.cbuf == 0x0); */
04895         assert(io.last_read == 0);
04896         assert(io.last_write == 0);
04897         assert(io.total_read == 0);
04898         assert(io.total_write == 0);
04899         assert(io.total_size == 0);
04900         assert(io.total_size_known == 0);
04901         assert(io.timeout == 250000);
04902 }
04903 
04904 void test37(FILE* out)
04905 {
04906         int argc = 0;
04907         char *argv[256] = { 0 };
04908 
04909         argv[argc++] = "ProgramName";
04910         argv[argc++] = "-dth";
04911 
04912         displayInit();
04913         ioInit();
04914 
04915 #ifdef PRINT_DEBUG
04916         print();
04917 #endif
04918         assert(d.start_time == 0);
04919         assert(d.total_time == 0);
04920         assert(d.current_time == 0);
04921         assert(d.elapsed_time == 0);
04922         assert(d.percent_complete == 0);
04923         assert(d.display_interval == 1);
04924         assert(d.overtime_flag == 0);
04925         assert(d.k == 1024);
04926         assert(d.twiddle == '-');
04927         assert(d.manual_width == 0);
04928         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04929         assert(d.display_datacount == 1);
04930         assert(d.display_throughput == 1);
04931         assert(d.display_time == 1);
04932         assert(d.display_percent == 1);
04933         assert(d.display_bar == 1);
04934         assert(d.display_summary == 1);
04935         assert(d.display_ansi == 0);
04936         assert(d.twiddle_fg_color == 0);
04937         assert(d.twiddle_bg_color == 0);
04938         assert(d.twiddle_fg_bold == 0);
04939         assert(d.datacount_fg_color == 0);
04940         assert(d.datacount_bg_color == 0);
04941         assert(d.datacount_fg_bold == 0);
04942         assert(d.throughput_label_fg_color == 0);
04943         assert(d.throughput_label_bg_color == 0);
04944         assert(d.throughput_label_fg_bold == 0);
04945         assert(d.throughput_fg_color == 0);
04946         assert(d.throughput_bg_color == 0);
04947         assert(d.throughput_fg_bold == 0);
04948         assert(d.time_label_fg_color == 0);
04949         assert(d.time_label_bg_color == 0);
04950         assert(d.time_label_fg_bold == 0);
04951         assert(d.percent_fg_color == 0);
04952         assert(d.percent_bg_color == 0);
04953         assert(d.percent_fg_bold == 0);
04954         assert(d.barbrace_fg_color == 0);
04955         assert(d.barbrace_bg_color == 0);
04956         assert(d.barbrace_fg_bold == 0);
04957         assert(d.bar_fg_color == 0);
04958         assert(d.bar_bg_color == 0);
04959         assert(d.bar_fg_bold == 0);
04960         assert(io.in == 0);
04961         assert(io.out == 1);
04962         assert(io.in_ready == 0);
04963         assert(io.out_ready == 0);
04964         assert(io.eof_in == 0);
04965         assert(io.eof_out == 0);
04966         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
04967         /* assert(io.cbuf == 0x0); */
04968         assert(io.last_read == 0);
04969         assert(io.last_write == 0);
04970         assert(io.total_read == 0);
04971         assert(io.total_write == 0);
04972         assert(io.total_size == 0);
04973         assert(io.total_size_known == 0);
04974         assert(io.timeout == 250000);
04975 
04976         d.display_throughput = 0;
04977         assert(parse_args(out, argc, argv) == 0);
04978 
04979 #ifdef PRINT_DEBUG
04980         print();
04981 #endif
04982         assert(d.start_time == 0);
04983         assert(d.total_time == 0);
04984         assert(d.current_time == 0);
04985         assert(d.elapsed_time == 0);
04986         assert(d.percent_complete == 0);
04987         assert(d.display_interval == 1);
04988         assert(d.overtime_flag == 0);
04989         assert(d.k == 1024);
04990         assert(d.twiddle == '-');
04991         assert(d.manual_width == 0); 
04992         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
04993         assert(d.display_datacount == 1);
04994         assert(d.display_throughput == 1);
04995         assert(d.display_time == 1);
04996         assert(d.display_percent == 1);
04997         assert(d.display_bar == 1);
04998         assert(d.display_summary == 1);
04999         assert(d.display_ansi == 0);
05000         assert(d.twiddle_fg_color == 0);
05001         assert(d.twiddle_bg_color == 0);
05002         assert(d.twiddle_fg_bold == 0);
05003         assert(d.datacount_fg_color == 0);
05004         assert(d.datacount_bg_color == 0);
05005         assert(d.datacount_fg_bold == 0);
05006         assert(d.throughput_label_fg_color == 0);
05007         assert(d.throughput_label_bg_color == 0);
05008         assert(d.throughput_label_fg_bold == 0);
05009         assert(d.throughput_fg_color == 0);
05010         assert(d.throughput_bg_color == 0);
05011         assert(d.throughput_fg_bold == 0);
05012         assert(d.time_label_fg_color == 0);
05013         assert(d.time_label_bg_color == 0);
05014         assert(d.time_label_fg_bold == 0);
05015         assert(d.percent_fg_color == 0);
05016         assert(d.percent_bg_color == 0);
05017         assert(d.percent_fg_bold == 0);
05018         assert(d.barbrace_fg_color == 0);
05019         assert(d.barbrace_bg_color == 0);
05020         assert(d.barbrace_fg_bold == 0);
05021         assert(d.bar_fg_color == 0);
05022         assert(d.bar_bg_color == 0);
05023         assert(d.bar_fg_bold == 0);
05024         assert(io.in == 0);
05025         assert(io.out == 1);
05026         assert(io.in_ready == 0);
05027         assert(io.out_ready == 0);
05028         assert(io.eof_in == 0);
05029         assert(io.eof_out == 0);
05030         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05031         /* assert(io.cbuf == 0x0); */
05032         assert(io.last_read == 0);
05033         assert(io.last_write == 0);
05034         assert(io.total_read == 0);
05035         assert(io.total_write == 0);
05036         assert(io.total_size == 0);
05037         assert(io.total_size_known == 0);
05038         assert(io.timeout == 250000);
05039 }
05040 
05041 void test38(FILE* out)
05042 {
05043         int argc = 0;
05044         char *argv[256] = { 0 };
05045 
05046         argv[argc++] = "ProgramName";
05047         argv[argc++] = "-nth";
05048 
05049         displayInit();
05050         ioInit();
05051 
05052 #ifdef PRINT_DEBUG
05053         print();
05054 #endif
05055         assert(d.start_time == 0);
05056         assert(d.total_time == 0);
05057         assert(d.current_time == 0);
05058         assert(d.elapsed_time == 0);
05059         assert(d.percent_complete == 0);
05060         assert(d.display_interval == 1);
05061         assert(d.overtime_flag == 0);
05062         assert(d.k == 1024);
05063         assert(d.twiddle == '-');
05064         assert(d.manual_width == 0);
05065         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05066         assert(d.display_datacount == 1);
05067         assert(d.display_throughput == 1);
05068         assert(d.display_time == 1);
05069         assert(d.display_percent == 1);
05070         assert(d.display_bar == 1);
05071         assert(d.display_summary == 1);
05072         assert(d.display_ansi == 0);
05073         assert(d.twiddle_fg_color == 0);
05074         assert(d.twiddle_bg_color == 0);
05075         assert(d.twiddle_fg_bold == 0);
05076         assert(d.datacount_fg_color == 0);
05077         assert(d.datacount_bg_color == 0);
05078         assert(d.datacount_fg_bold == 0);
05079         assert(d.throughput_label_fg_color == 0);
05080         assert(d.throughput_label_bg_color == 0);
05081         assert(d.throughput_label_fg_bold == 0);
05082         assert(d.throughput_fg_color == 0);
05083         assert(d.throughput_bg_color == 0);
05084         assert(d.throughput_fg_bold == 0);
05085         assert(d.time_label_fg_color == 0);
05086         assert(d.time_label_bg_color == 0);
05087         assert(d.time_label_fg_bold == 0);
05088         assert(d.percent_fg_color == 0);
05089         assert(d.percent_bg_color == 0);
05090         assert(d.percent_fg_bold == 0);
05091         assert(d.barbrace_fg_color == 0);
05092         assert(d.barbrace_bg_color == 0);
05093         assert(d.barbrace_fg_bold == 0);
05094         assert(d.bar_fg_color == 0);
05095         assert(d.bar_bg_color == 0);
05096         assert(d.bar_fg_bold == 0);
05097         assert(io.in == 0);
05098         assert(io.out == 1);
05099         assert(io.in_ready == 0);
05100         assert(io.out_ready == 0);
05101         assert(io.eof_in == 0);
05102         assert(io.eof_out == 0);
05103         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05104         /* assert(io.cbuf == 0x0); */
05105         assert(io.last_read == 0);
05106         assert(io.last_write == 0);
05107         assert(io.total_read == 0);
05108         assert(io.total_write == 0);
05109         assert(io.total_size == 0);
05110         assert(io.total_size_known == 0);
05111         assert(io.timeout == 250000);
05112 
05113         assert(parse_args(out, argc, argv) == 0);
05114 
05115 #ifdef PRINT_DEBUG
05116         print();
05117 #endif
05118         assert(d.start_time == 0);
05119         assert(d.total_time == 0);
05120         assert(d.current_time == 0);
05121         assert(d.elapsed_time == 0);
05122         assert(d.percent_complete == 0);
05123         assert(d.display_interval == 1);
05124         assert(d.overtime_flag == 0);
05125         assert(d.k == 1024);
05126         assert(d.twiddle == '-');
05127         assert(d.manual_width == 0); 
05128         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05129         assert(d.display_datacount == 1);
05130         assert(d.display_throughput == 0);
05131         assert(d.display_time == 1);
05132         assert(d.display_percent == 1);
05133         assert(d.display_bar == 1);
05134         assert(d.display_summary == 1);
05135         assert(d.display_ansi == 0);
05136         assert(d.twiddle_fg_color == 0);
05137         assert(d.twiddle_bg_color == 0);
05138         assert(d.twiddle_fg_bold == 0);
05139         assert(d.datacount_fg_color == 0);
05140         assert(d.datacount_bg_color == 0);
05141         assert(d.datacount_fg_bold == 0);
05142         assert(d.throughput_label_fg_color == 0);
05143         assert(d.throughput_label_bg_color == 0);
05144         assert(d.throughput_label_fg_bold == 0);
05145         assert(d.throughput_fg_color == 0);
05146         assert(d.throughput_bg_color == 0);
05147         assert(d.throughput_fg_bold == 0);
05148         assert(d.time_label_fg_color == 0);
05149         assert(d.time_label_bg_color == 0);
05150         assert(d.time_label_fg_bold == 0);
05151         assert(d.percent_fg_color == 0);
05152         assert(d.percent_bg_color == 0);
05153         assert(d.percent_fg_bold == 0);
05154         assert(d.barbrace_fg_color == 0);
05155         assert(d.barbrace_bg_color == 0);
05156         assert(d.barbrace_fg_bold == 0);
05157         assert(d.bar_fg_color == 0);
05158         assert(d.bar_bg_color == 0);
05159         assert(d.bar_fg_bold == 0);
05160         assert(io.in == 0);
05161         assert(io.out == 1);
05162         assert(io.in_ready == 0);
05163         assert(io.out_ready == 0);
05164         assert(io.eof_in == 0);
05165         assert(io.eof_out == 0);
05166         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05167         /* assert(io.cbuf == 0x0); */
05168         assert(io.last_read == 0);
05169         assert(io.last_write == 0);
05170         assert(io.total_read == 0);
05171         assert(io.total_write == 0);
05172         assert(io.total_size == 0);
05173         assert(io.total_size_known == 0);
05174         assert(io.timeout == 250000);
05175 }
05176 
05177 void test39(FILE* out)
05178 {
05179         int argc = 0;
05180         char *argv[256] = { 0 };
05181 
05182         argv[argc++] = "ProgramName";
05183         argv[argc++] = "-dt";
05184 
05185         displayInit();
05186         ioInit();
05187 
05188 #ifdef PRINT_DEBUG
05189         print();
05190 #endif
05191         assert(d.start_time == 0);
05192         assert(d.total_time == 0);
05193         assert(d.current_time == 0);
05194         assert(d.elapsed_time == 0);
05195         assert(d.percent_complete == 0);
05196         assert(d.display_interval == 1);
05197         assert(d.overtime_flag == 0);
05198         assert(d.k == 1024);
05199         assert(d.twiddle == '-');
05200         assert(d.manual_width == 0);
05201         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05202         assert(d.display_datacount == 1);
05203         assert(d.display_throughput == 1);
05204         assert(d.display_time == 1);
05205         assert(d.display_percent == 1);
05206         assert(d.display_bar == 1);
05207         assert(d.display_summary == 1);
05208         assert(d.display_ansi == 0);
05209         assert(d.twiddle_fg_color == 0);
05210         assert(d.twiddle_bg_color == 0);
05211         assert(d.twiddle_fg_bold == 0);
05212         assert(d.datacount_fg_color == 0);
05213         assert(d.datacount_bg_color == 0);
05214         assert(d.datacount_fg_bold == 0);
05215         assert(d.throughput_label_fg_color == 0);
05216         assert(d.throughput_label_bg_color == 0);
05217         assert(d.throughput_label_fg_bold == 0);
05218         assert(d.throughput_fg_color == 0);
05219         assert(d.throughput_bg_color == 0);
05220         assert(d.throughput_fg_bold == 0);
05221         assert(d.time_label_fg_color == 0);
05222         assert(d.time_label_bg_color == 0);
05223         assert(d.time_label_fg_bold == 0);
05224         assert(d.percent_fg_color == 0);
05225         assert(d.percent_bg_color == 0);
05226         assert(d.percent_fg_bold == 0);
05227         assert(d.barbrace_fg_color == 0);
05228         assert(d.barbrace_bg_color == 0);
05229         assert(d.barbrace_fg_bold == 0);
05230         assert(d.bar_fg_color == 0);
05231         assert(d.bar_bg_color == 0);
05232         assert(d.bar_fg_bold == 0);
05233         assert(io.in == 0);
05234         assert(io.out == 1);
05235         assert(io.in_ready == 0);
05236         assert(io.out_ready == 0);
05237         assert(io.eof_in == 0);
05238         assert(io.eof_out == 0);
05239         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05240         /* assert(io.cbuf == 0x0); */
05241         assert(io.last_read == 0);
05242         assert(io.last_write == 0);
05243         assert(io.total_read == 0);
05244         assert(io.total_write == 0);
05245         assert(io.total_size == 0);
05246         assert(io.total_size_known == 0);
05247         assert(io.timeout == 250000);
05248 
05249         d.display_time = 0;
05250         assert(parse_args(out, argc, argv) == 0);
05251 
05252 #ifdef PRINT_DEBUG
05253         print();
05254 #endif
05255         assert(d.start_time == 0);
05256         assert(d.total_time == 0);
05257         assert(d.current_time == 0);
05258         assert(d.elapsed_time == 0);
05259         assert(d.percent_complete == 0);
05260         assert(d.display_interval == 1);
05261         assert(d.overtime_flag == 0);
05262         assert(d.k == 1024);
05263         assert(d.twiddle == '-');
05264         assert(d.manual_width == 0); 
05265         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05266         assert(d.display_datacount == 1);
05267         assert(d.display_throughput == 1);
05268         assert(d.display_time == 1);
05269         assert(d.display_percent == 1);
05270         assert(d.display_bar == 1);
05271         assert(d.display_summary == 1);
05272         assert(d.display_ansi == 0);
05273         assert(d.twiddle_fg_color == 0);
05274         assert(d.twiddle_bg_color == 0);
05275         assert(d.twiddle_fg_bold == 0);
05276         assert(d.datacount_fg_color == 0);
05277         assert(d.datacount_bg_color == 0);
05278         assert(d.datacount_fg_bold == 0);
05279         assert(d.throughput_label_fg_color == 0);
05280         assert(d.throughput_label_bg_color == 0);
05281         assert(d.throughput_label_fg_bold == 0);
05282         assert(d.throughput_fg_color == 0);
05283         assert(d.throughput_bg_color == 0);
05284         assert(d.throughput_fg_bold == 0);
05285         assert(d.time_label_fg_color == 0);
05286         assert(d.time_label_bg_color == 0);
05287         assert(d.time_label_fg_bold == 0);
05288         assert(d.percent_fg_color == 0);
05289         assert(d.percent_bg_color == 0);
05290         assert(d.percent_fg_bold == 0);
05291         assert(d.barbrace_fg_color == 0);
05292         assert(d.barbrace_bg_color == 0);
05293         assert(d.barbrace_fg_bold == 0);
05294         assert(d.bar_fg_color == 0);
05295         assert(d.bar_bg_color == 0);
05296         assert(d.bar_fg_bold == 0);
05297         assert(io.in == 0);
05298         assert(io.out == 1);
05299         assert(io.in_ready == 0);
05300         assert(io.out_ready == 0);
05301         assert(io.eof_in == 0);
05302         assert(io.eof_out == 0);
05303         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05304         /* assert(io.cbuf == 0x0); */
05305         assert(io.last_read == 0);
05306         assert(io.last_write == 0);
05307         assert(io.total_read == 0);
05308         assert(io.total_write == 0);
05309         assert(io.total_size == 0);
05310         assert(io.total_size_known == 0);
05311         assert(io.timeout == 250000);
05312 }
05313 
05314 void test40(FILE* out)
05315 {
05316         int argc = 0;
05317         char *argv[256] = { 0 };
05318 
05319         argv[argc++] = "ProgramName";
05320         argv[argc++] = "-nt";
05321 
05322         displayInit();
05323         ioInit();
05324 
05325 #ifdef PRINT_DEBUG
05326         print();
05327 #endif
05328         assert(d.start_time == 0);
05329         assert(d.total_time == 0);
05330         assert(d.current_time == 0);
05331         assert(d.elapsed_time == 0);
05332         assert(d.percent_complete == 0);
05333         assert(d.display_interval == 1);
05334         assert(d.overtime_flag == 0);
05335         assert(d.k == 1024);
05336         assert(d.twiddle == '-');
05337         assert(d.manual_width == 0);
05338         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05339         assert(d.display_datacount == 1);
05340         assert(d.display_throughput == 1);
05341         assert(d.display_time == 1);
05342         assert(d.display_percent == 1);
05343         assert(d.display_bar == 1);
05344         assert(d.display_summary == 1);
05345         assert(d.display_ansi == 0);
05346         assert(d.twiddle_fg_color == 0);
05347         assert(d.twiddle_bg_color == 0);
05348         assert(d.twiddle_fg_bold == 0);
05349         assert(d.datacount_fg_color == 0);
05350         assert(d.datacount_bg_color == 0);
05351         assert(d.datacount_fg_bold == 0);
05352         assert(d.throughput_label_fg_color == 0);
05353         assert(d.throughput_label_bg_color == 0);
05354         assert(d.throughput_label_fg_bold == 0);
05355         assert(d.throughput_fg_color == 0);
05356         assert(d.throughput_bg_color == 0);
05357         assert(d.throughput_fg_bold == 0);
05358         assert(d.time_label_fg_color == 0);
05359         assert(d.time_label_bg_color == 0);
05360         assert(d.time_label_fg_bold == 0);
05361         assert(d.percent_fg_color == 0);
05362         assert(d.percent_bg_color == 0);
05363         assert(d.percent_fg_bold == 0);
05364         assert(d.barbrace_fg_color == 0);
05365         assert(d.barbrace_bg_color == 0);
05366         assert(d.barbrace_fg_bold == 0);
05367         assert(d.bar_fg_color == 0);
05368         assert(d.bar_bg_color == 0);
05369         assert(d.bar_fg_bold == 0);
05370         assert(io.in == 0);
05371         assert(io.out == 1);
05372         assert(io.in_ready == 0);
05373         assert(io.out_ready == 0);
05374         assert(io.eof_in == 0);
05375         assert(io.eof_out == 0);
05376         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05377         /* assert(io.cbuf == 0x0); */
05378         assert(io.last_read == 0);
05379         assert(io.last_write == 0);
05380         assert(io.total_read == 0);
05381         assert(io.total_write == 0);
05382         assert(io.total_size == 0);
05383         assert(io.total_size_known == 0);
05384         assert(io.timeout == 250000);
05385 
05386         assert(parse_args(out, argc, argv) == 0);
05387 
05388 #ifdef PRINT_DEBUG
05389         print();
05390 #endif
05391         assert(d.start_time == 0);
05392         assert(d.total_time == 0);
05393         assert(d.current_time == 0);
05394         assert(d.elapsed_time == 0);
05395         assert(d.percent_complete == 0);
05396         assert(d.display_interval == 1);
05397         assert(d.overtime_flag == 0);
05398         assert(d.k == 1024);
05399         assert(d.twiddle == '-');
05400         assert(d.manual_width == 0); 
05401         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05402         assert(d.display_datacount == 1);
05403         assert(d.display_throughput == 1);
05404         assert(d.display_time == 0);
05405         assert(d.display_percent == 1);
05406         assert(d.display_bar == 1);
05407         assert(d.display_summary == 1);
05408         assert(d.display_ansi == 0);
05409         assert(d.twiddle_fg_color == 0);
05410         assert(d.twiddle_bg_color == 0);
05411         assert(d.twiddle_fg_bold == 0);
05412         assert(d.datacount_fg_color == 0);
05413         assert(d.datacount_bg_color == 0);
05414         assert(d.datacount_fg_bold == 0);
05415         assert(d.throughput_label_fg_color == 0);
05416         assert(d.throughput_label_bg_color == 0);
05417         assert(d.throughput_label_fg_bold == 0);
05418         assert(d.throughput_fg_color == 0);
05419         assert(d.throughput_bg_color == 0);
05420         assert(d.throughput_fg_bold == 0);
05421         assert(d.time_label_fg_color == 0);
05422         assert(d.time_label_bg_color == 0);
05423         assert(d.time_label_fg_bold == 0);
05424         assert(d.percent_fg_color == 0);
05425         assert(d.percent_bg_color == 0);
05426         assert(d.percent_fg_bold == 0);
05427         assert(d.barbrace_fg_color == 0);
05428         assert(d.barbrace_bg_color == 0);
05429         assert(d.barbrace_fg_bold == 0);
05430         assert(d.bar_fg_color == 0);
05431         assert(d.bar_bg_color == 0);
05432         assert(d.bar_fg_bold == 0);
05433         assert(io.in == 0);
05434         assert(io.out == 1);
05435         assert(io.in_ready == 0);
05436         assert(io.out_ready == 0);
05437         assert(io.eof_in == 0);
05438         assert(io.eof_out == 0);
05439         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05440         /* assert(io.cbuf == 0x0); */
05441         assert(io.last_read == 0);
05442         assert(io.last_write == 0);
05443         assert(io.total_read == 0);
05444         assert(io.total_write == 0);
05445         assert(io.total_size == 0);
05446         assert(io.total_size_known == 0);
05447         assert(io.timeout == 250000);
05448 }
05449 
05450 void test41(FILE* out)
05451 {
05452         int argc = 0;
05453         char *argv[256] = { 0 };
05454 
05455         argv[argc++] = "ProgramName";
05456         argv[argc++] = "-dp";
05457 
05458         displayInit();
05459         ioInit();
05460 
05461 #ifdef PRINT_DEBUG
05462         print();
05463 #endif
05464         assert(d.start_time == 0);
05465         assert(d.total_time == 0);
05466         assert(d.current_time == 0);
05467         assert(d.elapsed_time == 0);
05468         assert(d.percent_complete == 0);
05469         assert(d.display_interval == 1);
05470         assert(d.overtime_flag == 0);
05471         assert(d.k == 1024);
05472         assert(d.twiddle == '-');
05473         assert(d.manual_width == 0);
05474         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05475         assert(d.display_datacount == 1);
05476         assert(d.display_throughput == 1);
05477         assert(d.display_time == 1);
05478         assert(d.display_percent == 1);
05479         assert(d.display_bar == 1);
05480         assert(d.display_summary == 1);
05481         assert(d.display_ansi == 0);
05482         assert(d.twiddle_fg_color == 0);
05483         assert(d.twiddle_bg_color == 0);
05484         assert(d.twiddle_fg_bold == 0);
05485         assert(d.datacount_fg_color == 0);
05486         assert(d.datacount_bg_color == 0);
05487         assert(d.datacount_fg_bold == 0);
05488         assert(d.throughput_label_fg_color == 0);
05489         assert(d.throughput_label_bg_color == 0);
05490         assert(d.throughput_label_fg_bold == 0);
05491         assert(d.throughput_fg_color == 0);
05492         assert(d.throughput_bg_color == 0);
05493         assert(d.throughput_fg_bold == 0);
05494         assert(d.time_label_fg_color == 0);
05495         assert(d.time_label_bg_color == 0);
05496         assert(d.time_label_fg_bold == 0);
05497         assert(d.percent_fg_color == 0);
05498         assert(d.percent_bg_color == 0);
05499         assert(d.percent_fg_bold == 0);
05500         assert(d.barbrace_fg_color == 0);
05501         assert(d.barbrace_bg_color == 0);
05502         assert(d.barbrace_fg_bold == 0);
05503         assert(d.bar_fg_color == 0);
05504         assert(d.bar_bg_color == 0);
05505         assert(d.bar_fg_bold == 0);
05506         assert(io.in == 0);
05507         assert(io.out == 1);
05508         assert(io.in_ready == 0);
05509         assert(io.out_ready == 0);
05510         assert(io.eof_in == 0);
05511         assert(io.eof_out == 0);
05512         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05513         /* assert(io.cbuf == 0x0); */
05514         assert(io.last_read == 0);
05515         assert(io.last_write == 0);
05516         assert(io.total_read == 0);
05517         assert(io.total_write == 0);
05518         assert(io.total_size == 0);
05519         assert(io.total_size_known == 0);
05520         assert(io.timeout == 250000);
05521 
05522         d.display_percent = 0;
05523         assert(parse_args(out, argc, argv) == 0);
05524 
05525 #ifdef PRINT_DEBUG
05526         print();
05527 #endif
05528         assert(d.start_time == 0);
05529         assert(d.total_time == 0);
05530         assert(d.current_time == 0);
05531         assert(d.elapsed_time == 0);
05532         assert(d.percent_complete == 0);
05533         assert(d.display_interval == 1);
05534         assert(d.overtime_flag == 0);
05535         assert(d.k == 1024);
05536         assert(d.twiddle == '-');
05537         assert(d.manual_width == 0); 
05538         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05539         assert(d.display_datacount == 1);
05540         assert(d.display_throughput == 1);
05541         assert(d.display_time == 1);
05542         assert(d.display_percent == 1);
05543         assert(d.display_bar == 1);
05544         assert(d.display_summary == 1);
05545         assert(d.display_ansi == 0);
05546         assert(d.twiddle_fg_color == 0);
05547         assert(d.twiddle_bg_color == 0);
05548         assert(d.twiddle_fg_bold == 0);
05549         assert(d.datacount_fg_color == 0);
05550         assert(d.datacount_bg_color == 0);
05551         assert(d.datacount_fg_bold == 0);
05552         assert(d.throughput_label_fg_color == 0);
05553         assert(d.throughput_label_bg_color == 0);
05554         assert(d.throughput_label_fg_bold == 0);
05555         assert(d.throughput_fg_color == 0);
05556         assert(d.throughput_bg_color == 0);
05557         assert(d.throughput_fg_bold == 0);
05558         assert(d.time_label_fg_color == 0);
05559         assert(d.time_label_bg_color == 0);
05560         assert(d.time_label_fg_bold == 0);
05561         assert(d.percent_fg_color == 0);
05562         assert(d.percent_bg_color == 0);
05563         assert(d.percent_fg_bold == 0);
05564         assert(d.barbrace_fg_color == 0);
05565         assert(d.barbrace_bg_color == 0);
05566         assert(d.barbrace_fg_bold == 0);
05567         assert(d.bar_fg_color == 0);
05568         assert(d.bar_bg_color == 0);
05569         assert(d.bar_fg_bold == 0);
05570         assert(io.in == 0);
05571         assert(io.out == 1);
05572         assert(io.in_ready == 0);
05573         assert(io.out_ready == 0);
05574         assert(io.eof_in == 0);
05575         assert(io.eof_out == 0);
05576         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05577         /* assert(io.cbuf == 0x0); */
05578         assert(io.last_read == 0);
05579         assert(io.last_write == 0);
05580         assert(io.total_read == 0);
05581         assert(io.total_write == 0);
05582         assert(io.total_size == 0);
05583         assert(io.total_size_known == 0);
05584         assert(io.timeout == 250000);
05585 }
05586 
05587 void test42(FILE* out)
05588 {
05589         int argc = 0;
05590         char *argv[256] = { 0 };
05591 
05592         argv[argc++] = "ProgramName";
05593         argv[argc++] = "-np";
05594 
05595         displayInit();
05596         ioInit();
05597 
05598 #ifdef PRINT_DEBUG
05599         print();
05600 #endif
05601         assert(d.start_time == 0);
05602         assert(d.total_time == 0);
05603         assert(d.current_time == 0);
05604         assert(d.elapsed_time == 0);
05605         assert(d.percent_complete == 0);
05606         assert(d.display_interval == 1);
05607         assert(d.overtime_flag == 0);
05608         assert(d.k == 1024);
05609         assert(d.twiddle == '-');
05610         assert(d.manual_width == 0);
05611         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05612         assert(d.display_datacount == 1);
05613         assert(d.display_throughput == 1);
05614         assert(d.display_time == 1);
05615         assert(d.display_percent == 1);
05616         assert(d.display_bar == 1);
05617         assert(d.display_summary == 1);
05618         assert(d.display_ansi == 0);
05619         assert(d.twiddle_fg_color == 0);
05620         assert(d.twiddle_bg_color == 0);
05621         assert(d.twiddle_fg_bold == 0);
05622         assert(d.datacount_fg_color == 0);
05623         assert(d.datacount_bg_color == 0);
05624         assert(d.datacount_fg_bold == 0);
05625         assert(d.throughput_label_fg_color == 0);
05626         assert(d.throughput_label_bg_color == 0);
05627         assert(d.throughput_label_fg_bold == 0);
05628         assert(d.throughput_fg_color == 0);
05629         assert(d.throughput_bg_color == 0);
05630         assert(d.throughput_fg_bold == 0);
05631         assert(d.time_label_fg_color == 0);
05632         assert(d.time_label_bg_color == 0);
05633         assert(d.time_label_fg_bold == 0);
05634         assert(d.percent_fg_color == 0);
05635         assert(d.percent_bg_color == 0);
05636         assert(d.percent_fg_bold == 0);
05637         assert(d.barbrace_fg_color == 0);
05638         assert(d.barbrace_bg_color == 0);
05639         assert(d.barbrace_fg_bold == 0);
05640         assert(d.bar_fg_color == 0);
05641         assert(d.bar_bg_color == 0);
05642         assert(d.bar_fg_bold == 0);
05643         assert(io.in == 0);
05644         assert(io.out == 1);
05645         assert(io.in_ready == 0);
05646         assert(io.out_ready == 0);
05647         assert(io.eof_in == 0);
05648         assert(io.eof_out == 0);
05649         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05650         /* assert(io.cbuf == 0x0); */
05651         assert(io.last_read == 0);
05652         assert(io.last_write == 0);
05653         assert(io.total_read == 0);
05654         assert(io.total_write == 0);
05655         assert(io.total_size == 0);
05656         assert(io.total_size_known == 0);
05657         assert(io.timeout == 250000);
05658 
05659         assert(parse_args(out, argc, argv) == 0);
05660 
05661 #ifdef PRINT_DEBUG
05662         print();
05663 #endif
05664         assert(d.start_time == 0);
05665         assert(d.total_time == 0);
05666         assert(d.current_time == 0);
05667         assert(d.elapsed_time == 0);
05668         assert(d.percent_complete == 0);
05669         assert(d.display_interval == 1);
05670         assert(d.overtime_flag == 0);
05671         assert(d.k == 1024);
05672         assert(d.twiddle == '-');
05673         assert(d.manual_width == 0); 
05674         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05675         assert(d.display_datacount == 1);
05676         assert(d.display_throughput == 1);
05677         assert(d.display_time == 1);
05678         assert(d.display_percent == 0);
05679         assert(d.display_bar == 1);
05680         assert(d.display_summary == 1);
05681         assert(d.display_ansi == 0);
05682         assert(d.twiddle_fg_color == 0);
05683         assert(d.twiddle_bg_color == 0);
05684         assert(d.twiddle_fg_bold == 0);
05685         assert(d.datacount_fg_color == 0);
05686         assert(d.datacount_bg_color == 0);
05687         assert(d.datacount_fg_bold == 0);
05688         assert(d.throughput_label_fg_color == 0);
05689         assert(d.throughput_label_bg_color == 0);
05690         assert(d.throughput_label_fg_bold == 0);
05691         assert(d.throughput_fg_color == 0);
05692         assert(d.throughput_bg_color == 0);
05693         assert(d.throughput_fg_bold == 0);
05694         assert(d.time_label_fg_color == 0);
05695         assert(d.time_label_bg_color == 0);
05696         assert(d.time_label_fg_bold == 0);
05697         assert(d.percent_fg_color == 0);
05698         assert(d.percent_bg_color == 0);
05699         assert(d.percent_fg_bold == 0);
05700         assert(d.barbrace_fg_color == 0);
05701         assert(d.barbrace_bg_color == 0);
05702         assert(d.barbrace_fg_bold == 0);
05703         assert(d.bar_fg_color == 0);
05704         assert(d.bar_bg_color == 0);
05705         assert(d.bar_fg_bold == 0);
05706         assert(io.in == 0);
05707         assert(io.out == 1);
05708         assert(io.in_ready == 0);
05709         assert(io.out_ready == 0);
05710         assert(io.eof_in == 0);
05711         assert(io.eof_out == 0);
05712         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05713         /* assert(io.cbuf == 0x0); */
05714         assert(io.last_read == 0);
05715         assert(io.last_write == 0);
05716         assert(io.total_read == 0);
05717         assert(io.total_write == 0);
05718         assert(io.total_size == 0);
05719         assert(io.total_size_known == 0);
05720         assert(io.timeout == 250000);
05721 }
05722 
05723 void test43(FILE* out)
05724 {
05725         int argc = 0;
05726         char *argv[256] = { 0 };
05727 
05728         argv[argc++] = "ProgramName";
05729         argv[argc++] = "-db";
05730 
05731         displayInit();
05732         ioInit();
05733 
05734 #ifdef PRINT_DEBUG
05735         print();
05736 #endif
05737         assert(d.start_time == 0);
05738         assert(d.total_time == 0);
05739         assert(d.current_time == 0);
05740         assert(d.elapsed_time == 0);
05741         assert(d.percent_complete == 0);
05742         assert(d.display_interval == 1);
05743         assert(d.overtime_flag == 0);
05744         assert(d.k == 1024);
05745         assert(d.twiddle == '-');
05746         assert(d.manual_width == 0);
05747         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05748         assert(d.display_datacount == 1);
05749         assert(d.display_throughput == 1);
05750         assert(d.display_time == 1);
05751         assert(d.display_percent == 1);
05752         assert(d.display_bar == 1);
05753         assert(d.display_summary == 1);
05754         assert(d.display_ansi == 0);
05755         assert(d.twiddle_fg_color == 0);
05756         assert(d.twiddle_bg_color == 0);
05757         assert(d.twiddle_fg_bold == 0);
05758         assert(d.datacount_fg_color == 0);
05759         assert(d.datacount_bg_color == 0);
05760         assert(d.datacount_fg_bold == 0);
05761         assert(d.throughput_label_fg_color == 0);
05762         assert(d.throughput_label_bg_color == 0);
05763         assert(d.throughput_label_fg_bold == 0);
05764         assert(d.throughput_fg_color == 0);
05765         assert(d.throughput_bg_color == 0);
05766         assert(d.throughput_fg_bold == 0);
05767         assert(d.time_label_fg_color == 0);
05768         assert(d.time_label_bg_color == 0);
05769         assert(d.time_label_fg_bold == 0);
05770         assert(d.percent_fg_color == 0);
05771         assert(d.percent_bg_color == 0);
05772         assert(d.percent_fg_bold == 0);
05773         assert(d.barbrace_fg_color == 0);
05774         assert(d.barbrace_bg_color == 0);
05775         assert(d.barbrace_fg_bold == 0);
05776         assert(d.bar_fg_color == 0);
05777         assert(d.bar_bg_color == 0);
05778         assert(d.bar_fg_bold == 0);
05779         assert(io.in == 0);
05780         assert(io.out == 1);
05781         assert(io.in_ready == 0);
05782         assert(io.out_ready == 0);
05783         assert(io.eof_in == 0);
05784         assert(io.eof_out == 0);
05785         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05786         /* assert(io.cbuf == 0x0); */
05787         assert(io.last_read == 0);
05788         assert(io.last_write == 0);
05789         assert(io.total_read == 0);
05790         assert(io.total_write == 0);
05791         assert(io.total_size == 0);
05792         assert(io.total_size_known == 0);
05793         assert(io.timeout == 250000);
05794 
05795         d.display_bar = 0;
05796         assert(parse_args(out, argc, argv) == 0);
05797 
05798 #ifdef PRINT_DEBUG
05799         print();
05800 #endif
05801         assert(d.start_time == 0);
05802         assert(d.total_time == 0);
05803         assert(d.current_time == 0);
05804         assert(d.elapsed_time == 0);
05805         assert(d.percent_complete == 0);
05806         assert(d.display_interval == 1);
05807         assert(d.overtime_flag == 0);
05808         assert(d.k == 1024);
05809         assert(d.twiddle == '-');
05810         assert(d.manual_width == 0); 
05811         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05812         assert(d.display_datacount == 1);
05813         assert(d.display_throughput == 1);
05814         assert(d.display_time == 1);
05815         assert(d.display_percent == 1);
05816         assert(d.display_bar == 1);
05817         assert(d.display_summary == 1);
05818         assert(d.display_ansi == 0);
05819         assert(d.twiddle_fg_color == 0);
05820         assert(d.twiddle_bg_color == 0);
05821         assert(d.twiddle_fg_bold == 0);
05822         assert(d.datacount_fg_color == 0);
05823         assert(d.datacount_bg_color == 0);
05824         assert(d.datacount_fg_bold == 0);
05825         assert(d.throughput_label_fg_color == 0);
05826         assert(d.throughput_label_bg_color == 0);
05827         assert(d.throughput_label_fg_bold == 0);
05828         assert(d.throughput_fg_color == 0);
05829         assert(d.throughput_bg_color == 0);
05830         assert(d.throughput_fg_bold == 0);
05831         assert(d.time_label_fg_color == 0);
05832         assert(d.time_label_bg_color == 0);
05833         assert(d.time_label_fg_bold == 0);
05834         assert(d.percent_fg_color == 0);
05835         assert(d.percent_bg_color == 0);
05836         assert(d.percent_fg_bold == 0);
05837         assert(d.barbrace_fg_color == 0);
05838         assert(d.barbrace_bg_color == 0);
05839         assert(d.barbrace_fg_bold == 0);
05840         assert(d.bar_fg_color == 0);
05841         assert(d.bar_bg_color == 0);
05842         assert(d.bar_fg_bold == 0);
05843         assert(io.in == 0);
05844         assert(io.out == 1);
05845         assert(io.in_ready == 0);
05846         assert(io.out_ready == 0);
05847         assert(io.eof_in == 0);
05848         assert(io.eof_out == 0);
05849         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05850         /* assert(io.cbuf == 0x0); */
05851         assert(io.last_read == 0);
05852         assert(io.last_write == 0);
05853         assert(io.total_read == 0);
05854         assert(io.total_write == 0);
05855         assert(io.total_size == 0);
05856         assert(io.total_size_known == 0);
05857         assert(io.timeout == 250000);
05858 }
05859 
05860 void test44(FILE* out)
05861 {
05862         int argc = 0;
05863         char *argv[256] = { 0 };
05864 
05865         argv[argc++] = "ProgramName";
05866         argv[argc++] = "-nb";
05867 
05868         displayInit();
05869         ioInit();
05870 
05871 #ifdef PRINT_DEBUG
05872         print();
05873 #endif
05874         assert(d.start_time == 0);
05875         assert(d.total_time == 0);
05876         assert(d.current_time == 0);
05877         assert(d.elapsed_time == 0);
05878         assert(d.percent_complete == 0);
05879         assert(d.display_interval == 1);
05880         assert(d.overtime_flag == 0);
05881         assert(d.k == 1024);
05882         assert(d.twiddle == '-');
05883         assert(d.manual_width == 0);
05884         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05885         assert(d.display_datacount == 1);
05886         assert(d.display_throughput == 1);
05887         assert(d.display_time == 1);
05888         assert(d.display_percent == 1);
05889         assert(d.display_bar == 1);
05890         assert(d.display_summary == 1);
05891         assert(d.display_ansi == 0);
05892         assert(d.twiddle_fg_color == 0);
05893         assert(d.twiddle_bg_color == 0);
05894         assert(d.twiddle_fg_bold == 0);
05895         assert(d.datacount_fg_color == 0);
05896         assert(d.datacount_bg_color == 0);
05897         assert(d.datacount_fg_bold == 0);
05898         assert(d.throughput_label_fg_color == 0);
05899         assert(d.throughput_label_bg_color == 0);
05900         assert(d.throughput_label_fg_bold == 0);
05901         assert(d.throughput_fg_color == 0);
05902         assert(d.throughput_bg_color == 0);
05903         assert(d.throughput_fg_bold == 0);
05904         assert(d.time_label_fg_color == 0);
05905         assert(d.time_label_bg_color == 0);
05906         assert(d.time_label_fg_bold == 0);
05907         assert(d.percent_fg_color == 0);
05908         assert(d.percent_bg_color == 0);
05909         assert(d.percent_fg_bold == 0);
05910         assert(d.barbrace_fg_color == 0);
05911         assert(d.barbrace_bg_color == 0);
05912         assert(d.barbrace_fg_bold == 0);
05913         assert(d.bar_fg_color == 0);
05914         assert(d.bar_bg_color == 0);
05915         assert(d.bar_fg_bold == 0);
05916         assert(io.in == 0);
05917         assert(io.out == 1);
05918         assert(io.in_ready == 0);
05919         assert(io.out_ready == 0);
05920         assert(io.eof_in == 0);
05921         assert(io.eof_out == 0);
05922         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05923         /* assert(io.cbuf == 0x0); */
05924         assert(io.last_read == 0);
05925         assert(io.last_write == 0);
05926         assert(io.total_read == 0);
05927         assert(io.total_write == 0);
05928         assert(io.total_size == 0);
05929         assert(io.total_size_known == 0);
05930         assert(io.timeout == 250000);
05931 
05932         assert(parse_args(out, argc, argv) == 0);
05933 
05934 #ifdef PRINT_DEBUG
05935         print();
05936 #endif
05937         assert(d.start_time == 0);
05938         assert(d.total_time == 0);
05939         assert(d.current_time == 0);
05940         assert(d.elapsed_time == 0);
05941         assert(d.percent_complete == 0);
05942         assert(d.display_interval == 1);
05943         assert(d.overtime_flag == 0);
05944         assert(d.k == 1024);
05945         assert(d.twiddle == '-');
05946         assert(d.manual_width == 0); 
05947         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
05948         assert(d.display_datacount == 1);
05949         assert(d.display_throughput == 1);
05950         assert(d.display_time == 1);
05951         assert(d.display_percent == 1);
05952         assert(d.display_bar == 0);
05953         assert(d.display_summary == 1);
05954         assert(d.display_ansi == 0);
05955         assert(d.twiddle_fg_color == 0);
05956         assert(d.twiddle_bg_color == 0);
05957         assert(d.twiddle_fg_bold == 0);
05958         assert(d.datacount_fg_color == 0);
05959         assert(d.datacount_bg_color == 0);
05960         assert(d.datacount_fg_bold == 0);
05961         assert(d.throughput_label_fg_color == 0);
05962         assert(d.throughput_label_bg_color == 0);
05963         assert(d.throughput_label_fg_bold == 0);
05964         assert(d.throughput_fg_color == 0);
05965         assert(d.throughput_bg_color == 0);
05966         assert(d.throughput_fg_bold == 0);
05967         assert(d.time_label_fg_color == 0);
05968         assert(d.time_label_bg_color == 0);
05969         assert(d.time_label_fg_bold == 0);
05970         assert(d.percent_fg_color == 0);
05971         assert(d.percent_bg_color == 0);
05972         assert(d.percent_fg_bold == 0);
05973         assert(d.barbrace_fg_color == 0);
05974         assert(d.barbrace_bg_color == 0);
05975         assert(d.barbrace_fg_bold == 0);
05976         assert(d.bar_fg_color == 0);
05977         assert(d.bar_bg_color == 0);
05978         assert(d.bar_fg_bold == 0);
05979         assert(io.in == 0);
05980         assert(io.out == 1);
05981         assert(io.in_ready == 0);
05982         assert(io.out_ready == 0);
05983         assert(io.eof_in == 0);
05984         assert(io.eof_out == 0);
05985         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
05986         /* assert(io.cbuf == 0x0); */
05987         assert(io.last_read == 0);
05988         assert(io.last_write == 0);
05989         assert(io.total_read == 0);
05990         assert(io.total_write == 0);
05991         assert(io.total_size == 0);
05992         assert(io.total_size_known == 0);
05993         assert(io.timeout == 250000);
05994 }
05995 
05996 void test45(FILE* out)
05997 {
05998         int argc = 0;
05999         char *argv[256] = { 0 };
06000 
06001         argv[argc++] = "ProgramName";
06002         argv[argc++] = "-ds";
06003 
06004         displayInit();
06005         ioInit();
06006 
06007 #ifdef PRINT_DEBUG
06008         print();
06009 #endif
06010         assert(d.start_time == 0);
06011         assert(d.total_time == 0);
06012         assert(d.current_time == 0);
06013         assert(d.elapsed_time == 0);
06014         assert(d.percent_complete == 0);
06015         assert(d.display_interval == 1);
06016         assert(d.overtime_flag == 0);
06017         assert(d.k == 1024);
06018         assert(d.twiddle == '-');
06019         assert(d.manual_width == 0);
06020         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06021         assert(d.display_datacount == 1);
06022         assert(d.display_throughput == 1);
06023         assert(d.display_time == 1);
06024         assert(d.display_percent == 1);
06025         assert(d.display_bar == 1);
06026         assert(d.display_summary == 1);
06027         assert(d.display_ansi == 0);
06028         assert(d.twiddle_fg_color == 0);
06029         assert(d.twiddle_bg_color == 0);
06030         assert(d.twiddle_fg_bold == 0);
06031         assert(d.datacount_fg_color == 0);
06032         assert(d.datacount_bg_color == 0);
06033         assert(d.datacount_fg_bold == 0);
06034         assert(d.throughput_label_fg_color == 0);
06035         assert(d.throughput_label_bg_color == 0);
06036         assert(d.throughput_label_fg_bold == 0);
06037         assert(d.throughput_fg_color == 0);
06038         assert(d.throughput_bg_color == 0);
06039         assert(d.throughput_fg_bold == 0);
06040         assert(d.time_label_fg_color == 0);
06041         assert(d.time_label_bg_color == 0);
06042         assert(d.time_label_fg_bold == 0);
06043         assert(d.percent_fg_color == 0);
06044         assert(d.percent_bg_color == 0);
06045         assert(d.percent_fg_bold == 0);
06046         assert(d.barbrace_fg_color == 0);
06047         assert(d.barbrace_bg_color == 0);
06048         assert(d.barbrace_fg_bold == 0);
06049         assert(d.bar_fg_color == 0);
06050         assert(d.bar_bg_color == 0);
06051         assert(d.bar_fg_bold == 0);
06052         assert(io.in == 0);
06053         assert(io.out == 1);
06054         assert(io.in_ready == 0);
06055         assert(io.out_ready == 0);
06056         assert(io.eof_in == 0);
06057         assert(io.eof_out == 0);
06058         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06059         /* assert(io.cbuf == 0x0); */
06060         assert(io.last_read == 0);
06061         assert(io.last_write == 0);
06062         assert(io.total_read == 0);
06063         assert(io.total_write == 0);
06064         assert(io.total_size == 0);
06065         assert(io.total_size_known == 0);
06066         assert(io.timeout == 250000);
06067 
06068         d.display_summary = 0;
06069         assert(parse_args(out, argc, argv) == 0);
06070 
06071 #ifdef PRINT_DEBUG
06072         print();
06073 #endif
06074         assert(d.start_time == 0);
06075         assert(d.total_time == 0);
06076         assert(d.current_time == 0);
06077         assert(d.elapsed_time == 0);
06078         assert(d.percent_complete == 0);
06079         assert(d.display_interval == 1);
06080         assert(d.overtime_flag == 0);
06081         assert(d.k == 1024);
06082         assert(d.twiddle == '-');
06083         assert(d.manual_width == 0); 
06084         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06085         assert(d.display_datacount == 1);
06086         assert(d.display_throughput == 1);
06087         assert(d.display_time == 1);
06088         assert(d.display_percent == 1);
06089         assert(d.display_bar == 1);
06090         assert(d.display_summary == 1);
06091         assert(d.display_ansi == 0);
06092         assert(d.twiddle_fg_color == 0);
06093         assert(d.twiddle_bg_color == 0);
06094         assert(d.twiddle_fg_bold == 0);
06095         assert(d.datacount_fg_color == 0);
06096         assert(d.datacount_bg_color == 0);
06097         assert(d.datacount_fg_bold == 0);
06098         assert(d.throughput_label_fg_color == 0);
06099         assert(d.throughput_label_bg_color == 0);
06100         assert(d.throughput_label_fg_bold == 0);
06101         assert(d.throughput_fg_color == 0);
06102         assert(d.throughput_bg_color == 0);
06103         assert(d.throughput_fg_bold == 0);
06104         assert(d.time_label_fg_color == 0);
06105         assert(d.time_label_bg_color == 0);
06106         assert(d.time_label_fg_bold == 0);
06107         assert(d.percent_fg_color == 0);
06108         assert(d.percent_bg_color == 0);
06109         assert(d.percent_fg_bold == 0);
06110         assert(d.barbrace_fg_color == 0);
06111         assert(d.barbrace_bg_color == 0);
06112         assert(d.barbrace_fg_bold == 0);
06113         assert(d.bar_fg_color == 0);
06114         assert(d.bar_bg_color == 0);
06115         assert(d.bar_fg_bold == 0);
06116         assert(io.in == 0);
06117         assert(io.out == 1);
06118         assert(io.in_ready == 0);
06119         assert(io.out_ready == 0);
06120         assert(io.eof_in == 0);
06121         assert(io.eof_out == 0);
06122         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06123         /* assert(io.cbuf == 0x0); */
06124         assert(io.last_read == 0);
06125         assert(io.last_write == 0);
06126         assert(io.total_read == 0);
06127         assert(io.total_write == 0);
06128         assert(io.total_size == 0);
06129         assert(io.total_size_known == 0);
06130         assert(io.timeout == 250000);
06131 }
06132 
06133 void test46(FILE* out)
06134 {
06135         int argc = 0;
06136         char *argv[256] = { 0 };
06137 
06138         argv[argc++] = "ProgramName";
06139         argv[argc++] = "-ns";
06140 
06141         displayInit();
06142         ioInit();
06143 
06144 #ifdef PRINT_DEBUG
06145         print();
06146 #endif
06147         assert(d.start_time == 0);
06148         assert(d.total_time == 0);
06149         assert(d.current_time == 0);
06150         assert(d.elapsed_time == 0);
06151         assert(d.percent_complete == 0);
06152         assert(d.display_interval == 1);
06153         assert(d.overtime_flag == 0);
06154         assert(d.k == 1024);
06155         assert(d.twiddle == '-');
06156         assert(d.manual_width == 0);
06157         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06158         assert(d.display_datacount == 1);
06159         assert(d.display_throughput == 1);
06160         assert(d.display_time == 1);
06161         assert(d.display_percent == 1);
06162         assert(d.display_bar == 1);
06163         assert(d.display_summary == 1);
06164         assert(d.display_ansi == 0);
06165         assert(d.twiddle_fg_color == 0);
06166         assert(d.twiddle_bg_color == 0);
06167         assert(d.twiddle_fg_bold == 0);
06168         assert(d.datacount_fg_color == 0);
06169         assert(d.datacount_bg_color == 0);
06170         assert(d.datacount_fg_bold == 0);
06171         assert(d.throughput_label_fg_color == 0);
06172         assert(d.throughput_label_bg_color == 0);
06173         assert(d.throughput_label_fg_bold == 0);
06174         assert(d.throughput_fg_color == 0);
06175         assert(d.throughput_bg_color == 0);
06176         assert(d.throughput_fg_bold == 0);
06177         assert(d.time_label_fg_color == 0);
06178         assert(d.time_label_bg_color == 0);
06179         assert(d.time_label_fg_bold == 0);
06180         assert(d.percent_fg_color == 0);
06181         assert(d.percent_bg_color == 0);
06182         assert(d.percent_fg_bold == 0);
06183         assert(d.barbrace_fg_color == 0);
06184         assert(d.barbrace_bg_color == 0);
06185         assert(d.barbrace_fg_bold == 0);
06186         assert(d.bar_fg_color == 0);
06187         assert(d.bar_bg_color == 0);
06188         assert(d.bar_fg_bold == 0);
06189         assert(io.in == 0);
06190         assert(io.out == 1);
06191         assert(io.in_ready == 0);
06192         assert(io.out_ready == 0);
06193         assert(io.eof_in == 0);
06194         assert(io.eof_out == 0);
06195         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06196         /* assert(io.cbuf == 0x0); */
06197         assert(io.last_read == 0);
06198         assert(io.last_write == 0);
06199         assert(io.total_read == 0);
06200         assert(io.total_write == 0);
06201         assert(io.total_size == 0);
06202         assert(io.total_size_known == 0);
06203         assert(io.timeout == 250000);
06204 
06205         assert(parse_args(out, argc, argv) == 0);
06206 
06207 #ifdef PRINT_DEBUG
06208         print();
06209 #endif
06210         assert(d.start_time == 0);
06211         assert(d.total_time == 0);
06212         assert(d.current_time == 0);
06213         assert(d.elapsed_time == 0);
06214         assert(d.percent_complete == 0);
06215         assert(d.display_interval == 1);
06216         assert(d.overtime_flag == 0);
06217         assert(d.k == 1024);
06218         assert(d.twiddle == '-');
06219         assert(d.manual_width == 0); 
06220         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06221         assert(d.display_datacount == 1);
06222         assert(d.display_throughput == 1);
06223         assert(d.display_time == 1);
06224         assert(d.display_percent == 1);
06225         assert(d.display_bar == 1);
06226         assert(d.display_summary == 0);
06227         assert(d.display_ansi == 0);
06228         assert(d.twiddle_fg_color == 0);
06229         assert(d.twiddle_bg_color == 0);
06230         assert(d.twiddle_fg_bold == 0);
06231         assert(d.datacount_fg_color == 0);
06232         assert(d.datacount_bg_color == 0);
06233         assert(d.datacount_fg_bold == 0);
06234         assert(d.throughput_label_fg_color == 0);
06235         assert(d.throughput_label_bg_color == 0);
06236         assert(d.throughput_label_fg_bold == 0);
06237         assert(d.throughput_fg_color == 0);
06238         assert(d.throughput_bg_color == 0);
06239         assert(d.throughput_fg_bold == 0);
06240         assert(d.time_label_fg_color == 0);
06241         assert(d.time_label_bg_color == 0);
06242         assert(d.time_label_fg_bold == 0);
06243         assert(d.percent_fg_color == 0);
06244         assert(d.percent_bg_color == 0);
06245         assert(d.percent_fg_bold == 0);
06246         assert(d.barbrace_fg_color == 0);
06247         assert(d.barbrace_bg_color == 0);
06248         assert(d.barbrace_fg_bold == 0);
06249         assert(d.bar_fg_color == 0);
06250         assert(d.bar_bg_color == 0);
06251         assert(d.bar_fg_bold == 0);
06252         assert(io.in == 0);
06253         assert(io.out == 1);
06254         assert(io.in_ready == 0);
06255         assert(io.out_ready == 0);
06256         assert(io.eof_in == 0);
06257         assert(io.eof_out == 0);
06258         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06259         /* assert(io.cbuf == 0x0); */
06260         assert(io.last_read == 0);
06261         assert(io.last_write == 0);
06262         assert(io.total_read == 0);
06263         assert(io.total_write == 0);
06264         assert(io.total_size == 0);
06265         assert(io.total_size_known == 0);
06266         assert(io.timeout == 250000);
06267 }
06268 
06269 void test47(FILE* out)
06270 {
06271         int argc = 0;
06272         char *argv[256] = { 0 };
06273 
06274         argv[argc++] = "ProgramName";
06275         argv[argc++] = "-da";
06276 
06277         displayInit();
06278         ioInit();
06279 
06280 #ifdef PRINT_DEBUG
06281         print();
06282 #endif
06283         assert(d.start_time == 0);
06284         assert(d.total_time == 0);
06285         assert(d.current_time == 0);
06286         assert(d.elapsed_time == 0);
06287         assert(d.percent_complete == 0);
06288         assert(d.display_interval == 1);
06289         assert(d.overtime_flag == 0);
06290         assert(d.k == 1024);
06291         assert(d.twiddle == '-');
06292         assert(d.manual_width == 0);
06293         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06294         assert(d.display_datacount == 1);
06295         assert(d.display_throughput == 1);
06296         assert(d.display_time == 1);
06297         assert(d.display_percent == 1);
06298         assert(d.display_bar == 1);
06299         assert(d.display_summary == 1);
06300         assert(d.display_ansi == 0);
06301         assert(d.twiddle_fg_color == 0);
06302         assert(d.twiddle_bg_color == 0);
06303         assert(d.twiddle_fg_bold == 0);
06304         assert(d.datacount_fg_color == 0);
06305         assert(d.datacount_bg_color == 0);
06306         assert(d.datacount_fg_bold == 0);
06307         assert(d.throughput_label_fg_color == 0);
06308         assert(d.throughput_label_bg_color == 0);
06309         assert(d.throughput_label_fg_bold == 0);
06310         assert(d.throughput_fg_color == 0);
06311         assert(d.throughput_bg_color == 0);
06312         assert(d.throughput_fg_bold == 0);
06313         assert(d.time_label_fg_color == 0);
06314         assert(d.time_label_bg_color == 0);
06315         assert(d.time_label_fg_bold == 0);
06316         assert(d.percent_fg_color == 0);
06317         assert(d.percent_bg_color == 0);
06318         assert(d.percent_fg_bold == 0);
06319         assert(d.barbrace_fg_color == 0);
06320         assert(d.barbrace_bg_color == 0);
06321         assert(d.barbrace_fg_bold == 0);
06322         assert(d.bar_fg_color == 0);
06323         assert(d.bar_bg_color == 0);
06324         assert(d.bar_fg_bold == 0);
06325         assert(io.in == 0);
06326         assert(io.out == 1);
06327         assert(io.in_ready == 0);
06328         assert(io.out_ready == 0);
06329         assert(io.eof_in == 0);
06330         assert(io.eof_out == 0);
06331         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06332         /* assert(io.cbuf == 0x0); */
06333         assert(io.last_read == 0);
06334         assert(io.last_write == 0);
06335         assert(io.total_read == 0);
06336         assert(io.total_write == 0);
06337         assert(io.total_size == 0);
06338         assert(io.total_size_known == 0);
06339         assert(io.timeout == 250000);
06340 
06341         d.display_twiddle = 0;
06342         d.display_datacount = 0;
06343         d.display_throughput = 0;
06344         d.display_time = 0;
06345         d.display_percent = 0;
06346         d.display_bar = 0;
06347         d.display_summary = 0;
06348         assert(parse_args(out, argc, argv) == 0);
06349 
06350 #ifdef PRINT_DEBUG
06351         print();
06352 #endif
06353         assert(d.start_time == 0);
06354         assert(d.total_time == 0);
06355         assert(d.current_time == 0);
06356         assert(d.elapsed_time == 0);
06357         assert(d.percent_complete == 0);
06358         assert(d.display_interval == 1);
06359         assert(d.overtime_flag == 0);
06360         assert(d.k == 1024);
06361         assert(d.twiddle == '-');
06362         assert(d.manual_width == 0); 
06363         assert(d.display_twiddle == 1);
06364         assert(d.display_datacount == 1);
06365         assert(d.display_throughput == 1);
06366         assert(d.display_time == 1);
06367         assert(d.display_percent == 1);
06368         assert(d.display_bar == 1);
06369         assert(d.display_summary == 1);
06370         assert(d.display_ansi == 0);
06371         assert(d.twiddle_fg_color == 0);
06372         assert(d.twiddle_bg_color == 0);
06373         assert(d.twiddle_fg_bold == 0);
06374         assert(d.datacount_fg_color == 0);
06375         assert(d.datacount_bg_color == 0);
06376         assert(d.datacount_fg_bold == 0);
06377         assert(d.throughput_label_fg_color == 0);
06378         assert(d.throughput_label_bg_color == 0);
06379         assert(d.throughput_label_fg_bold == 0);
06380         assert(d.throughput_fg_color == 0);
06381         assert(d.throughput_bg_color == 0);
06382         assert(d.throughput_fg_bold == 0);
06383         assert(d.time_label_fg_color == 0);
06384         assert(d.time_label_bg_color == 0);
06385         assert(d.time_label_fg_bold == 0);
06386         assert(d.percent_fg_color == 0);
06387         assert(d.percent_bg_color == 0);
06388         assert(d.percent_fg_bold == 0);
06389         assert(d.barbrace_fg_color == 0);
06390         assert(d.barbrace_bg_color == 0);
06391         assert(d.barbrace_fg_bold == 0);
06392         assert(d.bar_fg_color == 0);
06393         assert(d.bar_bg_color == 0);
06394         assert(d.bar_fg_bold == 0);
06395         assert(io.in == 0);
06396         assert(io.out == 1);
06397         assert(io.in_ready == 0);
06398         assert(io.out_ready == 0);
06399         assert(io.eof_in == 0);
06400         assert(io.eof_out == 0);
06401         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06402         /* assert(io.cbuf == 0x0); */
06403         assert(io.last_read == 0);
06404         assert(io.last_write == 0);
06405         assert(io.total_read == 0);
06406         assert(io.total_write == 0);
06407         assert(io.total_size == 0);
06408         assert(io.total_size_known == 0);
06409         assert(io.timeout == 250000);
06410 }
06411 
06412 void test48(FILE* out)
06413 {
06414         int argc = 0;
06415         char *argv[256] = { 0 };
06416 
06417         argv[argc++] = "ProgramName";
06418         argv[argc++] = "-dn";
06419 
06420         displayInit();
06421         ioInit();
06422 
06423 #ifdef PRINT_DEBUG
06424         print();
06425 #endif
06426         assert(d.start_time == 0);
06427         assert(d.total_time == 0);
06428         assert(d.current_time == 0);
06429         assert(d.elapsed_time == 0);
06430         assert(d.percent_complete == 0);
06431         assert(d.display_interval == 1);
06432         assert(d.overtime_flag == 0);
06433         assert(d.k == 1024);
06434         assert(d.twiddle == '-');
06435         assert(d.manual_width == 0);
06436         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06437         assert(d.display_datacount == 1);
06438         assert(d.display_throughput == 1);
06439         assert(d.display_time == 1);
06440         assert(d.display_percent == 1);
06441         assert(d.display_bar == 1);
06442         assert(d.display_summary == 1);
06443         assert(d.display_ansi == 0);
06444         assert(d.twiddle_fg_color == 0);
06445         assert(d.twiddle_bg_color == 0);
06446         assert(d.twiddle_fg_bold == 0);
06447         assert(d.datacount_fg_color == 0);
06448         assert(d.datacount_bg_color == 0);
06449         assert(d.datacount_fg_bold == 0);
06450         assert(d.throughput_label_fg_color == 0);
06451         assert(d.throughput_label_bg_color == 0);
06452         assert(d.throughput_label_fg_bold == 0);
06453         assert(d.throughput_fg_color == 0);
06454         assert(d.throughput_bg_color == 0);
06455         assert(d.throughput_fg_bold == 0);
06456         assert(d.time_label_fg_color == 0);
06457         assert(d.time_label_bg_color == 0);
06458         assert(d.time_label_fg_bold == 0);
06459         assert(d.percent_fg_color == 0);
06460         assert(d.percent_bg_color == 0);
06461         assert(d.percent_fg_bold == 0);
06462         assert(d.barbrace_fg_color == 0);
06463         assert(d.barbrace_bg_color == 0);
06464         assert(d.barbrace_fg_bold == 0);
06465         assert(d.bar_fg_color == 0);
06466         assert(d.bar_bg_color == 0);
06467         assert(d.bar_fg_bold == 0);
06468         assert(io.in == 0);
06469         assert(io.out == 1);
06470         assert(io.in_ready == 0);
06471         assert(io.out_ready == 0);
06472         assert(io.eof_in == 0);
06473         assert(io.eof_out == 0);
06474         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06475         /* assert(io.cbuf == 0x0); */
06476         assert(io.last_read == 0);
06477         assert(io.last_write == 0);
06478         assert(io.total_read == 0);
06479         assert(io.total_write == 0);
06480         assert(io.total_size == 0);
06481         assert(io.total_size_known == 0);
06482         assert(io.timeout == 250000);
06483 
06484         assert(parse_args(out, argc, argv) == 0);
06485 
06486 #ifdef PRINT_DEBUG
06487         print();
06488 #endif
06489         assert(d.start_time == 0);
06490         assert(d.total_time == 0);
06491         assert(d.current_time == 0);
06492         assert(d.elapsed_time == 0);
06493         assert(d.percent_complete == 0);
06494         assert(d.display_interval == 1);
06495         assert(d.overtime_flag == 0);
06496         assert(d.k == 1024);
06497         assert(d.twiddle == '-');
06498         assert(d.manual_width == 0); 
06499         assert(d.display_twiddle == 0);
06500         assert(d.display_datacount == 0);
06501         assert(d.display_throughput == 0);
06502         assert(d.display_time == 0);
06503         assert(d.display_percent == 0);
06504         assert(d.display_bar == 0);
06505         assert(d.display_summary == 0);
06506         assert(d.display_ansi == 0);
06507         assert(d.twiddle_fg_color == 0);
06508         assert(d.twiddle_bg_color == 0);
06509         assert(d.twiddle_fg_bold == 0);
06510         assert(d.datacount_fg_color == 0);
06511         assert(d.datacount_bg_color == 0);
06512         assert(d.datacount_fg_bold == 0);
06513         assert(d.throughput_label_fg_color == 0);
06514         assert(d.throughput_label_bg_color == 0);
06515         assert(d.throughput_label_fg_bold == 0);
06516         assert(d.throughput_fg_color == 0);
06517         assert(d.throughput_bg_color == 0);
06518         assert(d.throughput_fg_bold == 0);
06519         assert(d.time_label_fg_color == 0);
06520         assert(d.time_label_bg_color == 0);
06521         assert(d.time_label_fg_bold == 0);
06522         assert(d.percent_fg_color == 0);
06523         assert(d.percent_bg_color == 0);
06524         assert(d.percent_fg_bold == 0);
06525         assert(d.barbrace_fg_color == 0);
06526         assert(d.barbrace_bg_color == 0);
06527         assert(d.barbrace_fg_bold == 0);
06528         assert(d.bar_fg_color == 0);
06529         assert(d.bar_bg_color == 0);
06530         assert(d.bar_fg_bold == 0);
06531         assert(io.in == 0);
06532         assert(io.out == 1);
06533         assert(io.in_ready == 0);
06534         assert(io.out_ready == 0);
06535         assert(io.eof_in == 0);
06536         assert(io.eof_out == 0);
06537         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06538         /* assert(io.cbuf == 0x0); */
06539         assert(io.last_read == 0);
06540         assert(io.last_write == 0);
06541         assert(io.total_read == 0);
06542         assert(io.total_write == 0);
06543         assert(io.total_size == 0);
06544         assert(io.total_size_known == 0);
06545         assert(io.timeout == 250000);
06546 }
06547 
06548 void test49(FILE* out)
06549 {
06550         int argc = 0;
06551         char *argv[256] = { 0 };
06552 
06553         argv[argc++] = "ProgramName";
06554         argv[argc++] = "--in-file";
06555 
06556         displayInit();
06557         ioInit();
06558 
06559 #ifdef PRINT_DEBUG
06560         print();
06561 #endif
06562         assert(d.start_time == 0);
06563         assert(d.total_time == 0);
06564         assert(d.current_time == 0);
06565         assert(d.elapsed_time == 0);
06566         assert(d.percent_complete == 0);
06567         assert(d.display_interval == 1);
06568         assert(d.overtime_flag == 0);
06569         assert(d.k == 1024);
06570         assert(d.twiddle == '-');
06571         assert(d.manual_width == 0);
06572         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06573         assert(d.display_datacount == 1);
06574         assert(d.display_throughput == 1);
06575         assert(d.display_time == 1);
06576         assert(d.display_percent == 1);
06577         assert(d.display_bar == 1);
06578         assert(d.display_summary == 1);
06579         assert(d.display_ansi == 0);
06580         assert(d.twiddle_fg_color == 0);
06581         assert(d.twiddle_bg_color == 0);
06582         assert(d.twiddle_fg_bold == 0);
06583         assert(d.datacount_fg_color == 0);
06584         assert(d.datacount_bg_color == 0);
06585         assert(d.datacount_fg_bold == 0);
06586         assert(d.throughput_label_fg_color == 0);
06587         assert(d.throughput_label_bg_color == 0);
06588         assert(d.throughput_label_fg_bold == 0);
06589         assert(d.throughput_fg_color == 0);
06590         assert(d.throughput_bg_color == 0);
06591         assert(d.throughput_fg_bold == 0);
06592         assert(d.time_label_fg_color == 0);
06593         assert(d.time_label_bg_color == 0);
06594         assert(d.time_label_fg_bold == 0);
06595         assert(d.percent_fg_color == 0);
06596         assert(d.percent_bg_color == 0);
06597         assert(d.percent_fg_bold == 0);
06598         assert(d.barbrace_fg_color == 0);
06599         assert(d.barbrace_bg_color == 0);
06600         assert(d.barbrace_fg_bold == 0);
06601         assert(d.bar_fg_color == 0);
06602         assert(d.bar_bg_color == 0);
06603         assert(d.bar_fg_bold == 0);
06604         assert(io.in == 0);
06605         assert(io.out == 1);
06606         assert(io.in_ready == 0);
06607         assert(io.out_ready == 0);
06608         assert(io.eof_in == 0);
06609         assert(io.eof_out == 0);
06610         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06611         /* assert(io.cbuf == 0x0); */
06612         assert(io.last_read == 0);
06613         assert(io.last_write == 0);
06614         assert(io.total_read == 0);
06615         assert(io.total_write == 0);
06616         assert(io.total_size == 0);
06617         assert(io.total_size_known == 0);
06618         assert(io.timeout == 250000);
06619 
06620         assert(parse_args(out, argc, argv) == 1);
06621 
06622 #ifdef PRINT_DEBUG
06623         print();
06624 #endif
06625         assert(d.start_time == 0);
06626         assert(d.total_time == 0);
06627         assert(d.current_time == 0);
06628         assert(d.elapsed_time == 0);
06629         assert(d.percent_complete == 0);
06630         assert(d.display_interval == 1);
06631         assert(d.overtime_flag == 0);
06632         assert(d.k == 1024);
06633         assert(d.twiddle == '-');
06634         assert(d.manual_width == 0);
06635         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06636         assert(d.display_datacount == 1);
06637         assert(d.display_throughput == 1);
06638         assert(d.display_time == 1);
06639         assert(d.display_percent == 1);
06640         assert(d.display_bar == 1);
06641         assert(d.display_summary == 1);
06642         assert(d.display_ansi == 0);
06643         assert(d.twiddle_fg_color == 0);
06644         assert(d.twiddle_bg_color == 0);
06645         assert(d.twiddle_fg_bold == 0);
06646         assert(d.datacount_fg_color == 0);
06647         assert(d.datacount_bg_color == 0);
06648         assert(d.datacount_fg_bold == 0);
06649         assert(d.throughput_label_fg_color == 0);
06650         assert(d.throughput_label_bg_color == 0);
06651         assert(d.throughput_label_fg_bold == 0);
06652         assert(d.throughput_fg_color == 0);
06653         assert(d.throughput_bg_color == 0);
06654         assert(d.throughput_fg_bold == 0);
06655         assert(d.time_label_fg_color == 0);
06656         assert(d.time_label_bg_color == 0);
06657         assert(d.time_label_fg_bold == 0);
06658         assert(d.percent_fg_color == 0);
06659         assert(d.percent_bg_color == 0);
06660         assert(d.percent_fg_bold == 0);
06661         assert(d.barbrace_fg_color == 0);
06662         assert(d.barbrace_bg_color == 0);
06663         assert(d.barbrace_fg_bold == 0);
06664         assert(d.bar_fg_color == 0);
06665         assert(d.bar_bg_color == 0);
06666         assert(d.bar_fg_bold == 0);
06667         assert(io.in == 0);
06668         assert(io.out == 1);
06669         assert(io.in_ready == 0);
06670         assert(io.out_ready == 0);
06671         assert(io.eof_in == 0);
06672         assert(io.eof_out == 0);
06673         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06674         /* assert(io.cbuf == 0x0); */
06675         assert(io.last_read == 0);
06676         assert(io.last_write == 0);
06677         assert(io.total_read == 0);
06678         assert(io.total_write == 0);
06679         assert(io.total_size == 0);
06680         assert(io.total_size_known == 0);
06681         assert(io.timeout == 250000);
06682 }
06683 
06684 void test50(FILE* out)
06685 {
06686         int argc = 0;
06687         char *argv[256] = { 0 };
06688 
06689         argv[argc++] = "ProgramName";
06690         argv[argc++] = "--in-file";
06691         argv[argc++] = "/dev/null";
06692 
06693         displayInit();
06694         ioInit();
06695 
06696 #ifdef PRINT_DEBUG
06697         print();
06698 #endif
06699         assert(d.start_time == 0);
06700         assert(d.total_time == 0);
06701         assert(d.current_time == 0);
06702         assert(d.elapsed_time == 0);
06703         assert(d.percent_complete == 0);
06704         assert(d.display_interval == 1);
06705         assert(d.overtime_flag == 0);
06706         assert(d.k == 1024);
06707         assert(d.twiddle == '-');
06708         assert(d.manual_width == 0);
06709         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06710         assert(d.display_datacount == 1);
06711         assert(d.display_throughput == 1);
06712         assert(d.display_time == 1);
06713         assert(d.display_percent == 1);
06714         assert(d.display_bar == 1);
06715         assert(d.display_summary == 1);
06716         assert(d.display_ansi == 0);
06717         assert(d.twiddle_fg_color == 0);
06718         assert(d.twiddle_bg_color == 0);
06719         assert(d.twiddle_fg_bold == 0);
06720         assert(d.datacount_fg_color == 0);
06721         assert(d.datacount_bg_color == 0);
06722         assert(d.datacount_fg_bold == 0);
06723         assert(d.throughput_label_fg_color == 0);
06724         assert(d.throughput_label_bg_color == 0);
06725         assert(d.throughput_label_fg_bold == 0);
06726         assert(d.throughput_fg_color == 0);
06727         assert(d.throughput_bg_color == 0);
06728         assert(d.throughput_fg_bold == 0);
06729         assert(d.time_label_fg_color == 0);
06730         assert(d.time_label_bg_color == 0);
06731         assert(d.time_label_fg_bold == 0);
06732         assert(d.percent_fg_color == 0);
06733         assert(d.percent_bg_color == 0);
06734         assert(d.percent_fg_bold == 0);
06735         assert(d.barbrace_fg_color == 0);
06736         assert(d.barbrace_bg_color == 0);
06737         assert(d.barbrace_fg_bold == 0);
06738         assert(d.bar_fg_color == 0);
06739         assert(d.bar_bg_color == 0);
06740         assert(d.bar_fg_bold == 0);
06741         assert(io.in == 0);
06742         assert(io.out == 1);
06743         assert(io.in_ready == 0);
06744         assert(io.out_ready == 0);
06745         assert(io.eof_in == 0);
06746         assert(io.eof_out == 0);
06747         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06748         /* assert(io.cbuf == 0x0); */
06749         assert(io.last_read == 0);
06750         assert(io.last_write == 0);
06751         assert(io.total_read == 0);
06752         assert(io.total_write == 0);
06753         assert(io.total_size == 0);
06754         assert(io.total_size_known == 0);
06755         assert(io.timeout == 250000);
06756 
06757         assert(parse_args(out, argc, argv) == 0);
06758 
06759 #ifdef PRINT_DEBUG
06760         print();
06761 #endif
06762         assert(d.start_time == 0);
06763         assert(d.total_time == 0);
06764         assert(d.current_time == 0);
06765         assert(d.elapsed_time == 0);
06766         assert(d.percent_complete == 0);
06767         assert(d.display_interval == 1);
06768         assert(d.overtime_flag == 0);
06769         assert(d.k == 1024);
06770         assert(d.twiddle == '-');
06771         assert(d.manual_width == 0);
06772         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06773         assert(d.display_datacount == 1);
06774         assert(d.display_throughput == 1);
06775         assert(d.display_time == 1);
06776         assert(d.display_percent == 1);
06777         assert(d.display_bar == 1);
06778         assert(d.display_summary == 1);
06779         assert(io.in != 0);
06780         assert(io.out == 1);
06781         assert(io.in_ready == 0);
06782         assert(io.out_ready == 0);
06783         assert(io.eof_in == 0);
06784         assert(io.eof_out == 0);
06785         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06786         /* assert(io.cbuf == 0x0); */
06787         assert(io.last_read == 0);
06788         assert(io.last_write == 0);
06789         assert(io.total_read == 0);
06790         assert(io.total_write == 0);
06791         assert(io.total_size == 0);
06792         assert(io.total_size_known == 0);
06793         assert(io.timeout == 250000);
06794 }
06795 
06796 void test51(FILE* out)
06797 {
06798         int argc = 0;
06799         char *argv[256] = { 0 };
06800 
06801         argv[argc++] = "ProgramName";
06802         argv[argc++] = "--out-file";
06803 
06804         displayInit();
06805         ioInit();
06806 
06807 #ifdef PRINT_DEBUG
06808         print();
06809 #endif
06810         assert(d.start_time == 0);
06811         assert(d.total_time == 0);
06812         assert(d.current_time == 0);
06813         assert(d.elapsed_time == 0);
06814         assert(d.percent_complete == 0);
06815         assert(d.display_interval == 1);
06816         assert(d.overtime_flag == 0);
06817         assert(d.k == 1024);
06818         assert(d.twiddle == '-');
06819         assert(d.manual_width == 0);
06820         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06821         assert(d.display_datacount == 1);
06822         assert(d.display_throughput == 1);
06823         assert(d.display_time == 1);
06824         assert(d.display_percent == 1);
06825         assert(d.display_bar == 1);
06826         assert(d.display_summary == 1);
06827         assert(d.display_ansi == 0);
06828         assert(d.twiddle_fg_color == 0);
06829         assert(d.twiddle_bg_color == 0);
06830         assert(d.twiddle_fg_bold == 0);
06831         assert(d.datacount_fg_color == 0);
06832         assert(d.datacount_bg_color == 0);
06833         assert(d.datacount_fg_bold == 0);
06834         assert(d.throughput_label_fg_color == 0);
06835         assert(d.throughput_label_bg_color == 0);
06836         assert(d.throughput_label_fg_bold == 0);
06837         assert(d.throughput_fg_color == 0);
06838         assert(d.throughput_bg_color == 0);
06839         assert(d.throughput_fg_bold == 0);
06840         assert(d.time_label_fg_color == 0);
06841         assert(d.time_label_bg_color == 0);
06842         assert(d.time_label_fg_bold == 0);
06843         assert(d.percent_fg_color == 0);
06844         assert(d.percent_bg_color == 0);
06845         assert(d.percent_fg_bold == 0);
06846         assert(d.barbrace_fg_color == 0);
06847         assert(d.barbrace_bg_color == 0);
06848         assert(d.barbrace_fg_bold == 0);
06849         assert(d.bar_fg_color == 0);
06850         assert(d.bar_bg_color == 0);
06851         assert(d.bar_fg_bold == 0);
06852         assert(io.in == 0);
06853         assert(io.out == 1);
06854         assert(io.in_ready == 0);
06855         assert(io.out_ready == 0);
06856         assert(io.eof_in == 0);
06857         assert(io.eof_out == 0);
06858         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06859         /* assert(io.cbuf == 0x0); */
06860         assert(io.last_read == 0);
06861         assert(io.last_write == 0);
06862         assert(io.total_read == 0);
06863         assert(io.total_write == 0);
06864         assert(io.total_size == 0);
06865         assert(io.total_size_known == 0);
06866         assert(io.timeout == 250000);
06867 
06868         assert(parse_args(out, argc, argv) == 1);
06869 
06870 #ifdef PRINT_DEBUG
06871         print();
06872 #endif
06873         assert(d.start_time == 0);
06874         assert(d.total_time == 0);
06875         assert(d.current_time == 0);
06876         assert(d.elapsed_time == 0);
06877         assert(d.percent_complete == 0);
06878         assert(d.display_interval == 1);
06879         assert(d.overtime_flag == 0);
06880         assert(d.k == 1024);
06881         assert(d.twiddle == '-');
06882         assert(d.manual_width == 0);
06883         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06884         assert(d.display_datacount == 1);
06885         assert(d.display_throughput == 1);
06886         assert(d.display_time == 1);
06887         assert(d.display_percent == 1);
06888         assert(d.display_bar == 1);
06889         assert(d.display_summary == 1);
06890         assert(d.display_ansi == 0);
06891         assert(d.twiddle_fg_color == 0);
06892         assert(d.twiddle_bg_color == 0);
06893         assert(d.twiddle_fg_bold == 0);
06894         assert(d.datacount_fg_color == 0);
06895         assert(d.datacount_bg_color == 0);
06896         assert(d.datacount_fg_bold == 0);
06897         assert(d.throughput_label_fg_color == 0);
06898         assert(d.throughput_label_bg_color == 0);
06899         assert(d.throughput_label_fg_bold == 0);
06900         assert(d.throughput_fg_color == 0);
06901         assert(d.throughput_bg_color == 0);
06902         assert(d.throughput_fg_bold == 0);
06903         assert(d.time_label_fg_color == 0);
06904         assert(d.time_label_bg_color == 0);
06905         assert(d.time_label_fg_bold == 0);
06906         assert(d.percent_fg_color == 0);
06907         assert(d.percent_bg_color == 0);
06908         assert(d.percent_fg_bold == 0);
06909         assert(d.barbrace_fg_color == 0);
06910         assert(d.barbrace_bg_color == 0);
06911         assert(d.barbrace_fg_bold == 0);
06912         assert(d.bar_fg_color == 0);
06913         assert(d.bar_bg_color == 0);
06914         assert(d.bar_fg_bold == 0);
06915         assert(io.in == 0);
06916         assert(io.out == 1);
06917         assert(io.in_ready == 0);
06918         assert(io.out_ready == 0);
06919         assert(io.eof_in == 0);
06920         assert(io.eof_out == 0);
06921         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06922         /* assert(io.cbuf == 0x0); */
06923         assert(io.last_read == 0);
06924         assert(io.last_write == 0);
06925         assert(io.total_read == 0);
06926         assert(io.total_write == 0);
06927         assert(io.total_size == 0);
06928         assert(io.total_size_known == 0);
06929         assert(io.timeout == 250000);
06930 }
06931 
06932 void test52(FILE* out)
06933 {
06934         int argc = 0;
06935         char *argv[256] = { 0 };
06936 
06937         argv[argc++] = "ProgramName";
06938         argv[argc++] = "--out-file";
06939         argv[argc++] = "/dev/null";
06940 
06941         displayInit();
06942         ioInit();
06943 
06944 #ifdef PRINT_DEBUG
06945         print();
06946 #endif
06947         assert(d.start_time == 0);
06948         assert(d.total_time == 0);
06949         assert(d.current_time == 0);
06950         assert(d.elapsed_time == 0);
06951         assert(d.percent_complete == 0);
06952         assert(d.display_interval == 1);
06953         assert(d.overtime_flag == 0);
06954         assert(d.k == 1024);
06955         assert(d.twiddle == '-');
06956         assert(d.manual_width == 0);
06957         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
06958         assert(d.display_datacount == 1);
06959         assert(d.display_throughput == 1);
06960         assert(d.display_time == 1);
06961         assert(d.display_percent == 1);
06962         assert(d.display_bar == 1);
06963         assert(d.display_summary == 1);
06964         assert(d.display_ansi == 0);
06965         assert(d.twiddle_fg_color == 0);
06966         assert(d.twiddle_bg_color == 0);
06967         assert(d.twiddle_fg_bold == 0);
06968         assert(d.datacount_fg_color == 0);
06969         assert(d.datacount_bg_color == 0);
06970         assert(d.datacount_fg_bold == 0);
06971         assert(d.throughput_label_fg_color == 0);
06972         assert(d.throughput_label_bg_color == 0);
06973         assert(d.throughput_label_fg_bold == 0);
06974         assert(d.throughput_fg_color == 0);
06975         assert(d.throughput_bg_color == 0);
06976         assert(d.throughput_fg_bold == 0);
06977         assert(d.time_label_fg_color == 0);
06978         assert(d.time_label_bg_color == 0);
06979         assert(d.time_label_fg_bold == 0);
06980         assert(d.percent_fg_color == 0);
06981         assert(d.percent_bg_color == 0);
06982         assert(d.percent_fg_bold == 0);
06983         assert(d.barbrace_fg_color == 0);
06984         assert(d.barbrace_bg_color == 0);
06985         assert(d.barbrace_fg_bold == 0);
06986         assert(d.bar_fg_color == 0);
06987         assert(d.bar_bg_color == 0);
06988         assert(d.bar_fg_bold == 0);
06989         assert(io.in == 0);
06990         assert(io.out == 1);
06991         assert(io.in_ready == 0);
06992         assert(io.out_ready == 0);
06993         assert(io.eof_in == 0);
06994         assert(io.eof_out == 0);
06995         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
06996         /* assert(io.cbuf == 0x0); */
06997         assert(io.last_read == 0);
06998         assert(io.last_write == 0);
06999         assert(io.total_read == 0);
07000         assert(io.total_write == 0);
07001         assert(io.total_size == 0);
07002         assert(io.total_size_known == 0);
07003         assert(io.timeout == 250000);
07004 
07005         assert(parse_args(out, argc, argv) == 0);
07006 
07007 #ifdef PRINT_DEBUG
07008         print();
07009 #endif
07010         assert(d.start_time == 0);
07011         assert(d.total_time == 0);
07012         assert(d.current_time == 0);
07013         assert(d.elapsed_time == 0);
07014         assert(d.percent_complete == 0);
07015         assert(d.display_interval == 1);
07016         assert(d.overtime_flag == 0);
07017         assert(d.k == 1024);
07018         assert(d.twiddle == '-');
07019         assert(d.manual_width == 0);
07020         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07021         assert(d.display_datacount == 1);
07022         assert(d.display_throughput == 1);
07023         assert(d.display_time == 1);
07024         assert(d.display_percent == 1);
07025         assert(d.display_bar == 1);
07026         assert(d.display_summary == 1);
07027         assert(d.display_ansi == 0);
07028         assert(d.twiddle_fg_color == 0);
07029         assert(d.twiddle_bg_color == 0);
07030         assert(d.twiddle_fg_bold == 0);
07031         assert(d.datacount_fg_color == 0);
07032         assert(d.datacount_bg_color == 0);
07033         assert(d.datacount_fg_bold == 0);
07034         assert(d.throughput_label_fg_color == 0);
07035         assert(d.throughput_label_bg_color == 0);
07036         assert(d.throughput_label_fg_bold == 0);
07037         assert(d.throughput_fg_color == 0);
07038         assert(d.throughput_bg_color == 0);
07039         assert(d.throughput_fg_bold == 0);
07040         assert(d.time_label_fg_color == 0);
07041         assert(d.time_label_bg_color == 0);
07042         assert(d.time_label_fg_bold == 0);
07043         assert(d.percent_fg_color == 0);
07044         assert(d.percent_bg_color == 0);
07045         assert(d.percent_fg_bold == 0);
07046         assert(d.barbrace_fg_color == 0);
07047         assert(d.barbrace_bg_color == 0);
07048         assert(d.barbrace_fg_bold == 0);
07049         assert(d.bar_fg_color == 0);
07050         assert(d.bar_bg_color == 0);
07051         assert(d.bar_fg_bold == 0);
07052         assert(io.in == 0);
07053         assert(io.out != 1);
07054         assert(io.in_ready == 0);
07055         assert(io.out_ready == 0);
07056         assert(io.eof_in == 0);
07057         assert(io.eof_out == 0);
07058         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07059         /* assert(io.cbuf == 0x0); */
07060         assert(io.last_read == 0);
07061         assert(io.last_write == 0);
07062         assert(io.total_read == 0);
07063         assert(io.total_write == 0);
07064         assert(io.total_size == 0);
07065         assert(io.total_size_known == 0);
07066         assert(io.timeout == 250000);
07067 }
07068 
07069 void test53(FILE* out)
07070 {
07071         int argc = 0;
07072         char *argv[256] = { 0 };
07073 
07074         argv[argc++] = "ProgramName";
07075         argv[argc++] = "--size";
07076 
07077         displayInit();
07078         ioInit();
07079 
07080 #ifdef PRINT_DEBUG
07081         print();
07082 #endif
07083         assert(d.start_time == 0);
07084         assert(d.total_time == 0);
07085         assert(d.current_time == 0);
07086         assert(d.elapsed_time == 0);
07087         assert(d.percent_complete == 0);
07088         assert(d.display_interval == 1);
07089         assert(d.overtime_flag == 0);
07090         assert(d.k == 1024);
07091         assert(d.twiddle == '-');
07092         assert(d.manual_width == 0);
07093         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07094         assert(d.display_datacount == 1);
07095         assert(d.display_throughput == 1);
07096         assert(d.display_time == 1);
07097         assert(d.display_percent == 1);
07098         assert(d.display_bar == 1);
07099         assert(d.display_summary == 1);
07100         assert(d.display_ansi == 0);
07101         assert(d.twiddle_fg_color == 0);
07102         assert(d.twiddle_bg_color == 0);
07103         assert(d.twiddle_fg_bold == 0);
07104         assert(d.datacount_fg_color == 0);
07105         assert(d.datacount_bg_color == 0);
07106         assert(d.datacount_fg_bold == 0);
07107         assert(d.throughput_label_fg_color == 0);
07108         assert(d.throughput_label_bg_color == 0);
07109         assert(d.throughput_label_fg_bold == 0);
07110         assert(d.throughput_fg_color == 0);
07111         assert(d.throughput_bg_color == 0);
07112         assert(d.throughput_fg_bold == 0);
07113         assert(d.time_label_fg_color == 0);
07114         assert(d.time_label_bg_color == 0);
07115         assert(d.time_label_fg_bold == 0);
07116         assert(d.percent_fg_color == 0);
07117         assert(d.percent_bg_color == 0);
07118         assert(d.percent_fg_bold == 0);
07119         assert(d.barbrace_fg_color == 0);
07120         assert(d.barbrace_bg_color == 0);
07121         assert(d.barbrace_fg_bold == 0);
07122         assert(d.bar_fg_color == 0);
07123         assert(d.bar_bg_color == 0);
07124         assert(d.bar_fg_bold == 0);
07125         assert(io.in == 0);
07126         assert(io.out == 1);
07127         assert(io.in_ready == 0);
07128         assert(io.out_ready == 0);
07129         assert(io.eof_in == 0);
07130         assert(io.eof_out == 0);
07131         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07132         /* assert(io.cbuf == 0x0); */
07133         assert(io.last_read == 0);
07134         assert(io.last_write == 0);
07135         assert(io.total_read == 0);
07136         assert(io.total_write == 0);
07137         assert(io.total_size == 0);
07138         assert(io.total_size_known == 0);
07139         assert(io.timeout == 250000);
07140 
07141         assert(parse_args(out, argc, argv) == 1);
07142 
07143 #ifdef PRINT_DEBUG
07144         print();
07145 #endif
07146         assert(d.start_time == 0);
07147         assert(d.total_time == 0);
07148         assert(d.current_time == 0);
07149         assert(d.elapsed_time == 0);
07150         assert(d.percent_complete == 0);
07151         assert(d.display_interval == 1);
07152         assert(d.overtime_flag == 0);
07153         assert(d.k == 1024);
07154         assert(d.twiddle == '-');
07155         assert(d.manual_width == 0);
07156         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07157         assert(d.display_datacount == 1);
07158         assert(d.display_throughput == 1);
07159         assert(d.display_time == 1);
07160         assert(d.display_percent == 1);
07161         assert(d.display_bar == 1);
07162         assert(d.display_summary == 1);
07163         assert(d.display_ansi == 0);
07164         assert(d.twiddle_fg_color == 0);
07165         assert(d.twiddle_bg_color == 0);
07166         assert(d.twiddle_fg_bold == 0);
07167         assert(d.datacount_fg_color == 0);
07168         assert(d.datacount_bg_color == 0);
07169         assert(d.datacount_fg_bold == 0);
07170         assert(d.throughput_label_fg_color == 0);
07171         assert(d.throughput_label_bg_color == 0);
07172         assert(d.throughput_label_fg_bold == 0);
07173         assert(d.throughput_fg_color == 0);
07174         assert(d.throughput_bg_color == 0);
07175         assert(d.throughput_fg_bold == 0);
07176         assert(d.time_label_fg_color == 0);
07177         assert(d.time_label_bg_color == 0);
07178         assert(d.time_label_fg_bold == 0);
07179         assert(d.percent_fg_color == 0);
07180         assert(d.percent_bg_color == 0);
07181         assert(d.percent_fg_bold == 0);
07182         assert(d.barbrace_fg_color == 0);
07183         assert(d.barbrace_bg_color == 0);
07184         assert(d.barbrace_fg_bold == 0);
07185         assert(d.bar_fg_color == 0);
07186         assert(d.bar_bg_color == 0);
07187         assert(d.bar_fg_bold == 0);
07188         assert(io.in == 0);
07189         assert(io.out == 1);
07190         assert(io.in_ready == 0);
07191         assert(io.out_ready == 0);
07192         assert(io.eof_in == 0);
07193         assert(io.eof_out == 0);
07194         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07195         /* assert(io.cbuf == 0x0); */
07196         assert(io.last_read == 0);
07197         assert(io.last_write == 0);
07198         assert(io.total_read == 0);
07199         assert(io.total_write == 0);
07200         assert(io.total_size == 0);
07201         assert(io.total_size_known == 0);
07202         assert(io.timeout == 250000);
07203 }
07204 
07205 void test54(FILE* out)
07206 {
07207         int argc = 0;
07208         char *argv[256] = { 0 };
07209 
07210         argv[argc++] = "ProgramName";
07211         argv[argc++] = "--size";
07212         argv[argc++] = "/dev/null";
07213 
07214         displayInit();
07215         ioInit();
07216 
07217 #ifdef PRINT_DEBUG
07218         print();
07219 #endif
07220         assert(d.start_time == 0);
07221         assert(d.total_time == 0);
07222         assert(d.current_time == 0);
07223         assert(d.elapsed_time == 0);
07224         assert(d.percent_complete == 0);
07225         assert(d.display_interval == 1);
07226         assert(d.overtime_flag == 0);
07227         assert(d.k == 1024);
07228         assert(d.twiddle == '-');
07229         assert(d.manual_width == 0);
07230         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07231         assert(d.display_datacount == 1);
07232         assert(d.display_throughput == 1);
07233         assert(d.display_time == 1);
07234         assert(d.display_percent == 1);
07235         assert(d.display_bar == 1);
07236         assert(d.display_summary == 1);
07237         assert(d.display_ansi == 0);
07238         assert(d.twiddle_fg_color == 0);
07239         assert(d.twiddle_bg_color == 0);
07240         assert(d.twiddle_fg_bold == 0);
07241         assert(d.datacount_fg_color == 0);
07242         assert(d.datacount_bg_color == 0);
07243         assert(d.datacount_fg_bold == 0);
07244         assert(d.throughput_label_fg_color == 0);
07245         assert(d.throughput_label_bg_color == 0);
07246         assert(d.throughput_label_fg_bold == 0);
07247         assert(d.throughput_fg_color == 0);
07248         assert(d.throughput_bg_color == 0);
07249         assert(d.throughput_fg_bold == 0);
07250         assert(d.time_label_fg_color == 0);
07251         assert(d.time_label_bg_color == 0);
07252         assert(d.time_label_fg_bold == 0);
07253         assert(d.percent_fg_color == 0);
07254         assert(d.percent_bg_color == 0);
07255         assert(d.percent_fg_bold == 0);
07256         assert(d.barbrace_fg_color == 0);
07257         assert(d.barbrace_bg_color == 0);
07258         assert(d.barbrace_fg_bold == 0);
07259         assert(d.bar_fg_color == 0);
07260         assert(d.bar_bg_color == 0);
07261         assert(d.bar_fg_bold == 0);
07262         assert(io.in == 0);
07263         assert(io.out == 1);
07264         assert(io.in_ready == 0);
07265         assert(io.out_ready == 0);
07266         assert(io.eof_in == 0);
07267         assert(io.eof_out == 0);
07268         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07269         /* assert(io.cbuf == 0x0); */
07270         assert(io.last_read == 0);
07271         assert(io.last_write == 0);
07272         assert(io.total_read == 0);
07273         assert(io.total_write == 0);
07274         assert(io.total_size == 0);
07275         assert(io.total_size_known == 0);
07276         assert(io.timeout == 250000);
07277 
07278         assert(parse_args(out, argc, argv) == 0);
07279 
07280 #ifdef PRINT_DEBUG
07281         print();
07282 #endif
07283         assert(d.start_time == 0);
07284         assert(d.total_time == 0);
07285         assert(d.current_time == 0);
07286         assert(d.elapsed_time == 0);
07287         assert(d.percent_complete == 0);
07288         assert(d.display_interval == 1);
07289         assert(d.overtime_flag == 0);
07290         assert(d.k == 1024);
07291         assert(d.twiddle == '-');
07292         assert(d.manual_width == 0);
07293         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07294         assert(d.display_datacount == 1);
07295         assert(d.display_throughput == 1);
07296         assert(d.display_time == 1);
07297         assert(d.display_percent == 1);
07298         assert(d.display_bar == 1);
07299         assert(d.display_summary == 1);
07300         assert(d.display_ansi == 0);
07301         assert(d.twiddle_fg_color == 0);
07302         assert(d.twiddle_bg_color == 0);
07303         assert(d.twiddle_fg_bold == 0);
07304         assert(d.datacount_fg_color == 0);
07305         assert(d.datacount_bg_color == 0);
07306         assert(d.datacount_fg_bold == 0);
07307         assert(d.throughput_label_fg_color == 0);
07308         assert(d.throughput_label_bg_color == 0);
07309         assert(d.throughput_label_fg_bold == 0);
07310         assert(d.throughput_fg_color == 0);
07311         assert(d.throughput_bg_color == 0);
07312         assert(d.throughput_fg_bold == 0);
07313         assert(d.time_label_fg_color == 0);
07314         assert(d.time_label_bg_color == 0);
07315         assert(d.time_label_fg_bold == 0);
07316         assert(d.percent_fg_color == 0);
07317         assert(d.percent_bg_color == 0);
07318         assert(d.percent_fg_bold == 0);
07319         assert(d.barbrace_fg_color == 0);
07320         assert(d.barbrace_bg_color == 0);
07321         assert(d.barbrace_fg_bold == 0);
07322         assert(d.bar_fg_color == 0);
07323         assert(d.bar_bg_color == 0);
07324         assert(d.bar_fg_bold == 0);
07325         assert(io.in == 0);
07326         assert(io.out == 1);
07327         assert(io.in_ready == 0);
07328         assert(io.out_ready == 0);
07329         assert(io.eof_in == 0);
07330         assert(io.eof_out == 0);
07331         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07332         /* assert(io.cbuf == 0x0); */
07333         assert(io.last_read == 0);
07334         assert(io.last_write == 0);
07335         assert(io.total_read == 0);
07336         assert(io.total_write == 0);
07337         assert(io.total_size == 0);
07338         assert(io.total_size_known == 0);
07339         assert(io.timeout == 250000);
07340 }
07341 
07342 void test55(FILE* out)
07343 {
07344         int argc = 0;
07345         char *argv[256] = { 0 };
07346 
07347         argv[argc++] = "ProgramName";
07348         argv[argc++] = "--size";
07349         argv[argc++] = "1024.38002m";
07350 
07351         displayInit();
07352         ioInit();
07353 
07354 #ifdef PRINT_DEBUG
07355         print();
07356 #endif
07357         assert(d.start_time == 0);
07358         assert(d.total_time == 0);
07359         assert(d.current_time == 0);
07360         assert(d.elapsed_time == 0);
07361         assert(d.percent_complete == 0);
07362         assert(d.display_interval == 1);
07363         assert(d.overtime_flag == 0);
07364         assert(d.k == 1024);
07365         assert(d.twiddle == '-');
07366         assert(d.manual_width == 0);
07367         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07368         assert(d.display_datacount == 1);
07369         assert(d.display_throughput == 1);
07370         assert(d.display_time == 1);
07371         assert(d.display_percent == 1);
07372         assert(d.display_bar == 1);
07373         assert(d.display_summary == 1);
07374         assert(d.display_ansi == 0);
07375         assert(d.twiddle_fg_color == 0);
07376         assert(d.twiddle_bg_color == 0);
07377         assert(d.twiddle_fg_bold == 0);
07378         assert(d.datacount_fg_color == 0);
07379         assert(d.datacount_bg_color == 0);
07380         assert(d.datacount_fg_bold == 0);
07381         assert(d.throughput_label_fg_color == 0);
07382         assert(d.throughput_label_bg_color == 0);
07383         assert(d.throughput_label_fg_bold == 0);
07384         assert(d.throughput_fg_color == 0);
07385         assert(d.throughput_bg_color == 0);
07386         assert(d.throughput_fg_bold == 0);
07387         assert(d.time_label_fg_color == 0);
07388         assert(d.time_label_bg_color == 0);
07389         assert(d.time_label_fg_bold == 0);
07390         assert(d.percent_fg_color == 0);
07391         assert(d.percent_bg_color == 0);
07392         assert(d.percent_fg_bold == 0);
07393         assert(d.barbrace_fg_color == 0);
07394         assert(d.barbrace_bg_color == 0);
07395         assert(d.barbrace_fg_bold == 0);
07396         assert(d.bar_fg_color == 0);
07397         assert(d.bar_bg_color == 0);
07398         assert(d.bar_fg_bold == 0);
07399         assert(io.in == 0);
07400         assert(io.out == 1);
07401         assert(io.in_ready == 0);
07402         assert(io.out_ready == 0);
07403         assert(io.eof_in == 0);
07404         assert(io.eof_out == 0);
07405         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07406         /* assert(io.cbuf == 0x0); */
07407         assert(io.last_read == 0);
07408         assert(io.last_write == 0);
07409         assert(io.total_read == 0);
07410         assert(io.total_write == 0);
07411         assert(io.total_size == 0);
07412         assert(io.total_size_known == 0);
07413         assert(io.timeout == 250000);
07414 
07415         assert(parse_args(out, argc, argv) == 0);
07416 
07417 #ifdef PRINT_DEBUG
07418         print();
07419 #endif
07420         assert(d.start_time == 0);
07421         assert(d.total_time == 0);
07422         assert(d.current_time == 0);
07423         assert(d.elapsed_time == 0);
07424         assert(d.percent_complete == 0);
07425         assert(d.display_interval == 1);
07426         assert(d.overtime_flag == 0);
07427         assert(d.k == 1024);
07428         assert(d.twiddle == '-');
07429         assert(d.manual_width == 0);
07430         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07431         assert(d.display_datacount == 1);
07432         assert(d.display_throughput == 1);
07433         assert(d.display_time == 1);
07434         assert(d.display_percent == 1);
07435         assert(d.display_bar == 1);
07436         assert(d.display_summary == 1);
07437         assert(d.display_ansi == 0);
07438         assert(d.twiddle_fg_color == 0);
07439         assert(d.twiddle_bg_color == 0);
07440         assert(d.twiddle_fg_bold == 0);
07441         assert(d.datacount_fg_color == 0);
07442         assert(d.datacount_bg_color == 0);
07443         assert(d.datacount_fg_bold == 0);
07444         assert(d.throughput_label_fg_color == 0);
07445         assert(d.throughput_label_bg_color == 0);
07446         assert(d.throughput_label_fg_bold == 0);
07447         assert(d.throughput_fg_color == 0);
07448         assert(d.throughput_bg_color == 0);
07449         assert(d.throughput_fg_bold == 0);
07450         assert(d.time_label_fg_color == 0);
07451         assert(d.time_label_bg_color == 0);
07452         assert(d.time_label_fg_bold == 0);
07453         assert(d.percent_fg_color == 0);
07454         assert(d.percent_bg_color == 0);
07455         assert(d.percent_fg_bold == 0);
07456         assert(d.barbrace_fg_color == 0);
07457         assert(d.barbrace_bg_color == 0);
07458         assert(d.barbrace_fg_bold == 0);
07459         assert(d.bar_fg_color == 0);
07460         assert(d.bar_bg_color == 0);
07461         assert(d.bar_fg_bold == 0);
07462         assert(io.in == 0);
07463         assert(io.out == 1);
07464         assert(io.in_ready == 0);
07465         assert(io.out_ready == 0);
07466         assert(io.eof_in == 0);
07467         assert(io.eof_out == 0);
07468         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07469         /* assert(io.cbuf == 0x0); */
07470         assert(io.last_read == 0);
07471         assert(io.last_write == 0);
07472         assert(io.total_read == 0);
07473         assert(io.total_write == 0);
07474         assert(io.total_size == 1074140304);
07475         assert(io.total_size_known == 1);
07476         assert(io.timeout == 250000);
07477 }
07478 
07479 void test56(FILE* out)
07480 {
07481         int argc = 0;
07482         char *argv[256] = { 0 };
07483 
07484         argv[argc++] = "ProgramName";
07485         argv[argc++] = "--buffer-size";
07486 
07487         displayInit();
07488         ioInit();
07489 
07490 #ifdef PRINT_DEBUG
07491         print();
07492 #endif
07493         assert(d.start_time == 0);
07494         assert(d.total_time == 0);
07495         assert(d.current_time == 0);
07496         assert(d.elapsed_time == 0);
07497         assert(d.percent_complete == 0);
07498         assert(d.display_interval == 1);
07499         assert(d.overtime_flag == 0);
07500         assert(d.k == 1024);
07501         assert(d.twiddle == '-');
07502         assert(d.manual_width == 0);
07503         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07504         assert(d.display_datacount == 1);
07505         assert(d.display_throughput == 1);
07506         assert(d.display_time == 1);
07507         assert(d.display_percent == 1);
07508         assert(d.display_bar == 1);
07509         assert(d.display_summary == 1);
07510         assert(d.display_ansi == 0);
07511         assert(d.twiddle_fg_color == 0);
07512         assert(d.twiddle_bg_color == 0);
07513         assert(d.twiddle_fg_bold == 0);
07514         assert(d.datacount_fg_color == 0);
07515         assert(d.datacount_bg_color == 0);
07516         assert(d.datacount_fg_bold == 0);
07517         assert(d.throughput_label_fg_color == 0);
07518         assert(d.throughput_label_bg_color == 0);
07519         assert(d.throughput_label_fg_bold == 0);
07520         assert(d.throughput_fg_color == 0);
07521         assert(d.throughput_bg_color == 0);
07522         assert(d.throughput_fg_bold == 0);
07523         assert(d.time_label_fg_color == 0);
07524         assert(d.time_label_bg_color == 0);
07525         assert(d.time_label_fg_bold == 0);
07526         assert(d.percent_fg_color == 0);
07527         assert(d.percent_bg_color == 0);
07528         assert(d.percent_fg_bold == 0);
07529         assert(d.barbrace_fg_color == 0);
07530         assert(d.barbrace_bg_color == 0);
07531         assert(d.barbrace_fg_bold == 0);
07532         assert(d.bar_fg_color == 0);
07533         assert(d.bar_bg_color == 0);
07534         assert(d.bar_fg_bold == 0);
07535         assert(io.in == 0);
07536         assert(io.out == 1);
07537         assert(io.in_ready == 0);
07538         assert(io.out_ready == 0);
07539         assert(io.eof_in == 0);
07540         assert(io.eof_out == 0);
07541         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07542         /* assert(io.cbuf == 0x0); */
07543         assert(io.last_read == 0);
07544         assert(io.last_write == 0);
07545         assert(io.total_read == 0);
07546         assert(io.total_write == 0);
07547         assert(io.total_size == 0);
07548         assert(io.total_size_known == 0);
07549         assert(io.timeout == 250000);
07550 
07551         assert(parse_args(out, argc, argv) == 1);
07552 
07553 #ifdef PRINT_DEBUG
07554         print();
07555 #endif
07556         assert(d.start_time == 0);
07557         assert(d.total_time == 0);
07558         assert(d.current_time == 0);
07559         assert(d.elapsed_time == 0);
07560         assert(d.percent_complete == 0);
07561         assert(d.display_interval == 1);
07562         assert(d.overtime_flag == 0);
07563         assert(d.k == 1024);
07564         assert(d.twiddle == '-');
07565         assert(d.manual_width == 0);
07566         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07567         assert(d.display_datacount == 1);
07568         assert(d.display_throughput == 1);
07569         assert(d.display_time == 1);
07570         assert(d.display_percent == 1);
07571         assert(d.display_bar == 1);
07572         assert(d.display_summary == 1);
07573         assert(d.display_ansi == 0);
07574         assert(d.twiddle_fg_color == 0);
07575         assert(d.twiddle_bg_color == 0);
07576         assert(d.twiddle_fg_bold == 0);
07577         assert(d.datacount_fg_color == 0);
07578         assert(d.datacount_bg_color == 0);
07579         assert(d.datacount_fg_bold == 0);
07580         assert(d.throughput_label_fg_color == 0);
07581         assert(d.throughput_label_bg_color == 0);
07582         assert(d.throughput_label_fg_bold == 0);
07583         assert(d.throughput_fg_color == 0);
07584         assert(d.throughput_bg_color == 0);
07585         assert(d.throughput_fg_bold == 0);
07586         assert(d.time_label_fg_color == 0);
07587         assert(d.time_label_bg_color == 0);
07588         assert(d.time_label_fg_bold == 0);
07589         assert(d.percent_fg_color == 0);
07590         assert(d.percent_bg_color == 0);
07591         assert(d.percent_fg_bold == 0);
07592         assert(d.barbrace_fg_color == 0);
07593         assert(d.barbrace_bg_color == 0);
07594         assert(d.barbrace_fg_bold == 0);
07595         assert(d.bar_fg_color == 0);
07596         assert(d.bar_bg_color == 0);
07597         assert(d.bar_fg_bold == 0);
07598         assert(io.in == 0);
07599         assert(io.out == 1);
07600         assert(io.in_ready == 0);
07601         assert(io.out_ready == 0);
07602         assert(io.eof_in == 0);
07603         assert(io.eof_out == 0);
07604         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07605         /* assert(io.cbuf == 0x0); */
07606         assert(io.last_read == 0);
07607         assert(io.last_write == 0);
07608         assert(io.total_read == 0);
07609         assert(io.total_write == 0);
07610         assert(io.total_size == 0);
07611         assert(io.total_size_known == 0);
07612         assert(io.timeout == 250000);
07613 }
07614 
07615 void test57(FILE* out)
07616 {
07617         int argc = 0;
07618         char *argv[256] = { 0 };
07619 
07620         argv[argc++] = "ProgramName";
07621         argv[argc++] = "--buffer-size";
07622         argv[argc++] = "/dev/null";
07623 
07624         displayInit();
07625         ioInit();
07626 
07627 #ifdef PRINT_DEBUG
07628         print();
07629 #endif
07630         assert(d.start_time == 0);
07631         assert(d.total_time == 0);
07632         assert(d.current_time == 0);
07633         assert(d.elapsed_time == 0);
07634         assert(d.percent_complete == 0);
07635         assert(d.display_interval == 1);
07636         assert(d.overtime_flag == 0);
07637         assert(d.k == 1024);
07638         assert(d.twiddle == '-');
07639         assert(d.manual_width == 0);
07640         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07641         assert(d.display_datacount == 1);
07642         assert(d.display_throughput == 1);
07643         assert(d.display_time == 1);
07644         assert(d.display_percent == 1);
07645         assert(d.display_bar == 1);
07646         assert(d.display_summary == 1);
07647         assert(d.display_ansi == 0);
07648         assert(d.twiddle_fg_color == 0);
07649         assert(d.twiddle_bg_color == 0);
07650         assert(d.twiddle_fg_bold == 0);
07651         assert(d.datacount_fg_color == 0);
07652         assert(d.datacount_bg_color == 0);
07653         assert(d.datacount_fg_bold == 0);
07654         assert(d.throughput_label_fg_color == 0);
07655         assert(d.throughput_label_bg_color == 0);
07656         assert(d.throughput_label_fg_bold == 0);
07657         assert(d.throughput_fg_color == 0);
07658         assert(d.throughput_bg_color == 0);
07659         assert(d.throughput_fg_bold == 0);
07660         assert(d.time_label_fg_color == 0);
07661         assert(d.time_label_bg_color == 0);
07662         assert(d.time_label_fg_bold == 0);
07663         assert(d.percent_fg_color == 0);
07664         assert(d.percent_bg_color == 0);
07665         assert(d.percent_fg_bold == 0);
07666         assert(d.barbrace_fg_color == 0);
07667         assert(d.barbrace_bg_color == 0);
07668         assert(d.barbrace_fg_bold == 0);
07669         assert(d.bar_fg_color == 0);
07670         assert(d.bar_bg_color == 0);
07671         assert(d.bar_fg_bold == 0);
07672         assert(io.in == 0);
07673         assert(io.out == 1);
07674         assert(io.in_ready == 0);
07675         assert(io.out_ready == 0);
07676         assert(io.eof_in == 0);
07677         assert(io.eof_out == 0);
07678         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07679         /* assert(io.cbuf == 0x0); */
07680         assert(io.last_read == 0);
07681         assert(io.last_write == 0);
07682         assert(io.total_read == 0);
07683         assert(io.total_write == 0);
07684         assert(io.total_size == 0);
07685         assert(io.total_size_known == 0);
07686         assert(io.timeout == 250000);
07687 
07688         assert(parse_args(out, argc, argv) == 0);
07689 
07690 #ifdef PRINT_DEBUG
07691         print();
07692 #endif
07693         assert(d.start_time == 0);
07694         assert(d.total_time == 0);
07695         assert(d.current_time == 0);
07696         assert(d.elapsed_time == 0);
07697         assert(d.percent_complete == 0);
07698         assert(d.display_interval == 1);
07699         assert(d.overtime_flag == 0);
07700         assert(d.k == 1024);
07701         assert(d.twiddle == '-');
07702         assert(d.manual_width == 0);
07703         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07704         assert(d.display_datacount == 1);
07705         assert(d.display_throughput == 1);
07706         assert(d.display_time == 1);
07707         assert(d.display_percent == 1);
07708         assert(d.display_bar == 1);
07709         assert(d.display_summary == 1);
07710         assert(d.display_ansi == 0);
07711         assert(d.twiddle_fg_color == 0);
07712         assert(d.twiddle_bg_color == 0);
07713         assert(d.twiddle_fg_bold == 0);
07714         assert(d.datacount_fg_color == 0);
07715         assert(d.datacount_bg_color == 0);
07716         assert(d.datacount_fg_bold == 0);
07717         assert(d.throughput_label_fg_color == 0);
07718         assert(d.throughput_label_bg_color == 0);
07719         assert(d.throughput_label_fg_bold == 0);
07720         assert(d.throughput_fg_color == 0);
07721         assert(d.throughput_bg_color == 0);
07722         assert(d.throughput_fg_bold == 0);
07723         assert(d.time_label_fg_color == 0);
07724         assert(d.time_label_bg_color == 0);
07725         assert(d.time_label_fg_bold == 0);
07726         assert(d.percent_fg_color == 0);
07727         assert(d.percent_bg_color == 0);
07728         assert(d.percent_fg_bold == 0);
07729         assert(d.barbrace_fg_color == 0);
07730         assert(d.barbrace_bg_color == 0);
07731         assert(d.barbrace_fg_bold == 0);
07732         assert(d.bar_fg_color == 0);
07733         assert(d.bar_bg_color == 0);
07734         assert(d.bar_fg_bold == 0);
07735         assert(io.in == 0);
07736         assert(io.out == 1);
07737         assert(io.in_ready == 0);
07738         assert(io.out_ready == 0);
07739         assert(io.eof_in == 0);
07740         assert(io.eof_out == 0);
07741         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07742         /* assert(io.cbuf == 0x0); */
07743         assert(io.last_read == 0);
07744         assert(io.last_write == 0);
07745         assert(io.total_read == 0);
07746         assert(io.total_write == 0);
07747         assert(io.total_size == 0);
07748         assert(io.total_size_known == 0);
07749         assert(io.timeout == 250000);
07750 }
07751 
07752 void test58(FILE* out)
07753 {
07754         int argc = 0;
07755         char *argv[256] = { 0 };
07756 
07757         argv[argc++] = "ProgramName";
07758         argv[argc++] = "--buffer-size";
07759         argv[argc++] = "1024.38002m";
07760 
07761         displayInit();
07762         ioInit();
07763 
07764 #ifdef PRINT_DEBUG
07765         print();
07766 #endif
07767         assert(d.start_time == 0);
07768         assert(d.total_time == 0);
07769         assert(d.current_time == 0);
07770         assert(d.elapsed_time == 0);
07771         assert(d.percent_complete == 0);
07772         assert(d.display_interval == 1);
07773         assert(d.overtime_flag == 0);
07774         assert(d.k == 1024);
07775         assert(d.twiddle == '-');
07776         assert(d.manual_width == 0);
07777         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07778         assert(d.display_datacount == 1);
07779         assert(d.display_throughput == 1);
07780         assert(d.display_time == 1);
07781         assert(d.display_percent == 1);
07782         assert(d.display_bar == 1);
07783         assert(d.display_summary == 1);
07784         assert(d.display_ansi == 0);
07785         assert(d.twiddle_fg_color == 0);
07786         assert(d.twiddle_bg_color == 0);
07787         assert(d.twiddle_fg_bold == 0);
07788         assert(d.datacount_fg_color == 0);
07789         assert(d.datacount_bg_color == 0);
07790         assert(d.datacount_fg_bold == 0);
07791         assert(d.throughput_label_fg_color == 0);
07792         assert(d.throughput_label_bg_color == 0);
07793         assert(d.throughput_label_fg_bold == 0);
07794         assert(d.throughput_fg_color == 0);
07795         assert(d.throughput_bg_color == 0);
07796         assert(d.throughput_fg_bold == 0);
07797         assert(d.time_label_fg_color == 0);
07798         assert(d.time_label_bg_color == 0);
07799         assert(d.time_label_fg_bold == 0);
07800         assert(d.percent_fg_color == 0);
07801         assert(d.percent_bg_color == 0);
07802         assert(d.percent_fg_bold == 0);
07803         assert(d.barbrace_fg_color == 0);
07804         assert(d.barbrace_bg_color == 0);
07805         assert(d.barbrace_fg_bold == 0);
07806         assert(d.bar_fg_color == 0);
07807         assert(d.bar_bg_color == 0);
07808         assert(d.bar_fg_bold == 0);
07809         assert(io.in == 0);
07810         assert(io.out == 1);
07811         assert(io.in_ready == 0);
07812         assert(io.out_ready == 0);
07813         assert(io.eof_in == 0);
07814         assert(io.eof_out == 0);
07815         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07816         /* assert(io.cbuf == 0x0); */
07817         assert(io.last_read == 0);
07818         assert(io.last_write == 0);
07819         assert(io.total_read == 0);
07820         assert(io.total_write == 0);
07821         assert(io.total_size == 0);
07822         assert(io.total_size_known == 0);
07823         assert(io.timeout == 250000);
07824 
07825         assert(parse_args(out, argc, argv) == 0);
07826 
07827 #ifdef PRINT_DEBUG
07828         print();
07829 #endif
07830         assert(d.start_time == 0);
07831         assert(d.total_time == 0);
07832         assert(d.current_time == 0);
07833         assert(d.elapsed_time == 0);
07834         assert(d.percent_complete == 0);
07835         assert(d.display_interval == 1);
07836         assert(d.overtime_flag == 0);
07837         assert(d.k == 1024);
07838         assert(d.twiddle == '-');
07839         assert(d.manual_width == 0);
07840         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07841         assert(d.display_datacount == 1);
07842         assert(d.display_throughput == 1);
07843         assert(d.display_time == 1);
07844         assert(d.display_percent == 1);
07845         assert(d.display_bar == 1);
07846         assert(d.display_summary == 1);
07847         assert(d.display_ansi == 0);
07848         assert(d.twiddle_fg_color == 0);
07849         assert(d.twiddle_bg_color == 0);
07850         assert(d.twiddle_fg_bold == 0);
07851         assert(d.datacount_fg_color == 0);
07852         assert(d.datacount_bg_color == 0);
07853         assert(d.datacount_fg_bold == 0);
07854         assert(d.throughput_label_fg_color == 0);
07855         assert(d.throughput_label_bg_color == 0);
07856         assert(d.throughput_label_fg_bold == 0);
07857         assert(d.throughput_fg_color == 0);
07858         assert(d.throughput_bg_color == 0);
07859         assert(d.throughput_fg_bold == 0);
07860         assert(d.time_label_fg_color == 0);
07861         assert(d.time_label_bg_color == 0);
07862         assert(d.time_label_fg_bold == 0);
07863         assert(d.percent_fg_color == 0);
07864         assert(d.percent_bg_color == 0);
07865         assert(d.percent_fg_bold == 0);
07866         assert(d.barbrace_fg_color == 0);
07867         assert(d.barbrace_bg_color == 0);
07868         assert(d.barbrace_fg_bold == 0);
07869         assert(d.bar_fg_color == 0);
07870         assert(d.bar_bg_color == 0);
07871         assert(d.bar_fg_bold == 0);
07872         assert(io.in == 0);
07873         assert(io.out == 1);
07874         assert(io.in_ready == 0);
07875         assert(io.out_ready == 0);
07876         assert(io.eof_in == 0);
07877         assert(io.eof_out == 0);
07878         assert(io.buffer_size == 1074140304);
07879         /* assert(io.cbuf == 0x0); */
07880         assert(io.last_read == 0);
07881         assert(io.last_write == 0);
07882         assert(io.total_read == 0);
07883         assert(io.total_write == 0);
07884         assert(io.total_size == 0);
07885         assert(io.total_size_known == 0);
07886         assert(io.timeout == 250000);
07887 }
07888 
07889 void test59(FILE* out)
07890 {
07891         int argc = 0;
07892         char *argv[256] = { 0 };
07893 
07894         argv[argc++] = "ProgramName";
07895         argv[argc++] = "--interval";
07896 
07897         displayInit();
07898         ioInit();
07899 
07900 #ifdef PRINT_DEBUG
07901         print();
07902 #endif
07903         assert(d.start_time == 0);
07904         assert(d.total_time == 0);
07905         assert(d.current_time == 0);
07906         assert(d.elapsed_time == 0);
07907         assert(d.percent_complete == 0);
07908         assert(d.display_interval == 1);
07909         assert(d.overtime_flag == 0);
07910         assert(d.k == 1024);
07911         assert(d.twiddle == '-');
07912         assert(d.manual_width == 0);
07913         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07914         assert(d.display_datacount == 1);
07915         assert(d.display_throughput == 1);
07916         assert(d.display_time == 1);
07917         assert(d.display_percent == 1);
07918         assert(d.display_bar == 1);
07919         assert(d.display_summary == 1);
07920         assert(d.display_ansi == 0);
07921         assert(d.twiddle_fg_color == 0);
07922         assert(d.twiddle_bg_color == 0);
07923         assert(d.twiddle_fg_bold == 0);
07924         assert(d.datacount_fg_color == 0);
07925         assert(d.datacount_bg_color == 0);
07926         assert(d.datacount_fg_bold == 0);
07927         assert(d.throughput_label_fg_color == 0);
07928         assert(d.throughput_label_bg_color == 0);
07929         assert(d.throughput_label_fg_bold == 0);
07930         assert(d.throughput_fg_color == 0);
07931         assert(d.throughput_bg_color == 0);
07932         assert(d.throughput_fg_bold == 0);
07933         assert(d.time_label_fg_color == 0);
07934         assert(d.time_label_bg_color == 0);
07935         assert(d.time_label_fg_bold == 0);
07936         assert(d.percent_fg_color == 0);
07937         assert(d.percent_bg_color == 0);
07938         assert(d.percent_fg_bold == 0);
07939         assert(d.barbrace_fg_color == 0);
07940         assert(d.barbrace_bg_color == 0);
07941         assert(d.barbrace_fg_bold == 0);
07942         assert(d.bar_fg_color == 0);
07943         assert(d.bar_bg_color == 0);
07944         assert(d.bar_fg_bold == 0);
07945         assert(io.in == 0);
07946         assert(io.out == 1);
07947         assert(io.in_ready == 0);
07948         assert(io.out_ready == 0);
07949         assert(io.eof_in == 0);
07950         assert(io.eof_out == 0);
07951         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
07952         /* assert(io.cbuf == 0x0); */
07953         assert(io.last_read == 0);
07954         assert(io.last_write == 0);
07955         assert(io.total_read == 0);
07956         assert(io.total_write == 0);
07957         assert(io.total_size == 0);
07958         assert(io.total_size_known == 0);
07959         assert(io.timeout == 250000);
07960 
07961         assert(parse_args(out, argc, argv) == 1);
07962 
07963 #ifdef PRINT_DEBUG
07964         print();
07965 #endif
07966         assert(d.start_time == 0);
07967         assert(d.total_time == 0);
07968         assert(d.current_time == 0);
07969         assert(d.elapsed_time == 0);
07970         assert(d.percent_complete == 0);
07971         assert(d.display_interval == 1);
07972         assert(d.overtime_flag == 0);
07973         assert(d.k == 1024);
07974         assert(d.twiddle == '-');
07975         assert(d.manual_width == 0);
07976         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
07977         assert(d.display_datacount == 1);
07978         assert(d.display_throughput == 1);
07979         assert(d.display_time == 1);
07980         assert(d.display_percent == 1);
07981         assert(d.display_bar == 1);
07982         assert(d.display_summary == 1);
07983         assert(d.display_ansi == 0);
07984         assert(d.twiddle_fg_color == 0);
07985         assert(d.twiddle_bg_color == 0);
07986         assert(d.twiddle_fg_bold == 0);
07987         assert(d.datacount_fg_color == 0);
07988         assert(d.datacount_bg_color == 0);
07989         assert(d.datacount_fg_bold == 0);
07990         assert(d.throughput_label_fg_color == 0);
07991         assert(d.throughput_label_bg_color == 0);
07992         assert(d.throughput_label_fg_bold == 0);
07993         assert(d.throughput_fg_color == 0);
07994         assert(d.throughput_bg_color == 0);
07995         assert(d.throughput_fg_bold == 0);
07996         assert(d.time_label_fg_color == 0);
07997         assert(d.time_label_bg_color == 0);
07998         assert(d.time_label_fg_bold == 0);
07999         assert(d.percent_fg_color == 0);
08000         assert(d.percent_bg_color == 0);
08001         assert(d.percent_fg_bold == 0);
08002         assert(d.barbrace_fg_color == 0);
08003         assert(d.barbrace_bg_color == 0);
08004         assert(d.barbrace_fg_bold == 0);
08005         assert(d.bar_fg_color == 0);
08006         assert(d.bar_bg_color == 0);
08007         assert(d.bar_fg_bold == 0);
08008         assert(io.in == 0);
08009         assert(io.out == 1);
08010         assert(io.in_ready == 0);
08011         assert(io.out_ready == 0);
08012         assert(io.eof_in == 0);
08013         assert(io.eof_out == 0);
08014         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08015         /* assert(io.cbuf == 0x0); */
08016         assert(io.last_read == 0);
08017         assert(io.last_write == 0);
08018         assert(io.total_read == 0);
08019         assert(io.total_write == 0);
08020         assert(io.total_size == 0);
08021         assert(io.total_size_known == 0);
08022         assert(io.timeout == 250000);
08023 }
08024 
08025 void test60(FILE* out)
08026 {
08027         int argc = 0;
08028         char *argv[256] = { 0 };
08029 
08030         argv[argc++] = "ProgramName";
08031         argv[argc++] = "--interval";
08032         argv[argc++] = "/dev/null";
08033 
08034         displayInit();
08035         ioInit();
08036 
08037 #ifdef PRINT_DEBUG
08038         print();
08039 #endif
08040         assert(d.start_time == 0);
08041         assert(d.total_time == 0);
08042         assert(d.current_time == 0);
08043         assert(d.elapsed_time == 0);
08044         assert(d.percent_complete == 0);
08045         assert(d.display_interval == 1);
08046         assert(d.overtime_flag == 0);
08047         assert(d.k == 1024);
08048         assert(d.twiddle == '-');
08049         assert(d.manual_width == 0);
08050         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08051         assert(d.display_datacount == 1);
08052         assert(d.display_throughput == 1);
08053         assert(d.display_time == 1);
08054         assert(d.display_percent == 1);
08055         assert(d.display_bar == 1);
08056         assert(d.display_summary == 1);
08057         assert(d.display_ansi == 0);
08058         assert(d.twiddle_fg_color == 0);
08059         assert(d.twiddle_bg_color == 0);
08060         assert(d.twiddle_fg_bold == 0);
08061         assert(d.datacount_fg_color == 0);
08062         assert(d.datacount_bg_color == 0);
08063         assert(d.datacount_fg_bold == 0);
08064         assert(d.throughput_label_fg_color == 0);
08065         assert(d.throughput_label_bg_color == 0);
08066         assert(d.throughput_label_fg_bold == 0);
08067         assert(d.throughput_fg_color == 0);
08068         assert(d.throughput_bg_color == 0);
08069         assert(d.throughput_fg_bold == 0);
08070         assert(d.time_label_fg_color == 0);
08071         assert(d.time_label_bg_color == 0);
08072         assert(d.time_label_fg_bold == 0);
08073         assert(d.percent_fg_color == 0);
08074         assert(d.percent_bg_color == 0);
08075         assert(d.percent_fg_bold == 0);
08076         assert(d.barbrace_fg_color == 0);
08077         assert(d.barbrace_bg_color == 0);
08078         assert(d.barbrace_fg_bold == 0);
08079         assert(d.bar_fg_color == 0);
08080         assert(d.bar_bg_color == 0);
08081         assert(d.bar_fg_bold == 0);
08082         assert(io.in == 0);
08083         assert(io.out == 1);
08084         assert(io.in_ready == 0);
08085         assert(io.out_ready == 0);
08086         assert(io.eof_in == 0);
08087         assert(io.eof_out == 0);
08088         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08089         /* assert(io.cbuf == 0x0); */
08090         assert(io.last_read == 0);
08091         assert(io.last_write == 0);
08092         assert(io.total_read == 0);
08093         assert(io.total_write == 0);
08094         assert(io.total_size == 0);
08095         assert(io.total_size_known == 0);
08096         assert(io.timeout == 250000);
08097 
08098         assert(parse_args(out, argc, argv) == 0);
08099 
08100 #ifdef PRINT_DEBUG
08101         print();
08102 #endif
08103         assert(d.start_time == 0);
08104         assert(d.total_time == 0);
08105         assert(d.current_time == 0);
08106         assert(d.elapsed_time == 0);
08107         assert(d.percent_complete == 0);
08108         assert(d.display_interval == 1);
08109         assert(d.overtime_flag == 0);
08110         assert(d.k == 1024);
08111         assert(d.twiddle == '-');
08112         assert(d.manual_width == 0);
08113         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08114         assert(d.display_datacount == 1);
08115         assert(d.display_throughput == 1);
08116         assert(d.display_time == 1);
08117         assert(d.display_percent == 1);
08118         assert(d.display_bar == 1);
08119         assert(d.display_summary == 1);
08120         assert(d.display_ansi == 0);
08121         assert(d.twiddle_fg_color == 0);
08122         assert(d.twiddle_bg_color == 0);
08123         assert(d.twiddle_fg_bold == 0);
08124         assert(d.datacount_fg_color == 0);
08125         assert(d.datacount_bg_color == 0);
08126         assert(d.datacount_fg_bold == 0);
08127         assert(d.throughput_label_fg_color == 0);
08128         assert(d.throughput_label_bg_color == 0);
08129         assert(d.throughput_label_fg_bold == 0);
08130         assert(d.throughput_fg_color == 0);
08131         assert(d.throughput_bg_color == 0);
08132         assert(d.throughput_fg_bold == 0);
08133         assert(d.time_label_fg_color == 0);
08134         assert(d.time_label_bg_color == 0);
08135         assert(d.time_label_fg_bold == 0);
08136         assert(d.percent_fg_color == 0);
08137         assert(d.percent_bg_color == 0);
08138         assert(d.percent_fg_bold == 0);
08139         assert(d.barbrace_fg_color == 0);
08140         assert(d.barbrace_bg_color == 0);
08141         assert(d.barbrace_fg_bold == 0);
08142         assert(d.bar_fg_color == 0);
08143         assert(d.bar_bg_color == 0);
08144         assert(d.bar_fg_bold == 0);
08145         assert(io.in == 0);
08146         assert(io.out == 1);
08147         assert(io.in_ready == 0);
08148         assert(io.out_ready == 0);
08149         assert(io.eof_in == 0);
08150         assert(io.eof_out == 0);
08151         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08152         /* assert(io.cbuf == 0x0); */
08153         assert(io.last_read == 0);
08154         assert(io.last_write == 0);
08155         assert(io.total_read == 0);
08156         assert(io.total_write == 0);
08157         assert(io.total_size == 0);
08158         assert(io.total_size_known == 0);
08159         assert(io.timeout == 250000);
08160 }
08161 
08162 void test61(FILE* out)
08163 {
08164         int argc = 0;
08165         char *argv[256] = { 0 };
08166 
08167         argv[argc++] = "ProgramName";
08168         argv[argc++] = "--interval";
08169         argv[argc++] = "1024.38002m";
08170 
08171         displayInit();
08172         ioInit();
08173 
08174 #ifdef PRINT_DEBUG
08175         print();
08176 #endif
08177         assert(d.start_time == 0);
08178         assert(d.total_time == 0);
08179         assert(d.current_time == 0);
08180         assert(d.elapsed_time == 0);
08181         assert(d.percent_complete == 0);
08182         assert(d.display_interval == 1);
08183         assert(d.overtime_flag == 0);
08184         assert(d.k == 1024);
08185         assert(d.twiddle == '-');
08186         assert(d.manual_width == 0);
08187         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08188         assert(d.display_datacount == 1);
08189         assert(d.display_throughput == 1);
08190         assert(d.display_time == 1);
08191         assert(d.display_percent == 1);
08192         assert(d.display_bar == 1);
08193         assert(d.display_summary == 1);
08194         assert(d.display_ansi == 0);
08195         assert(d.twiddle_fg_color == 0);
08196         assert(d.twiddle_bg_color == 0);
08197         assert(d.twiddle_fg_bold == 0);
08198         assert(d.datacount_fg_color == 0);
08199         assert(d.datacount_bg_color == 0);
08200         assert(d.datacount_fg_bold == 0);
08201         assert(d.throughput_label_fg_color == 0);
08202         assert(d.throughput_label_bg_color == 0);
08203         assert(d.throughput_label_fg_bold == 0);
08204         assert(d.throughput_fg_color == 0);
08205         assert(d.throughput_bg_color == 0);
08206         assert(d.throughput_fg_bold == 0);
08207         assert(d.time_label_fg_color == 0);
08208         assert(d.time_label_bg_color == 0);
08209         assert(d.time_label_fg_bold == 0);
08210         assert(d.percent_fg_color == 0);
08211         assert(d.percent_bg_color == 0);
08212         assert(d.percent_fg_bold == 0);
08213         assert(d.barbrace_fg_color == 0);
08214         assert(d.barbrace_bg_color == 0);
08215         assert(d.barbrace_fg_bold == 0);
08216         assert(d.bar_fg_color == 0);
08217         assert(d.bar_bg_color == 0);
08218         assert(d.bar_fg_bold == 0);
08219         assert(io.in == 0);
08220         assert(io.out == 1);
08221         assert(io.in_ready == 0);
08222         assert(io.out_ready == 0);
08223         assert(io.eof_in == 0);
08224         assert(io.eof_out == 0);
08225         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08226         /* assert(io.cbuf == 0x0); */
08227         assert(io.last_read == 0);
08228         assert(io.last_write == 0);
08229         assert(io.total_read == 0);
08230         assert(io.total_write == 0);
08231         assert(io.total_size == 0);
08232         assert(io.total_size_known == 0);
08233         assert(io.timeout == 250000);
08234 
08235         assert(parse_args(out, argc, argv) == 0);
08236 
08237 #ifdef PRINT_DEBUG
08238         print();
08239 #endif
08240         assert(d.start_time == 0);
08241         assert(d.total_time == 0);
08242         assert(d.current_time == 0);
08243         assert(d.elapsed_time == 0);
08244         assert(d.percent_complete == 0);
08245         assert(d.display_interval == 1);
08246         assert(d.overtime_flag == 0);
08247         assert(d.k == 1024);
08248         assert(d.twiddle == '-');
08249         assert(d.manual_width == 0);
08250         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08251         assert(d.display_datacount == 1);
08252         assert(d.display_throughput == 1);
08253         assert(d.display_time == 1);
08254         assert(d.display_percent == 1);
08255         assert(d.display_bar == 1);
08256         assert(d.display_summary == 1);
08257         assert(d.display_ansi == 0);
08258         assert(d.twiddle_fg_color == 0);
08259         assert(d.twiddle_bg_color == 0);
08260         assert(d.twiddle_fg_bold == 0);
08261         assert(d.datacount_fg_color == 0);
08262         assert(d.datacount_bg_color == 0);
08263         assert(d.datacount_fg_bold == 0);
08264         assert(d.throughput_label_fg_color == 0);
08265         assert(d.throughput_label_bg_color == 0);
08266         assert(d.throughput_label_fg_bold == 0);
08267         assert(d.throughput_fg_color == 0);
08268         assert(d.throughput_bg_color == 0);
08269         assert(d.throughput_fg_bold == 0);
08270         assert(d.time_label_fg_color == 0);
08271         assert(d.time_label_bg_color == 0);
08272         assert(d.time_label_fg_bold == 0);
08273         assert(d.percent_fg_color == 0);
08274         assert(d.percent_bg_color == 0);
08275         assert(d.percent_fg_bold == 0);
08276         assert(d.barbrace_fg_color == 0);
08277         assert(d.barbrace_bg_color == 0);
08278         assert(d.barbrace_fg_bold == 0);
08279         assert(d.bar_fg_color == 0);
08280         assert(d.bar_bg_color == 0);
08281         assert(d.bar_fg_bold == 0);
08282         assert(io.in == 0);
08283         assert(io.out == 1);
08284         assert(io.in_ready == 0);
08285         assert(io.out_ready == 0);
08286         assert(io.eof_in == 0);
08287         assert(io.eof_out == 0);
08288         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08289         /* assert(io.cbuf == 0x0); */
08290         assert(io.last_read == 0);
08291         assert(io.last_write == 0);
08292         assert(io.total_read == 0);
08293         assert(io.total_write == 0);
08294         assert(io.total_size == 0);
08295         assert(io.total_size_known == 0);
08296         assert(io.timeout == 250000);
08297 }
08298 
08299 void test62(FILE* out)
08300 {
08301         int argc = 0;
08302         char *argv[256] = { 0 };
08303 
08304         argv[argc++] = "ProgramName";
08305         argv[argc++] = "--interval";
08306         argv[argc++] = "1024.38002";
08307 
08308         displayInit();
08309         ioInit();
08310 
08311 #ifdef PRINT_DEBUG
08312         print();
08313 #endif
08314         assert(d.start_time == 0);
08315         assert(d.total_time == 0);
08316         assert(d.current_time == 0);
08317         assert(d.elapsed_time == 0);
08318         assert(d.percent_complete == 0);
08319         assert(d.display_interval == 1);
08320         assert(d.overtime_flag == 0);
08321         assert(d.k == 1024);
08322         assert(d.twiddle == '-');
08323         assert(d.manual_width == 0);
08324         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08325         assert(d.display_datacount == 1);
08326         assert(d.display_throughput == 1);
08327         assert(d.display_time == 1);
08328         assert(d.display_percent == 1);
08329         assert(d.display_bar == 1);
08330         assert(d.display_summary == 1);
08331         assert(d.display_ansi == 0);
08332         assert(d.twiddle_fg_color == 0);
08333         assert(d.twiddle_bg_color == 0);
08334         assert(d.twiddle_fg_bold == 0);
08335         assert(d.datacount_fg_color == 0);
08336         assert(d.datacount_bg_color == 0);
08337         assert(d.datacount_fg_bold == 0);
08338         assert(d.throughput_label_fg_color == 0);
08339         assert(d.throughput_label_bg_color == 0);
08340         assert(d.throughput_label_fg_bold == 0);
08341         assert(d.throughput_fg_color == 0);
08342         assert(d.throughput_bg_color == 0);
08343         assert(d.throughput_fg_bold == 0);
08344         assert(d.time_label_fg_color == 0);
08345         assert(d.time_label_bg_color == 0);
08346         assert(d.time_label_fg_bold == 0);
08347         assert(d.percent_fg_color == 0);
08348         assert(d.percent_bg_color == 0);
08349         assert(d.percent_fg_bold == 0);
08350         assert(d.barbrace_fg_color == 0);
08351         assert(d.barbrace_bg_color == 0);
08352         assert(d.barbrace_fg_bold == 0);
08353         assert(d.bar_fg_color == 0);
08354         assert(d.bar_bg_color == 0);
08355         assert(d.bar_fg_bold == 0);
08356         assert(io.in == 0);
08357         assert(io.out == 1);
08358         assert(io.in_ready == 0);
08359         assert(io.out_ready == 0);
08360         assert(io.eof_in == 0);
08361         assert(io.eof_out == 0);
08362         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08363         /* assert(io.cbuf == 0x0); */
08364         assert(io.last_read == 0);
08365         assert(io.last_write == 0);
08366         assert(io.total_read == 0);
08367         assert(io.total_write == 0);
08368         assert(io.total_size == 0);
08369         assert(io.total_size_known == 0);
08370         assert(io.timeout == 250000);
08371 
08372         assert(parse_args(out, argc, argv) == 0);
08373 
08374 #ifdef PRINT_DEBUG
08375         print();
08376 #endif
08377         assert(d.start_time == 0);
08378         assert(d.total_time == 0);
08379         assert(d.current_time == 0);
08380         assert(d.elapsed_time == 0);
08381         assert(d.percent_complete == 0);
08382         assert(d.display_interval == 1);
08383         assert(d.overtime_flag == 0);
08384         assert(d.k == 1024);
08385         assert(d.twiddle == '-');
08386         assert(d.manual_width == 0);
08387         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08388         assert(d.display_datacount == 1);
08389         assert(d.display_throughput == 1);
08390         assert(d.display_time == 1);
08391         assert(d.display_percent == 1);
08392         assert(d.display_bar == 1);
08393         assert(d.display_summary == 1);
08394         assert(d.display_ansi == 0);
08395         assert(d.twiddle_fg_color == 0);
08396         assert(d.twiddle_bg_color == 0);
08397         assert(d.twiddle_fg_bold == 0);
08398         assert(d.datacount_fg_color == 0);
08399         assert(d.datacount_bg_color == 0);
08400         assert(d.datacount_fg_bold == 0);
08401         assert(d.throughput_label_fg_color == 0);
08402         assert(d.throughput_label_bg_color == 0);
08403         assert(d.throughput_label_fg_bold == 0);
08404         assert(d.throughput_fg_color == 0);
08405         assert(d.throughput_bg_color == 0);
08406         assert(d.throughput_fg_bold == 0);
08407         assert(d.time_label_fg_color == 0);
08408         assert(d.time_label_bg_color == 0);
08409         assert(d.time_label_fg_bold == 0);
08410         assert(d.percent_fg_color == 0);
08411         assert(d.percent_bg_color == 0);
08412         assert(d.percent_fg_bold == 0);
08413         assert(d.barbrace_fg_color == 0);
08414         assert(d.barbrace_bg_color == 0);
08415         assert(d.barbrace_fg_bold == 0);
08416         assert(d.bar_fg_color == 0);
08417         assert(d.bar_bg_color == 0);
08418         assert(d.bar_fg_bold == 0);
08419         assert(io.in == 0);
08420         assert(io.out == 1);
08421         assert(io.in_ready == 0);
08422         assert(io.out_ready == 0);
08423         assert(io.eof_in == 0);
08424         assert(io.eof_out == 0);
08425         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08426         /* assert(io.cbuf == 0x0); */
08427         assert(io.last_read == 0);
08428         assert(io.last_write == 0);
08429         assert(io.total_read == 0);
08430         assert(io.total_write == 0);
08431         assert(io.total_size == 0);
08432         assert(io.total_size_known == 0);
08433         assert(io.timeout == 250000);
08434 }
08435 
08436 void test63(FILE* out)
08437 {
08438         int argc = 0;
08439         char *argv[256] = { 0 };
08440 
08441         argv[argc++] = "ProgramName";
08442         argv[argc++] = "--interval";
08443         argv[argc++] = "30";
08444 
08445         displayInit();
08446         ioInit();
08447 
08448 #ifdef PRINT_DEBUG
08449         print();
08450 #endif
08451         assert(d.start_time == 0);
08452         assert(d.total_time == 0);
08453         assert(d.current_time == 0);
08454         assert(d.elapsed_time == 0);
08455         assert(d.percent_complete == 0);
08456         assert(d.display_interval == 1);
08457         assert(d.overtime_flag == 0);
08458         assert(d.k == 1024);
08459         assert(d.twiddle == '-');
08460         assert(d.manual_width == 0);
08461         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08462         assert(d.display_datacount == 1);
08463         assert(d.display_throughput == 1);
08464         assert(d.display_time == 1);
08465         assert(d.display_percent == 1);
08466         assert(d.display_bar == 1);
08467         assert(d.display_summary == 1);
08468         assert(d.display_ansi == 0);
08469         assert(d.twiddle_fg_color == 0);
08470         assert(d.twiddle_bg_color == 0);
08471         assert(d.twiddle_fg_bold == 0);
08472         assert(d.datacount_fg_color == 0);
08473         assert(d.datacount_bg_color == 0);
08474         assert(d.datacount_fg_bold == 0);
08475         assert(d.throughput_label_fg_color == 0);
08476         assert(d.throughput_label_bg_color == 0);
08477         assert(d.throughput_label_fg_bold == 0);
08478         assert(d.throughput_fg_color == 0);
08479         assert(d.throughput_bg_color == 0);
08480         assert(d.throughput_fg_bold == 0);
08481         assert(d.time_label_fg_color == 0);
08482         assert(d.time_label_bg_color == 0);
08483         assert(d.time_label_fg_bold == 0);
08484         assert(d.percent_fg_color == 0);
08485         assert(d.percent_bg_color == 0);
08486         assert(d.percent_fg_bold == 0);
08487         assert(d.barbrace_fg_color == 0);
08488         assert(d.barbrace_bg_color == 0);
08489         assert(d.barbrace_fg_bold == 0);
08490         assert(d.bar_fg_color == 0);
08491         assert(d.bar_bg_color == 0);
08492         assert(d.bar_fg_bold == 0);
08493         assert(io.in == 0);
08494         assert(io.out == 1);
08495         assert(io.in_ready == 0);
08496         assert(io.out_ready == 0);
08497         assert(io.eof_in == 0);
08498         assert(io.eof_out == 0);
08499         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08500         /* assert(io.cbuf == 0x0); */
08501         assert(io.last_read == 0);
08502         assert(io.last_write == 0);
08503         assert(io.total_read == 0);
08504         assert(io.total_write == 0);
08505         assert(io.total_size == 0);
08506         assert(io.total_size_known == 0);
08507         assert(io.timeout == 250000);
08508 
08509         assert(parse_args(out, argc, argv) == 0);
08510 
08511 #ifdef PRINT_DEBUG
08512         print();
08513 #endif
08514         assert(d.start_time == 0);
08515         assert(d.total_time == 0);
08516         assert(d.current_time == 0);
08517         assert(d.elapsed_time == 0);
08518         assert(d.percent_complete == 0);
08519         assert(d.display_interval == 30);
08520         assert(d.overtime_flag == 0);
08521         assert(d.k == 1024);
08522         assert(d.twiddle == '-');
08523         assert(d.manual_width == 0);
08524         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08525         assert(d.display_datacount == 1);
08526         assert(d.display_throughput == 1);
08527         assert(d.display_time == 1);
08528         assert(d.display_percent == 1);
08529         assert(d.display_bar == 1);
08530         assert(d.display_summary == 1);
08531         assert(d.display_ansi == 0);
08532         assert(d.twiddle_fg_color == 0);
08533         assert(d.twiddle_bg_color == 0);
08534         assert(d.twiddle_fg_bold == 0);
08535         assert(d.datacount_fg_color == 0);
08536         assert(d.datacount_bg_color == 0);
08537         assert(d.datacount_fg_bold == 0);
08538         assert(d.throughput_label_fg_color == 0);
08539         assert(d.throughput_label_bg_color == 0);
08540         assert(d.throughput_label_fg_bold == 0);
08541         assert(d.throughput_fg_color == 0);
08542         assert(d.throughput_bg_color == 0);
08543         assert(d.throughput_fg_bold == 0);
08544         assert(d.time_label_fg_color == 0);
08545         assert(d.time_label_bg_color == 0);
08546         assert(d.time_label_fg_bold == 0);
08547         assert(d.percent_fg_color == 0);
08548         assert(d.percent_bg_color == 0);
08549         assert(d.percent_fg_bold == 0);
08550         assert(d.barbrace_fg_color == 0);
08551         assert(d.barbrace_bg_color == 0);
08552         assert(d.barbrace_fg_bold == 0);
08553         assert(d.bar_fg_color == 0);
08554         assert(d.bar_bg_color == 0);
08555         assert(d.bar_fg_bold == 0);
08556         assert(io.in == 0);
08557         assert(io.out == 1);
08558         assert(io.in_ready == 0);
08559         assert(io.out_ready == 0);
08560         assert(io.eof_in == 0);
08561         assert(io.eof_out == 0);
08562         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08563         /* assert(io.cbuf == 0x0); */
08564         assert(io.last_read == 0);
08565         assert(io.last_write == 0);
08566         assert(io.total_read == 0);
08567         assert(io.total_write == 0);
08568         assert(io.total_size == 0);
08569         assert(io.total_size_known == 0);
08570         assert(io.timeout == 250000);
08571 }
08572 
08573 void test64(FILE* out)
08574 {
08575         int argc = 0;
08576         char *argv[256] = { 0 };
08577 
08578         argv[argc++] = "ProgramName";
08579         argv[argc++] = "--timeout";
08580 
08581         displayInit();
08582         ioInit();
08583 
08584 #ifdef PRINT_DEBUG
08585         print();
08586 #endif
08587         assert(d.start_time == 0);
08588         assert(d.total_time == 0);
08589         assert(d.current_time == 0);
08590         assert(d.elapsed_time == 0);
08591         assert(d.percent_complete == 0);
08592         assert(d.display_interval == 1);
08593         assert(d.overtime_flag == 0);
08594         assert(d.k == 1024);
08595         assert(d.twiddle == '-');
08596         assert(d.manual_width == 0);
08597         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08598         assert(d.display_datacount == 1);
08599         assert(d.display_throughput == 1);
08600         assert(d.display_time == 1);
08601         assert(d.display_percent == 1);
08602         assert(d.display_bar == 1);
08603         assert(d.display_summary == 1);
08604         assert(d.display_ansi == 0);
08605         assert(d.twiddle_fg_color == 0);
08606         assert(d.twiddle_bg_color == 0);
08607         assert(d.twiddle_fg_bold == 0);
08608         assert(d.datacount_fg_color == 0);
08609         assert(d.datacount_bg_color == 0);
08610         assert(d.datacount_fg_bold == 0);
08611         assert(d.throughput_label_fg_color == 0);
08612         assert(d.throughput_label_bg_color == 0);
08613         assert(d.throughput_label_fg_bold == 0);
08614         assert(d.throughput_fg_color == 0);
08615         assert(d.throughput_bg_color == 0);
08616         assert(d.throughput_fg_bold == 0);
08617         assert(d.time_label_fg_color == 0);
08618         assert(d.time_label_bg_color == 0);
08619         assert(d.time_label_fg_bold == 0);
08620         assert(d.percent_fg_color == 0);
08621         assert(d.percent_bg_color == 0);
08622         assert(d.percent_fg_bold == 0);
08623         assert(d.barbrace_fg_color == 0);
08624         assert(d.barbrace_bg_color == 0);
08625         assert(d.barbrace_fg_bold == 0);
08626         assert(d.bar_fg_color == 0);
08627         assert(d.bar_bg_color == 0);
08628         assert(d.bar_fg_bold == 0);
08629         assert(io.in == 0);
08630         assert(io.out == 1);
08631         assert(io.in_ready == 0);
08632         assert(io.out_ready == 0);
08633         assert(io.eof_in == 0);
08634         assert(io.eof_out == 0);
08635         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08636         /* assert(io.cbuf == 0x0); */
08637         assert(io.last_read == 0);
08638         assert(io.last_write == 0);
08639         assert(io.total_read == 0);
08640         assert(io.total_write == 0);
08641         assert(io.total_size == 0);
08642         assert(io.total_size_known == 0);
08643         assert(io.timeout == 250000);
08644 
08645         assert(parse_args(out, argc, argv) == 1);
08646 
08647 #ifdef PRINT_DEBUG
08648         print();
08649 #endif
08650         assert(d.start_time == 0);
08651         assert(d.total_time == 0);
08652         assert(d.current_time == 0);
08653         assert(d.elapsed_time == 0);
08654         assert(d.percent_complete == 0);
08655         assert(d.display_interval == 1);
08656         assert(d.overtime_flag == 0);
08657         assert(d.k == 1024);
08658         assert(d.twiddle == '-');
08659         assert(d.manual_width == 0);
08660         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08661         assert(d.display_datacount == 1);
08662         assert(d.display_throughput == 1);
08663         assert(d.display_time == 1);
08664         assert(d.display_percent == 1);
08665         assert(d.display_bar == 1);
08666         assert(d.display_summary == 1);
08667         assert(d.display_ansi == 0);
08668         assert(d.twiddle_fg_color == 0);
08669         assert(d.twiddle_bg_color == 0);
08670         assert(d.twiddle_fg_bold == 0);
08671         assert(d.datacount_fg_color == 0);
08672         assert(d.datacount_bg_color == 0);
08673         assert(d.datacount_fg_bold == 0);
08674         assert(d.throughput_label_fg_color == 0);
08675         assert(d.throughput_label_bg_color == 0);
08676         assert(d.throughput_label_fg_bold == 0);
08677         assert(d.throughput_fg_color == 0);
08678         assert(d.throughput_bg_color == 0);
08679         assert(d.throughput_fg_bold == 0);
08680         assert(d.time_label_fg_color == 0);
08681         assert(d.time_label_bg_color == 0);
08682         assert(d.time_label_fg_bold == 0);
08683         assert(d.percent_fg_color == 0);
08684         assert(d.percent_bg_color == 0);
08685         assert(d.percent_fg_bold == 0);
08686         assert(d.barbrace_fg_color == 0);
08687         assert(d.barbrace_bg_color == 0);
08688         assert(d.barbrace_fg_bold == 0);
08689         assert(d.bar_fg_color == 0);
08690         assert(d.bar_bg_color == 0);
08691         assert(d.bar_fg_bold == 0);
08692         assert(io.in == 0);
08693         assert(io.out == 1);
08694         assert(io.in_ready == 0);
08695         assert(io.out_ready == 0);
08696         assert(io.eof_in == 0);
08697         assert(io.eof_out == 0);
08698         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08699         /* assert(io.cbuf == 0x0); */
08700         assert(io.last_read == 0);
08701         assert(io.last_write == 0);
08702         assert(io.total_read == 0);
08703         assert(io.total_write == 0);
08704         assert(io.total_size == 0);
08705         assert(io.total_size_known == 0);
08706         assert(io.timeout == 250000);
08707 }
08708 
08709 void test65(FILE* out)
08710 {
08711         int argc = 0;
08712         char *argv[256] = { 0 };
08713 
08714         argv[argc++] = "ProgramName";
08715         argv[argc++] = "--timeout";
08716         argv[argc++] = "/dev/null";
08717 
08718         displayInit();
08719         ioInit();
08720 
08721 #ifdef PRINT_DEBUG
08722         print();
08723 #endif
08724         assert(d.start_time == 0);
08725         assert(d.total_time == 0);
08726         assert(d.current_time == 0);
08727         assert(d.elapsed_time == 0);
08728         assert(d.percent_complete == 0);
08729         assert(d.display_interval == 1);
08730         assert(d.overtime_flag == 0);
08731         assert(d.k == 1024);
08732         assert(d.twiddle == '-');
08733         assert(d.manual_width == 0);
08734         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08735         assert(d.display_datacount == 1);
08736         assert(d.display_throughput == 1);
08737         assert(d.display_time == 1);
08738         assert(d.display_percent == 1);
08739         assert(d.display_bar == 1);
08740         assert(d.display_summary == 1);
08741         assert(d.display_ansi == 0);
08742         assert(d.twiddle_fg_color == 0);
08743         assert(d.twiddle_bg_color == 0);
08744         assert(d.twiddle_fg_bold == 0);
08745         assert(d.datacount_fg_color == 0);
08746         assert(d.datacount_bg_color == 0);
08747         assert(d.datacount_fg_bold == 0);
08748         assert(d.throughput_label_fg_color == 0);
08749         assert(d.throughput_label_bg_color == 0);
08750         assert(d.throughput_label_fg_bold == 0);
08751         assert(d.throughput_fg_color == 0);
08752         assert(d.throughput_bg_color == 0);
08753         assert(d.throughput_fg_bold == 0);
08754         assert(d.time_label_fg_color == 0);
08755         assert(d.time_label_bg_color == 0);
08756         assert(d.time_label_fg_bold == 0);
08757         assert(d.percent_fg_color == 0);
08758         assert(d.percent_bg_color == 0);
08759         assert(d.percent_fg_bold == 0);
08760         assert(d.barbrace_fg_color == 0);
08761         assert(d.barbrace_bg_color == 0);
08762         assert(d.barbrace_fg_bold == 0);
08763         assert(d.bar_fg_color == 0);
08764         assert(d.bar_bg_color == 0);
08765         assert(d.bar_fg_bold == 0);
08766         assert(io.in == 0);
08767         assert(io.out == 1);
08768         assert(io.in_ready == 0);
08769         assert(io.out_ready == 0);
08770         assert(io.eof_in == 0);
08771         assert(io.eof_out == 0);
08772         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08773         /* assert(io.cbuf == 0x0); */
08774         assert(io.last_read == 0);
08775         assert(io.last_write == 0);
08776         assert(io.total_read == 0);
08777         assert(io.total_write == 0);
08778         assert(io.total_size == 0);
08779         assert(io.total_size_known == 0);
08780         assert(io.timeout == 250000);
08781 
08782         assert(parse_args(out, argc, argv) == 0);
08783 
08784 #ifdef PRINT_DEBUG
08785         print();
08786 #endif
08787         assert(d.start_time == 0);
08788         assert(d.total_time == 0);
08789         assert(d.current_time == 0);
08790         assert(d.elapsed_time == 0);
08791         assert(d.percent_complete == 0);
08792         assert(d.display_interval == 1);
08793         assert(d.overtime_flag == 0);
08794         assert(d.k == 1024);
08795         assert(d.twiddle == '-');
08796         assert(d.manual_width == 0);
08797         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08798         assert(d.display_datacount == 1);
08799         assert(d.display_throughput == 1);
08800         assert(d.display_time == 1);
08801         assert(d.display_percent == 1);
08802         assert(d.display_bar == 1);
08803         assert(d.display_summary == 1);
08804         assert(d.display_ansi == 0);
08805         assert(d.twiddle_fg_color == 0);
08806         assert(d.twiddle_bg_color == 0);
08807         assert(d.twiddle_fg_bold == 0);
08808         assert(d.datacount_fg_color == 0);
08809         assert(d.datacount_bg_color == 0);
08810         assert(d.datacount_fg_bold == 0);
08811         assert(d.throughput_label_fg_color == 0);
08812         assert(d.throughput_label_bg_color == 0);
08813         assert(d.throughput_label_fg_bold == 0);
08814         assert(d.throughput_fg_color == 0);
08815         assert(d.throughput_bg_color == 0);
08816         assert(d.throughput_fg_bold == 0);
08817         assert(d.time_label_fg_color == 0);
08818         assert(d.time_label_bg_color == 0);
08819         assert(d.time_label_fg_bold == 0);
08820         assert(d.percent_fg_color == 0);
08821         assert(d.percent_bg_color == 0);
08822         assert(d.percent_fg_bold == 0);
08823         assert(d.barbrace_fg_color == 0);
08824         assert(d.barbrace_bg_color == 0);
08825         assert(d.barbrace_fg_bold == 0);
08826         assert(d.bar_fg_color == 0);
08827         assert(d.bar_bg_color == 0);
08828         assert(d.bar_fg_bold == 0);
08829         assert(io.in == 0);
08830         assert(io.out == 1);
08831         assert(io.in_ready == 0);
08832         assert(io.out_ready == 0);
08833         assert(io.eof_in == 0);
08834         assert(io.eof_out == 0);
08835         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08836         /* assert(io.cbuf == 0x0); */
08837         assert(io.last_read == 0);
08838         assert(io.last_write == 0);
08839         assert(io.total_read == 0);
08840         assert(io.total_write == 0);
08841         assert(io.total_size == 0);
08842         assert(io.total_size_known == 0);
08843         assert(io.timeout == 250000);
08844 }
08845 
08846 void test66(FILE* out)
08847 {
08848         int argc = 0;
08849         char *argv[256] = { 0 };
08850 
08851         argv[argc++] = "ProgramName";
08852         argv[argc++] = "--timeout";
08853         argv[argc++] = "1024.38002m";
08854 
08855         displayInit();
08856         ioInit();
08857 
08858 #ifdef PRINT_DEBUG
08859         print();
08860 #endif
08861         assert(d.start_time == 0);
08862         assert(d.total_time == 0);
08863         assert(d.current_time == 0);
08864         assert(d.elapsed_time == 0);
08865         assert(d.percent_complete == 0);
08866         assert(d.display_interval == 1);
08867         assert(d.overtime_flag == 0);
08868         assert(d.k == 1024);
08869         assert(d.twiddle == '-');
08870         assert(d.manual_width == 0);
08871         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08872         assert(d.display_datacount == 1);
08873         assert(d.display_throughput == 1);
08874         assert(d.display_time == 1);
08875         assert(d.display_percent == 1);
08876         assert(d.display_bar == 1);
08877         assert(d.display_summary == 1);
08878         assert(d.display_ansi == 0);
08879         assert(d.twiddle_fg_color == 0);
08880         assert(d.twiddle_bg_color == 0);
08881         assert(d.twiddle_fg_bold == 0);
08882         assert(d.datacount_fg_color == 0);
08883         assert(d.datacount_bg_color == 0);
08884         assert(d.datacount_fg_bold == 0);
08885         assert(d.throughput_label_fg_color == 0);
08886         assert(d.throughput_label_bg_color == 0);
08887         assert(d.throughput_label_fg_bold == 0);
08888         assert(d.throughput_fg_color == 0);
08889         assert(d.throughput_bg_color == 0);
08890         assert(d.throughput_fg_bold == 0);
08891         assert(d.time_label_fg_color == 0);
08892         assert(d.time_label_bg_color == 0);
08893         assert(d.time_label_fg_bold == 0);
08894         assert(d.percent_fg_color == 0);
08895         assert(d.percent_bg_color == 0);
08896         assert(d.percent_fg_bold == 0);
08897         assert(d.barbrace_fg_color == 0);
08898         assert(d.barbrace_bg_color == 0);
08899         assert(d.barbrace_fg_bold == 0);
08900         assert(d.bar_fg_color == 0);
08901         assert(d.bar_bg_color == 0);
08902         assert(d.bar_fg_bold == 0);
08903         assert(io.in == 0);
08904         assert(io.out == 1);
08905         assert(io.in_ready == 0);
08906         assert(io.out_ready == 0);
08907         assert(io.eof_in == 0);
08908         assert(io.eof_out == 0);
08909         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08910         /* assert(io.cbuf == 0x0); */
08911         assert(io.last_read == 0);
08912         assert(io.last_write == 0);
08913         assert(io.total_read == 0);
08914         assert(io.total_write == 0);
08915         assert(io.total_size == 0);
08916         assert(io.total_size_known == 0);
08917         assert(io.timeout == 250000);
08918 
08919         assert(parse_args(out, argc, argv) == 0);
08920 
08921 #ifdef PRINT_DEBUG
08922         print();
08923 #endif
08924         assert(d.start_time == 0);
08925         assert(d.total_time == 0);
08926         assert(d.current_time == 0);
08927         assert(d.elapsed_time == 0);
08928         assert(d.percent_complete == 0);
08929         assert(d.display_interval == 1);
08930         assert(d.overtime_flag == 0);
08931         assert(d.k == 1024);
08932         assert(d.twiddle == '-');
08933         assert(d.manual_width == 0);
08934         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
08935         assert(d.display_datacount == 1);
08936         assert(d.display_throughput == 1);
08937         assert(d.display_time == 1);
08938         assert(d.display_percent == 1);
08939         assert(d.display_bar == 1);
08940         assert(d.display_summary == 1);
08941         assert(d.display_ansi == 0);
08942         assert(d.twiddle_fg_color == 0);
08943         assert(d.twiddle_bg_color == 0);
08944         assert(d.twiddle_fg_bold == 0);
08945         assert(d.datacount_fg_color == 0);
08946         assert(d.datacount_bg_color == 0);
08947         assert(d.datacount_fg_bold == 0);
08948         assert(d.throughput_label_fg_color == 0);
08949         assert(d.throughput_label_bg_color == 0);
08950         assert(d.throughput_label_fg_bold == 0);
08951         assert(d.throughput_fg_color == 0);
08952         assert(d.throughput_bg_color == 0);
08953         assert(d.throughput_fg_bold == 0);
08954         assert(d.time_label_fg_color == 0);
08955         assert(d.time_label_bg_color == 0);
08956         assert(d.time_label_fg_bold == 0);
08957         assert(d.percent_fg_color == 0);
08958         assert(d.percent_bg_color == 0);
08959         assert(d.percent_fg_bold == 0);
08960         assert(d.barbrace_fg_color == 0);
08961         assert(d.barbrace_bg_color == 0);
08962         assert(d.barbrace_fg_bold == 0);
08963         assert(d.bar_fg_color == 0);
08964         assert(d.bar_bg_color == 0);
08965         assert(d.bar_fg_bold == 0);
08966         assert(io.in == 0);
08967         assert(io.out == 1);
08968         assert(io.in_ready == 0);
08969         assert(io.out_ready == 0);
08970         assert(io.eof_in == 0);
08971         assert(io.eof_out == 0);
08972         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
08973         /* assert(io.cbuf == 0x0); */
08974         assert(io.last_read == 0);
08975         assert(io.last_write == 0);
08976         assert(io.total_read == 0);
08977         assert(io.total_write == 0);
08978         assert(io.total_size == 0);
08979         assert(io.total_size_known == 0);
08980         assert(io.timeout == 250000);
08981 }
08982 
08983 void test67(FILE* out)
08984 {
08985         int argc = 0;
08986         char *argv[256] = { 0 };
08987 
08988         argv[argc++] = "ProgramName";
08989         argv[argc++] = "--timeout";
08990         argv[argc++] = "1024.38002";
08991 
08992         displayInit();
08993         ioInit();
08994 
08995 #ifdef PRINT_DEBUG
08996         print();
08997 #endif
08998         assert(d.start_time == 0);
08999         assert(d.total_time == 0);
09000         assert(d.current_time == 0);
09001         assert(d.elapsed_time == 0);
09002         assert(d.percent_complete == 0);
09003         assert(d.display_interval == 1);
09004         assert(d.overtime_flag == 0);
09005         assert(d.k == 1024);
09006         assert(d.twiddle == '-');
09007         assert(d.manual_width == 0);
09008         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09009         assert(d.display_datacount == 1);
09010         assert(d.display_throughput == 1);
09011         assert(d.display_time == 1);
09012         assert(d.display_percent == 1);
09013         assert(d.display_bar == 1);
09014         assert(d.display_summary == 1);
09015         assert(d.display_ansi == 0);
09016         assert(d.twiddle_fg_color == 0);
09017         assert(d.twiddle_bg_color == 0);
09018         assert(d.twiddle_fg_bold == 0);
09019         assert(d.datacount_fg_color == 0);
09020         assert(d.datacount_bg_color == 0);
09021         assert(d.datacount_fg_bold == 0);
09022         assert(d.throughput_label_fg_color == 0);
09023         assert(d.throughput_label_bg_color == 0);
09024         assert(d.throughput_label_fg_bold == 0);
09025         assert(d.throughput_fg_color == 0);
09026         assert(d.throughput_bg_color == 0);
09027         assert(d.throughput_fg_bold == 0);
09028         assert(d.time_label_fg_color == 0);
09029         assert(d.time_label_bg_color == 0);
09030         assert(d.time_label_fg_bold == 0);
09031         assert(d.percent_fg_color == 0);
09032         assert(d.percent_bg_color == 0);
09033         assert(d.percent_fg_bold == 0);
09034         assert(d.barbrace_fg_color == 0);
09035         assert(d.barbrace_bg_color == 0);
09036         assert(d.barbrace_fg_bold == 0);
09037         assert(d.bar_fg_color == 0);
09038         assert(d.bar_bg_color == 0);
09039         assert(d.bar_fg_bold == 0);
09040         assert(io.in == 0);
09041         assert(io.out == 1);
09042         assert(io.in_ready == 0);
09043         assert(io.out_ready == 0);
09044         assert(io.eof_in == 0);
09045         assert(io.eof_out == 0);
09046         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09047         /* assert(io.cbuf == 0x0); */
09048         assert(io.last_read == 0);
09049         assert(io.last_write == 0);
09050         assert(io.total_read == 0);
09051         assert(io.total_write == 0);
09052         assert(io.total_size == 0);
09053         assert(io.total_size_known == 0);
09054         assert(io.timeout == 250000);
09055 
09056         assert(parse_args(out, argc, argv) == 0);
09057 
09058 #ifdef PRINT_DEBUG
09059         print();
09060 #endif
09061         assert(d.start_time == 0);
09062         assert(d.total_time == 0);
09063         assert(d.current_time == 0);
09064         assert(d.elapsed_time == 0);
09065         assert(d.percent_complete == 0);
09066         assert(d.display_interval == 1);
09067         assert(d.overtime_flag == 0);
09068         assert(d.k == 1024);
09069         assert(d.twiddle == '-');
09070         assert(d.manual_width == 0);
09071         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09072         assert(d.display_datacount == 1);
09073         assert(d.display_throughput == 1);
09074         assert(d.display_time == 1);
09075         assert(d.display_percent == 1);
09076         assert(d.display_bar == 1);
09077         assert(d.display_summary == 1);
09078         assert(d.display_ansi == 0);
09079         assert(d.twiddle_fg_color == 0);
09080         assert(d.twiddle_bg_color == 0);
09081         assert(d.twiddle_fg_bold == 0);
09082         assert(d.datacount_fg_color == 0);
09083         assert(d.datacount_bg_color == 0);
09084         assert(d.datacount_fg_bold == 0);
09085         assert(d.throughput_label_fg_color == 0);
09086         assert(d.throughput_label_bg_color == 0);
09087         assert(d.throughput_label_fg_bold == 0);
09088         assert(d.throughput_fg_color == 0);
09089         assert(d.throughput_bg_color == 0);
09090         assert(d.throughput_fg_bold == 0);
09091         assert(d.time_label_fg_color == 0);
09092         assert(d.time_label_bg_color == 0);
09093         assert(d.time_label_fg_bold == 0);
09094         assert(d.percent_fg_color == 0);
09095         assert(d.percent_bg_color == 0);
09096         assert(d.percent_fg_bold == 0);
09097         assert(d.barbrace_fg_color == 0);
09098         assert(d.barbrace_bg_color == 0);
09099         assert(d.barbrace_fg_bold == 0);
09100         assert(d.bar_fg_color == 0);
09101         assert(d.bar_bg_color == 0);
09102         assert(d.bar_fg_bold == 0);
09103         assert(io.in == 0);
09104         assert(io.out == 1);
09105         assert(io.in_ready == 0);
09106         assert(io.out_ready == 0);
09107         assert(io.eof_in == 0);
09108         assert(io.eof_out == 0);
09109         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09110         /* assert(io.cbuf == 0x0); */
09111         assert(io.last_read == 0);
09112         assert(io.last_write == 0);
09113         assert(io.total_read == 0);
09114         assert(io.total_write == 0);
09115         assert(io.total_size == 0);
09116         assert(io.total_size_known == 0);
09117         assert(io.timeout == 250000);
09118 }
09119 
09120 void test68(FILE* out)
09121 {
09122         int argc = 0;
09123         char *argv[256] = { 0 };
09124 
09125         argv[argc++] = "ProgramName";
09126         argv[argc++] = "--timeout";
09127         argv[argc++] = "30";
09128 
09129         displayInit();
09130         ioInit();
09131 
09132 #ifdef PRINT_DEBUG
09133         print();
09134 #endif
09135         assert(d.start_time == 0);
09136         assert(d.total_time == 0);
09137         assert(d.current_time == 0);
09138         assert(d.elapsed_time == 0);
09139         assert(d.percent_complete == 0);
09140         assert(d.display_interval == 1);
09141         assert(d.overtime_flag == 0);
09142         assert(d.k == 1024);
09143         assert(d.twiddle == '-');
09144         assert(d.manual_width == 0);
09145         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09146         assert(d.display_datacount == 1);
09147         assert(d.display_throughput == 1);
09148         assert(d.display_time == 1);
09149         assert(d.display_percent == 1);
09150         assert(d.display_bar == 1);
09151         assert(d.display_summary == 1);
09152         assert(d.display_ansi == 0);
09153         assert(d.twiddle_fg_color == 0);
09154         assert(d.twiddle_bg_color == 0);
09155         assert(d.twiddle_fg_bold == 0);
09156         assert(d.datacount_fg_color == 0);
09157         assert(d.datacount_bg_color == 0);
09158         assert(d.datacount_fg_bold == 0);
09159         assert(d.throughput_label_fg_color == 0);
09160         assert(d.throughput_label_bg_color == 0);
09161         assert(d.throughput_label_fg_bold == 0);
09162         assert(d.throughput_fg_color == 0);
09163         assert(d.throughput_bg_color == 0);
09164         assert(d.throughput_fg_bold == 0);
09165         assert(d.time_label_fg_color == 0);
09166         assert(d.time_label_bg_color == 0);
09167         assert(d.time_label_fg_bold == 0);
09168         assert(d.percent_fg_color == 0);
09169         assert(d.percent_bg_color == 0);
09170         assert(d.percent_fg_bold == 0);
09171         assert(d.barbrace_fg_color == 0);
09172         assert(d.barbrace_bg_color == 0);
09173         assert(d.barbrace_fg_bold == 0);
09174         assert(d.bar_fg_color == 0);
09175         assert(d.bar_bg_color == 0);
09176         assert(d.bar_fg_bold == 0);
09177         assert(io.in == 0);
09178         assert(io.out == 1);
09179         assert(io.in_ready == 0);
09180         assert(io.out_ready == 0);
09181         assert(io.eof_in == 0);
09182         assert(io.eof_out == 0);
09183         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09184         /* assert(io.cbuf == 0x0); */
09185         assert(io.last_read == 0);
09186         assert(io.last_write == 0);
09187         assert(io.total_read == 0);
09188         assert(io.total_write == 0);
09189         assert(io.total_size == 0);
09190         assert(io.total_size_known == 0);
09191         assert(io.timeout == 250000);
09192 
09193         assert(parse_args(out, argc, argv) == 0);
09194 
09195 #ifdef PRINT_DEBUG
09196         print();
09197 #endif
09198         assert(d.start_time == 0);
09199         assert(d.total_time == 0);
09200         assert(d.current_time == 0);
09201         assert(d.elapsed_time == 0);
09202         assert(d.percent_complete == 0);
09203         assert(d.display_interval == 1);
09204         assert(d.overtime_flag == 0);
09205         assert(d.k == 1024);
09206         assert(d.twiddle == '-');
09207         assert(d.manual_width == 0);
09208         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09209         assert(d.display_datacount == 1);
09210         assert(d.display_throughput == 1);
09211         assert(d.display_time == 1);
09212         assert(d.display_percent == 1);
09213         assert(d.display_bar == 1);
09214         assert(d.display_summary == 1);
09215         assert(d.display_ansi == 0);
09216         assert(d.twiddle_fg_color == 0);
09217         assert(d.twiddle_bg_color == 0);
09218         assert(d.twiddle_fg_bold == 0);
09219         assert(d.datacount_fg_color == 0);
09220         assert(d.datacount_bg_color == 0);
09221         assert(d.datacount_fg_bold == 0);
09222         assert(d.throughput_label_fg_color == 0);
09223         assert(d.throughput_label_bg_color == 0);
09224         assert(d.throughput_label_fg_bold == 0);
09225         assert(d.throughput_fg_color == 0);
09226         assert(d.throughput_bg_color == 0);
09227         assert(d.throughput_fg_bold == 0);
09228         assert(d.time_label_fg_color == 0);
09229         assert(d.time_label_bg_color == 0);
09230         assert(d.time_label_fg_bold == 0);
09231         assert(d.percent_fg_color == 0);
09232         assert(d.percent_bg_color == 0);
09233         assert(d.percent_fg_bold == 0);
09234         assert(d.barbrace_fg_color == 0);
09235         assert(d.barbrace_bg_color == 0);
09236         assert(d.barbrace_fg_bold == 0);
09237         assert(d.bar_fg_color == 0);
09238         assert(d.bar_bg_color == 0);
09239         assert(d.bar_fg_bold == 0);
09240         assert(io.in == 0);
09241         assert(io.out == 1);
09242         assert(io.in_ready == 0);
09243         assert(io.out_ready == 0);
09244         assert(io.eof_in == 0);
09245         assert(io.eof_out == 0);
09246         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09247         /* assert(io.cbuf == 0x0); */
09248         assert(io.last_read == 0);
09249         assert(io.last_write == 0);
09250         assert(io.total_read == 0);
09251         assert(io.total_write == 0);
09252         assert(io.total_size == 0);
09253         assert(io.total_size_known == 0);
09254         assert(io.timeout == 30);
09255 }
09256 
09257 void test69(FILE* out)
09258 {
09259         int argc = 0;
09260         char *argv[256] = { 0 };
09261 
09262         argv[argc++] = "ProgramName";
09263         argv[argc++] = "--kilo";
09264 
09265         displayInit();
09266         ioInit();
09267 
09268 #ifdef PRINT_DEBUG
09269         print();
09270 #endif
09271         assert(d.start_time == 0);
09272         assert(d.total_time == 0);
09273         assert(d.current_time == 0);
09274         assert(d.elapsed_time == 0);
09275         assert(d.percent_complete == 0);
09276         assert(d.display_interval == 1);
09277         assert(d.overtime_flag == 0);
09278         assert(d.k == 1024);
09279         assert(d.twiddle == '-');
09280         assert(d.manual_width == 0);
09281         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09282         assert(d.display_datacount == 1);
09283         assert(d.display_throughput == 1);
09284         assert(d.display_time == 1);
09285         assert(d.display_percent == 1);
09286         assert(d.display_bar == 1);
09287         assert(d.display_summary == 1);
09288         assert(d.display_ansi == 0);
09289         assert(d.twiddle_fg_color == 0);
09290         assert(d.twiddle_bg_color == 0);
09291         assert(d.twiddle_fg_bold == 0);
09292         assert(d.datacount_fg_color == 0);
09293         assert(d.datacount_bg_color == 0);
09294         assert(d.datacount_fg_bold == 0);
09295         assert(d.throughput_label_fg_color == 0);
09296         assert(d.throughput_label_bg_color == 0);
09297         assert(d.throughput_label_fg_bold == 0);
09298         assert(d.throughput_fg_color == 0);
09299         assert(d.throughput_bg_color == 0);
09300         assert(d.throughput_fg_bold == 0);
09301         assert(d.time_label_fg_color == 0);
09302         assert(d.time_label_bg_color == 0);
09303         assert(d.time_label_fg_bold == 0);
09304         assert(d.percent_fg_color == 0);
09305         assert(d.percent_bg_color == 0);
09306         assert(d.percent_fg_bold == 0);
09307         assert(d.barbrace_fg_color == 0);
09308         assert(d.barbrace_bg_color == 0);
09309         assert(d.barbrace_fg_bold == 0);
09310         assert(d.bar_fg_color == 0);
09311         assert(d.bar_bg_color == 0);
09312         assert(d.bar_fg_bold == 0);
09313         assert(io.in == 0);
09314         assert(io.out == 1);
09315         assert(io.in_ready == 0);
09316         assert(io.out_ready == 0);
09317         assert(io.eof_in == 0);
09318         assert(io.eof_out == 0);
09319         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09320         /* assert(io.cbuf == 0x0); */
09321         assert(io.last_read == 0);
09322         assert(io.last_write == 0);
09323         assert(io.total_read == 0);
09324         assert(io.total_write == 0);
09325         assert(io.total_size == 0);
09326         assert(io.total_size_known == 0);
09327         assert(io.timeout == 250000);
09328 
09329         assert(parse_args(out, argc, argv) == 1);
09330 
09331 #ifdef PRINT_DEBUG
09332         print();
09333 #endif
09334         assert(d.start_time == 0);
09335         assert(d.total_time == 0);
09336         assert(d.current_time == 0);
09337         assert(d.elapsed_time == 0);
09338         assert(d.percent_complete == 0);
09339         assert(d.display_interval == 1);
09340         assert(d.overtime_flag == 0);
09341         assert(d.k == 1024);
09342         assert(d.twiddle == '-');
09343         assert(d.manual_width == 0);
09344         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09345         assert(d.display_datacount == 1);
09346         assert(d.display_throughput == 1);
09347         assert(d.display_time == 1);
09348         assert(d.display_percent == 1);
09349         assert(d.display_bar == 1);
09350         assert(d.display_summary == 1);
09351         assert(d.display_ansi == 0);
09352         assert(d.twiddle_fg_color == 0);
09353         assert(d.twiddle_bg_color == 0);
09354         assert(d.twiddle_fg_bold == 0);
09355         assert(d.datacount_fg_color == 0);
09356         assert(d.datacount_bg_color == 0);
09357         assert(d.datacount_fg_bold == 0);
09358         assert(d.throughput_label_fg_color == 0);
09359         assert(d.throughput_label_bg_color == 0);
09360         assert(d.throughput_label_fg_bold == 0);
09361         assert(d.throughput_fg_color == 0);
09362         assert(d.throughput_bg_color == 0);
09363         assert(d.throughput_fg_bold == 0);
09364         assert(d.time_label_fg_color == 0);
09365         assert(d.time_label_bg_color == 0);
09366         assert(d.time_label_fg_bold == 0);
09367         assert(d.percent_fg_color == 0);
09368         assert(d.percent_bg_color == 0);
09369         assert(d.percent_fg_bold == 0);
09370         assert(d.barbrace_fg_color == 0);
09371         assert(d.barbrace_bg_color == 0);
09372         assert(d.barbrace_fg_bold == 0);
09373         assert(d.bar_fg_color == 0);
09374         assert(d.bar_bg_color == 0);
09375         assert(d.bar_fg_bold == 0);
09376         assert(io.in == 0);
09377         assert(io.out == 1);
09378         assert(io.in_ready == 0);
09379         assert(io.out_ready == 0);
09380         assert(io.eof_in == 0);
09381         assert(io.eof_out == 0);
09382         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09383         /* assert(io.cbuf == 0x0); */
09384         assert(io.last_read == 0);
09385         assert(io.last_write == 0);
09386         assert(io.total_read == 0);
09387         assert(io.total_write == 0);
09388         assert(io.total_size == 0);
09389         assert(io.total_size_known == 0);
09390         assert(io.timeout == 250000);
09391 }
09392 
09393 void test70(FILE* out)
09394 {
09395         int argc = 0;
09396         char *argv[256] = { 0 };
09397 
09398         argv[argc++] = "ProgramName";
09399         argv[argc++] = "--kilo";
09400         argv[argc++] = "10";
09401 
09402         displayInit();
09403         ioInit();
09404 
09405 #ifdef PRINT_DEBUG
09406         print();
09407 #endif
09408         assert(d.start_time == 0);
09409         assert(d.total_time == 0);
09410         assert(d.current_time == 0);
09411         assert(d.elapsed_time == 0);
09412         assert(d.percent_complete == 0);
09413         assert(d.display_interval == 1);
09414         assert(d.overtime_flag == 0);
09415         assert(d.k == 1024);
09416         assert(d.twiddle == '-');
09417         assert(d.manual_width == 0);
09418         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09419         assert(d.display_datacount == 1);
09420         assert(d.display_throughput == 1);
09421         assert(d.display_time == 1);
09422         assert(d.display_percent == 1);
09423         assert(d.display_bar == 1);
09424         assert(d.display_summary == 1);
09425         assert(d.display_ansi == 0);
09426         assert(d.twiddle_fg_color == 0);
09427         assert(d.twiddle_bg_color == 0);
09428         assert(d.twiddle_fg_bold == 0);
09429         assert(d.datacount_fg_color == 0);
09430         assert(d.datacount_bg_color == 0);
09431         assert(d.datacount_fg_bold == 0);
09432         assert(d.throughput_label_fg_color == 0);
09433         assert(d.throughput_label_bg_color == 0);
09434         assert(d.throughput_label_fg_bold == 0);
09435         assert(d.throughput_fg_color == 0);
09436         assert(d.throughput_bg_color == 0);
09437         assert(d.throughput_fg_bold == 0);
09438         assert(d.time_label_fg_color == 0);
09439         assert(d.time_label_bg_color == 0);
09440         assert(d.time_label_fg_bold == 0);
09441         assert(d.percent_fg_color == 0);
09442         assert(d.percent_bg_color == 0);
09443         assert(d.percent_fg_bold == 0);
09444         assert(d.barbrace_fg_color == 0);
09445         assert(d.barbrace_bg_color == 0);
09446         assert(d.barbrace_fg_bold == 0);
09447         assert(d.bar_fg_color == 0);
09448         assert(d.bar_bg_color == 0);
09449         assert(d.bar_fg_bold == 0);
09450         assert(io.in == 0);
09451         assert(io.out == 1);
09452         assert(io.in_ready == 0);
09453         assert(io.out_ready == 0);
09454         assert(io.eof_in == 0);
09455         assert(io.eof_out == 0);
09456         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09457         /* assert(io.cbuf == 0x0); */
09458         assert(io.last_read == 0);
09459         assert(io.last_write == 0);
09460         assert(io.total_read == 0);
09461         assert(io.total_write == 0);
09462         assert(io.total_size == 0);
09463         assert(io.total_size_known == 0);
09464         assert(io.timeout == 250000);
09465 
09466         assert(parse_args(out, argc, argv) == 1);
09467 
09468 #ifdef PRINT_DEBUG
09469         print();
09470 #endif
09471         assert(d.start_time == 0);
09472         assert(d.total_time == 0);
09473         assert(d.current_time == 0);
09474         assert(d.elapsed_time == 0);
09475         assert(d.percent_complete == 0);
09476         assert(d.display_interval == 1);
09477         assert(d.overtime_flag == 0);
09478         assert(d.k == 1024);
09479         assert(d.twiddle == '-');
09480         assert(d.manual_width == 0);
09481         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09482         assert(d.display_datacount == 1);
09483         assert(d.display_throughput == 1);
09484         assert(d.display_time == 1);
09485         assert(d.display_percent == 1);
09486         assert(d.display_bar == 1);
09487         assert(d.display_summary == 1);
09488         assert(d.display_ansi == 0);
09489         assert(d.twiddle_fg_color == 0);
09490         assert(d.twiddle_bg_color == 0);
09491         assert(d.twiddle_fg_bold == 0);
09492         assert(d.datacount_fg_color == 0);
09493         assert(d.datacount_bg_color == 0);
09494         assert(d.datacount_fg_bold == 0);
09495         assert(d.throughput_label_fg_color == 0);
09496         assert(d.throughput_label_bg_color == 0);
09497         assert(d.throughput_label_fg_bold == 0);
09498         assert(d.throughput_fg_color == 0);
09499         assert(d.throughput_bg_color == 0);
09500         assert(d.throughput_fg_bold == 0);
09501         assert(d.time_label_fg_color == 0);
09502         assert(d.time_label_bg_color == 0);
09503         assert(d.time_label_fg_bold == 0);
09504         assert(d.percent_fg_color == 0);
09505         assert(d.percent_bg_color == 0);
09506         assert(d.percent_fg_bold == 0);
09507         assert(d.barbrace_fg_color == 0);
09508         assert(d.barbrace_bg_color == 0);
09509         assert(d.barbrace_fg_bold == 0);
09510         assert(d.bar_fg_color == 0);
09511         assert(d.bar_bg_color == 0);
09512         assert(d.bar_fg_bold == 0);
09513         assert(io.in == 0);
09514         assert(io.out == 1);
09515         assert(io.in_ready == 0);
09516         assert(io.out_ready == 0);
09517         assert(io.eof_in == 0);
09518         assert(io.eof_out == 0);
09519         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09520         /* assert(io.cbuf == 0x0); */
09521         assert(io.last_read == 0);
09522         assert(io.last_write == 0);
09523         assert(io.total_read == 0);
09524         assert(io.total_write == 0);
09525         assert(io.total_size == 0);
09526         assert(io.total_size_known == 0);
09527         assert(io.timeout == 250000);
09528 }
09529 
09530 void test71(FILE* out)
09531 {
09532         int argc = 0;
09533         char *argv[256] = { 0 };
09534 
09535         argv[argc++] = "ProgramName";
09536         argv[argc++] = "--kilo";
09537         argv[argc++] = "1000";
09538 
09539         displayInit();
09540         ioInit();
09541 
09542 #ifdef PRINT_DEBUG
09543         print();
09544 #endif
09545         assert(d.start_time == 0);
09546         assert(d.total_time == 0);
09547         assert(d.current_time == 0);
09548         assert(d.elapsed_time == 0);
09549         assert(d.percent_complete == 0);
09550         assert(d.display_interval == 1);
09551         assert(d.overtime_flag == 0);
09552         assert(d.k == 1024);
09553         assert(d.twiddle == '-');
09554         assert(d.manual_width == 0);
09555         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09556         assert(d.display_datacount == 1);
09557         assert(d.display_throughput == 1);
09558         assert(d.display_time == 1);
09559         assert(d.display_percent == 1);
09560         assert(d.display_bar == 1);
09561         assert(d.display_summary == 1);
09562         assert(d.display_ansi == 0);
09563         assert(d.twiddle_fg_color == 0);
09564         assert(d.twiddle_bg_color == 0);
09565         assert(d.twiddle_fg_bold == 0);
09566         assert(d.datacount_fg_color == 0);
09567         assert(d.datacount_bg_color == 0);
09568         assert(d.datacount_fg_bold == 0);
09569         assert(d.throughput_label_fg_color == 0);
09570         assert(d.throughput_label_bg_color == 0);
09571         assert(d.throughput_label_fg_bold == 0);
09572         assert(d.throughput_fg_color == 0);
09573         assert(d.throughput_bg_color == 0);
09574         assert(d.throughput_fg_bold == 0);
09575         assert(d.time_label_fg_color == 0);
09576         assert(d.time_label_bg_color == 0);
09577         assert(d.time_label_fg_bold == 0);
09578         assert(d.percent_fg_color == 0);
09579         assert(d.percent_bg_color == 0);
09580         assert(d.percent_fg_bold == 0);
09581         assert(d.barbrace_fg_color == 0);
09582         assert(d.barbrace_bg_color == 0);
09583         assert(d.barbrace_fg_bold == 0);
09584         assert(d.bar_fg_color == 0);
09585         assert(d.bar_bg_color == 0);
09586         assert(d.bar_fg_bold == 0);
09587         assert(io.in == 0);
09588         assert(io.out == 1);
09589         assert(io.in_ready == 0);
09590         assert(io.out_ready == 0);
09591         assert(io.eof_in == 0);
09592         assert(io.eof_out == 0);
09593         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09594         /* assert(io.cbuf == 0x0); */
09595         assert(io.last_read == 0);
09596         assert(io.last_write == 0);
09597         assert(io.total_read == 0);
09598         assert(io.total_write == 0);
09599         assert(io.total_size == 0);
09600         assert(io.total_size_known == 0);
09601         assert(io.timeout == 250000);
09602 
09603         assert(parse_args(out, argc, argv) == 0);
09604 
09605 #ifdef PRINT_DEBUG
09606         print();
09607 #endif
09608         assert(d.start_time == 0);
09609         assert(d.total_time == 0);
09610         assert(d.current_time == 0);
09611         assert(d.elapsed_time == 0);
09612         assert(d.percent_complete == 0);
09613         assert(d.display_interval == 1);
09614         assert(d.overtime_flag == 0);
09615         assert(d.k == 1000);
09616         assert(d.twiddle == '-');
09617         assert(d.manual_width == 0);
09618         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09619         assert(d.display_datacount == 1);
09620         assert(d.display_throughput == 1);
09621         assert(d.display_time == 1);
09622         assert(d.display_percent == 1);
09623         assert(d.display_bar == 1);
09624         assert(d.display_summary == 1);
09625         assert(d.display_ansi == 0);
09626         assert(d.twiddle_fg_color == 0);
09627         assert(d.twiddle_bg_color == 0);
09628         assert(d.twiddle_fg_bold == 0);
09629         assert(d.datacount_fg_color == 0);
09630         assert(d.datacount_bg_color == 0);
09631         assert(d.datacount_fg_bold == 0);
09632         assert(d.throughput_label_fg_color == 0);
09633         assert(d.throughput_label_bg_color == 0);
09634         assert(d.throughput_label_fg_bold == 0);
09635         assert(d.throughput_fg_color == 0);
09636         assert(d.throughput_bg_color == 0);
09637         assert(d.throughput_fg_bold == 0);
09638         assert(d.time_label_fg_color == 0);
09639         assert(d.time_label_bg_color == 0);
09640         assert(d.time_label_fg_bold == 0);
09641         assert(d.percent_fg_color == 0);
09642         assert(d.percent_bg_color == 0);
09643         assert(d.percent_fg_bold == 0);
09644         assert(d.barbrace_fg_color == 0);
09645         assert(d.barbrace_bg_color == 0);
09646         assert(d.barbrace_fg_bold == 0);
09647         assert(d.bar_fg_color == 0);
09648         assert(d.bar_bg_color == 0);
09649         assert(d.bar_fg_bold == 0);
09650         assert(io.in == 0);
09651         assert(io.out == 1);
09652         assert(io.in_ready == 0);
09653         assert(io.out_ready == 0);
09654         assert(io.eof_in == 0);
09655         assert(io.eof_out == 0);
09656         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09657         /* assert(io.cbuf == 0x0); */
09658         assert(io.last_read == 0);
09659         assert(io.last_write == 0);
09660         assert(io.total_read == 0);
09661         assert(io.total_write == 0);
09662         assert(io.total_size == 0);
09663         assert(io.total_size_known == 0);
09664         assert(io.timeout == 250000);
09665 }
09666 
09667 void test72(FILE* out)
09668 {
09669         int argc = 0;
09670         char *argv[256] = { 0 };
09671 
09672         argv[argc++] = "ProgramName";
09673         argv[argc++] = "--kilo";
09674         argv[argc++] = "1024";
09675 
09676         displayInit();
09677         ioInit();
09678 
09679 #ifdef PRINT_DEBUG
09680         print();
09681 #endif
09682         assert(d.start_time == 0);
09683         assert(d.total_time == 0);
09684         assert(d.current_time == 0);
09685         assert(d.elapsed_time == 0);
09686         assert(d.percent_complete == 0);
09687         assert(d.display_interval == 1);
09688         assert(d.overtime_flag == 0);
09689         assert(d.k == 1024);
09690         assert(d.twiddle == '-');
09691         assert(d.manual_width == 0);
09692         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09693         assert(d.display_datacount == 1);
09694         assert(d.display_throughput == 1);
09695         assert(d.display_time == 1);
09696         assert(d.display_percent == 1);
09697         assert(d.display_bar == 1);
09698         assert(d.display_summary == 1);
09699         assert(d.display_ansi == 0);
09700         assert(d.twiddle_fg_color == 0);
09701         assert(d.twiddle_bg_color == 0);
09702         assert(d.twiddle_fg_bold == 0);
09703         assert(d.datacount_fg_color == 0);
09704         assert(d.datacount_bg_color == 0);
09705         assert(d.datacount_fg_bold == 0);
09706         assert(d.throughput_label_fg_color == 0);
09707         assert(d.throughput_label_bg_color == 0);
09708         assert(d.throughput_label_fg_bold == 0);
09709         assert(d.throughput_fg_color == 0);
09710         assert(d.throughput_bg_color == 0);
09711         assert(d.throughput_fg_bold == 0);
09712         assert(d.time_label_fg_color == 0);
09713         assert(d.time_label_bg_color == 0);
09714         assert(d.time_label_fg_bold == 0);
09715         assert(d.percent_fg_color == 0);
09716         assert(d.percent_bg_color == 0);
09717         assert(d.percent_fg_bold == 0);
09718         assert(d.barbrace_fg_color == 0);
09719         assert(d.barbrace_bg_color == 0);
09720         assert(d.barbrace_fg_bold == 0);
09721         assert(d.bar_fg_color == 0);
09722         assert(d.bar_bg_color == 0);
09723         assert(d.bar_fg_bold == 0);
09724         assert(io.in == 0);
09725         assert(io.out == 1);
09726         assert(io.in_ready == 0);
09727         assert(io.out_ready == 0);
09728         assert(io.eof_in == 0);
09729         assert(io.eof_out == 0);
09730         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09731         /* assert(io.cbuf == 0x0); */
09732         assert(io.last_read == 0);
09733         assert(io.last_write == 0);
09734         assert(io.total_read == 0);
09735         assert(io.total_write == 0);
09736         assert(io.total_size == 0);
09737         assert(io.total_size_known == 0);
09738         assert(io.timeout == 250000);
09739 
09740         d.k = 1000;
09741         assert(parse_args(out, argc, argv) == 0);
09742 
09743 #ifdef PRINT_DEBUG
09744         print();
09745 #endif
09746         assert(d.start_time == 0);
09747         assert(d.total_time == 0);
09748         assert(d.current_time == 0);
09749         assert(d.elapsed_time == 0);
09750         assert(d.percent_complete == 0);
09751         assert(d.display_interval == 1);
09752         assert(d.overtime_flag == 0);
09753         assert(d.k == 1024);
09754         assert(d.twiddle == '-');
09755         assert(d.manual_width == 0);
09756         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09757         assert(d.display_datacount == 1);
09758         assert(d.display_throughput == 1);
09759         assert(d.display_time == 1);
09760         assert(d.display_percent == 1);
09761         assert(d.display_bar == 1);
09762         assert(d.display_summary == 1);
09763         assert(d.display_ansi == 0);
09764         assert(d.twiddle_fg_color == 0);
09765         assert(d.twiddle_bg_color == 0);
09766         assert(d.twiddle_fg_bold == 0);
09767         assert(d.datacount_fg_color == 0);
09768         assert(d.datacount_bg_color == 0);
09769         assert(d.datacount_fg_bold == 0);
09770         assert(d.throughput_label_fg_color == 0);
09771         assert(d.throughput_label_bg_color == 0);
09772         assert(d.throughput_label_fg_bold == 0);
09773         assert(d.throughput_fg_color == 0);
09774         assert(d.throughput_bg_color == 0);
09775         assert(d.throughput_fg_bold == 0);
09776         assert(d.time_label_fg_color == 0);
09777         assert(d.time_label_bg_color == 0);
09778         assert(d.time_label_fg_bold == 0);
09779         assert(d.percent_fg_color == 0);
09780         assert(d.percent_bg_color == 0);
09781         assert(d.percent_fg_bold == 0);
09782         assert(d.barbrace_fg_color == 0);
09783         assert(d.barbrace_bg_color == 0);
09784         assert(d.barbrace_fg_bold == 0);
09785         assert(d.bar_fg_color == 0);
09786         assert(d.bar_bg_color == 0);
09787         assert(d.bar_fg_bold == 0);
09788         assert(io.in == 0);
09789         assert(io.out == 1);
09790         assert(io.in_ready == 0);
09791         assert(io.out_ready == 0);
09792         assert(io.eof_in == 0);
09793         assert(io.eof_out == 0);
09794         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09795         /* assert(io.cbuf == 0x0); */
09796         assert(io.last_read == 0);
09797         assert(io.last_write == 0);
09798         assert(io.total_read == 0);
09799         assert(io.total_write == 0);
09800         assert(io.total_size == 0);
09801         assert(io.total_size_known == 0);
09802         assert(io.timeout == 250000);
09803 }
09804 
09805 void test73(FILE* out)
09806 {
09807         int argc = 0;
09808         char *argv[256] = { 0 };
09809 
09810         argv[argc++] = "ProgramName";
09811         argv[argc++] = "--screen-width";
09812 
09813         displayInit();
09814         ioInit();
09815 
09816 #ifdef PRINT_DEBUG
09817         print();
09818 #endif
09819         assert(d.start_time == 0);
09820         assert(d.total_time == 0);
09821         assert(d.current_time == 0);
09822         assert(d.elapsed_time == 0);
09823         assert(d.percent_complete == 0);
09824         assert(d.display_interval == 1);
09825         assert(d.overtime_flag == 0);
09826         assert(d.k == 1024);
09827         assert(d.twiddle == '-');
09828         assert(d.manual_width == 0);
09829         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09830         assert(d.display_datacount == 1);
09831         assert(d.display_throughput == 1);
09832         assert(d.display_time == 1);
09833         assert(d.display_percent == 1);
09834         assert(d.display_bar == 1);
09835         assert(d.display_summary == 1);
09836         assert(d.display_ansi == 0);
09837         assert(d.twiddle_fg_color == 0);
09838         assert(d.twiddle_bg_color == 0);
09839         assert(d.twiddle_fg_bold == 0);
09840         assert(d.datacount_fg_color == 0);
09841         assert(d.datacount_bg_color == 0);
09842         assert(d.datacount_fg_bold == 0);
09843         assert(d.throughput_label_fg_color == 0);
09844         assert(d.throughput_label_bg_color == 0);
09845         assert(d.throughput_label_fg_bold == 0);
09846         assert(d.throughput_fg_color == 0);
09847         assert(d.throughput_bg_color == 0);
09848         assert(d.throughput_fg_bold == 0);
09849         assert(d.time_label_fg_color == 0);
09850         assert(d.time_label_bg_color == 0);
09851         assert(d.time_label_fg_bold == 0);
09852         assert(d.percent_fg_color == 0);
09853         assert(d.percent_bg_color == 0);
09854         assert(d.percent_fg_bold == 0);
09855         assert(d.barbrace_fg_color == 0);
09856         assert(d.barbrace_bg_color == 0);
09857         assert(d.barbrace_fg_bold == 0);
09858         assert(d.bar_fg_color == 0);
09859         assert(d.bar_bg_color == 0);
09860         assert(d.bar_fg_bold == 0);
09861         assert(io.in == 0);
09862         assert(io.out == 1);
09863         assert(io.in_ready == 0);
09864         assert(io.out_ready == 0);
09865         assert(io.eof_in == 0);
09866         assert(io.eof_out == 0);
09867         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09868         /* assert(io.cbuf == 0x0); */
09869         assert(io.last_read == 0);
09870         assert(io.last_write == 0);
09871         assert(io.total_read == 0);
09872         assert(io.total_write == 0);
09873         assert(io.total_size == 0);
09874         assert(io.total_size_known == 0);
09875         assert(io.timeout == 250000);
09876 
09877         assert(parse_args(out, argc, argv) == 1);
09878 
09879 #ifdef PRINT_DEBUG
09880         print();
09881 #endif
09882         assert(d.start_time == 0);
09883         assert(d.total_time == 0);
09884         assert(d.current_time == 0);
09885         assert(d.elapsed_time == 0);
09886         assert(d.percent_complete == 0);
09887         assert(d.display_interval == 1);
09888         assert(d.overtime_flag == 0);
09889         assert(d.k == 1024);
09890         assert(d.twiddle == '-');
09891         assert(d.manual_width == 0);
09892         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09893         assert(d.display_datacount == 1);
09894         assert(d.display_throughput == 1);
09895         assert(d.display_time == 1);
09896         assert(d.display_percent == 1);
09897         assert(d.display_bar == 1);
09898         assert(d.display_summary == 1);
09899         assert(d.display_ansi == 0);
09900         assert(d.twiddle_fg_color == 0);
09901         assert(d.twiddle_bg_color == 0);
09902         assert(d.twiddle_fg_bold == 0);
09903         assert(d.datacount_fg_color == 0);
09904         assert(d.datacount_bg_color == 0);
09905         assert(d.datacount_fg_bold == 0);
09906         assert(d.throughput_label_fg_color == 0);
09907         assert(d.throughput_label_bg_color == 0);
09908         assert(d.throughput_label_fg_bold == 0);
09909         assert(d.throughput_fg_color == 0);
09910         assert(d.throughput_bg_color == 0);
09911         assert(d.throughput_fg_bold == 0);
09912         assert(d.time_label_fg_color == 0);
09913         assert(d.time_label_bg_color == 0);
09914         assert(d.time_label_fg_bold == 0);
09915         assert(d.percent_fg_color == 0);
09916         assert(d.percent_bg_color == 0);
09917         assert(d.percent_fg_bold == 0);
09918         assert(d.barbrace_fg_color == 0);
09919         assert(d.barbrace_bg_color == 0);
09920         assert(d.barbrace_fg_bold == 0);
09921         assert(d.bar_fg_color == 0);
09922         assert(d.bar_bg_color == 0);
09923         assert(d.bar_fg_bold == 0);
09924         assert(io.in == 0);
09925         assert(io.out == 1);
09926         assert(io.in_ready == 0);
09927         assert(io.out_ready == 0);
09928         assert(io.eof_in == 0);
09929         assert(io.eof_out == 0);
09930         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
09931         /* assert(io.cbuf == 0x0); */
09932         assert(io.last_read == 0);
09933         assert(io.last_write == 0);
09934         assert(io.total_read == 0);
09935         assert(io.total_write == 0);
09936         assert(io.total_size == 0);
09937         assert(io.total_size_known == 0);
09938         assert(io.timeout == 250000);
09939 }
09940 
09941 void test74(FILE* out)
09942 {
09943         int argc = 0;
09944         char *argv[256] = { 0 };
09945 
09946         argv[argc++] = "ProgramName";
09947         argv[argc++] = "--screen-width";
09948         argv[argc++] = "0";
09949 
09950         displayInit();
09951         ioInit();
09952 
09953 #ifdef PRINT_DEBUG
09954         print();
09955 #endif
09956         assert(d.start_time == 0);
09957         assert(d.total_time == 0);
09958         assert(d.current_time == 0);
09959         assert(d.elapsed_time == 0);
09960         assert(d.percent_complete == 0);
09961         assert(d.display_interval == 1);
09962         assert(d.overtime_flag == 0);
09963         assert(d.k == 1024);
09964         assert(d.twiddle == '-');
09965         assert(d.manual_width == 0);
09966         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
09967         assert(d.display_datacount == 1);
09968         assert(d.display_throughput == 1);
09969         assert(d.display_time == 1);
09970         assert(d.display_percent == 1);
09971         assert(d.display_bar == 1);
09972         assert(d.display_summary == 1);
09973         assert(d.display_ansi == 0);
09974         assert(d.twiddle_fg_color == 0);
09975         assert(d.twiddle_bg_color == 0);
09976         assert(d.twiddle_fg_bold == 0);
09977         assert(d.datacount_fg_color == 0);
09978         assert(d.datacount_bg_color == 0);
09979         assert(d.datacount_fg_bold == 0);
09980         assert(d.throughput_label_fg_color == 0);
09981         assert(d.throughput_label_bg_color == 0);
09982         assert(d.throughput_label_fg_bold == 0);
09983         assert(d.throughput_fg_color == 0);
09984         assert(d.throughput_bg_color == 0);
09985         assert(d.throughput_fg_bold == 0);
09986         assert(d.time_label_fg_color == 0);
09987         assert(d.time_label_bg_color == 0);
09988         assert(d.time_label_fg_bold == 0);
09989         assert(d.percent_fg_color == 0);
09990         assert(d.percent_bg_color == 0);
09991         assert(d.percent_fg_bold == 0);
09992         assert(d.barbrace_fg_color == 0);
09993         assert(d.barbrace_bg_color == 0);
09994         assert(d.barbrace_fg_bold == 0);
09995         assert(d.bar_fg_color == 0);
09996         assert(d.bar_bg_color == 0);
09997         assert(d.bar_fg_bold == 0);
09998         assert(io.in == 0);
09999         assert(io.out == 1);
10000         assert(io.in_ready == 0);
10001         assert(io.out_ready == 0);
10002         assert(io.eof_in == 0);
10003         assert(io.eof_out == 0);
10004         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10005         /* assert(io.cbuf == 0x0); */
10006         assert(io.last_read == 0);
10007         assert(io.last_write == 0);
10008         assert(io.total_read == 0);
10009         assert(io.total_write == 0);
10010         assert(io.total_size == 0);
10011         assert(io.total_size_known == 0);
10012         assert(io.timeout == 250000);
10013 
10014         assert(parse_args(out, argc, argv) == 1);
10015 
10016 #ifdef PRINT_DEBUG
10017         print();
10018 #endif
10019         assert(d.start_time == 0);
10020         assert(d.total_time == 0);
10021         assert(d.current_time == 0);
10022         assert(d.elapsed_time == 0);
10023         assert(d.percent_complete == 0);
10024         assert(d.display_interval == 1);
10025         assert(d.overtime_flag == 0);
10026         assert(d.k == 1024);
10027         assert(d.twiddle == '-');
10028         assert(d.manual_width == 0);
10029         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10030         assert(d.display_datacount == 1);
10031         assert(d.display_throughput == 1);
10032         assert(d.display_time == 1);
10033         assert(d.display_percent == 1);
10034         assert(d.display_bar == 1);
10035         assert(d.display_summary == 1);
10036         assert(d.display_ansi == 0);
10037         assert(d.twiddle_fg_color == 0);
10038         assert(d.twiddle_bg_color == 0);
10039         assert(d.twiddle_fg_bold == 0);
10040         assert(d.datacount_fg_color == 0);
10041         assert(d.datacount_bg_color == 0);
10042         assert(d.datacount_fg_bold == 0);
10043         assert(d.throughput_label_fg_color == 0);
10044         assert(d.throughput_label_bg_color == 0);
10045         assert(d.throughput_label_fg_bold == 0);
10046         assert(d.throughput_fg_color == 0);
10047         assert(d.throughput_bg_color == 0);
10048         assert(d.throughput_fg_bold == 0);
10049         assert(d.time_label_fg_color == 0);
10050         assert(d.time_label_bg_color == 0);
10051         assert(d.time_label_fg_bold == 0);
10052         assert(d.percent_fg_color == 0);
10053         assert(d.percent_bg_color == 0);
10054         assert(d.percent_fg_bold == 0);
10055         assert(d.barbrace_fg_color == 0);
10056         assert(d.barbrace_bg_color == 0);
10057         assert(d.barbrace_fg_bold == 0);
10058         assert(d.bar_fg_color == 0);
10059         assert(d.bar_bg_color == 0);
10060         assert(d.bar_fg_bold == 0);
10061         assert(io.in == 0);
10062         assert(io.out == 1);
10063         assert(io.in_ready == 0);
10064         assert(io.out_ready == 0);
10065         assert(io.eof_in == 0);
10066         assert(io.eof_out == 0);
10067         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10068         /* assert(io.cbuf == 0x0); */
10069         assert(io.last_read == 0);
10070         assert(io.last_write == 0);
10071         assert(io.total_read == 0);
10072         assert(io.total_write == 0);
10073         assert(io.total_size == 0);
10074         assert(io.total_size_known == 0);
10075         assert(io.timeout == 250000);
10076 }
10077 
10078 void test75(FILE* out)
10079 {
10080         int argc = 0;
10081         char *argv[256] = { 0 };
10082 
10083         argv[argc++] = "ProgramName";
10084         argv[argc++] = "--screen-width";
10085         argv[argc++] = "1";
10086 
10087         displayInit();
10088         ioInit();
10089 
10090 #ifdef PRINT_DEBUG
10091         print();
10092 #endif
10093         assert(d.start_time == 0);
10094         assert(d.total_time == 0);
10095         assert(d.current_time == 0);
10096         assert(d.elapsed_time == 0);
10097         assert(d.percent_complete == 0);
10098         assert(d.display_interval == 1);
10099         assert(d.overtime_flag == 0);
10100         assert(d.k == 1024);
10101         assert(d.twiddle == '-');
10102         assert(d.manual_width == 0);
10103         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10104         assert(d.display_datacount == 1);
10105         assert(d.display_throughput == 1);
10106         assert(d.display_time == 1);
10107         assert(d.display_percent == 1);
10108         assert(d.display_bar == 1);
10109         assert(d.display_summary == 1);
10110         assert(d.display_ansi == 0);
10111         assert(d.twiddle_fg_color == 0);
10112         assert(d.twiddle_bg_color == 0);
10113         assert(d.twiddle_fg_bold == 0);
10114         assert(d.datacount_fg_color == 0);
10115         assert(d.datacount_bg_color == 0);
10116         assert(d.datacount_fg_bold == 0);
10117         assert(d.throughput_label_fg_color == 0);
10118         assert(d.throughput_label_bg_color == 0);
10119         assert(d.throughput_label_fg_bold == 0);
10120         assert(d.throughput_fg_color == 0);
10121         assert(d.throughput_bg_color == 0);
10122         assert(d.throughput_fg_bold == 0);
10123         assert(d.time_label_fg_color == 0);
10124         assert(d.time_label_bg_color == 0);
10125         assert(d.time_label_fg_bold == 0);
10126         assert(d.percent_fg_color == 0);
10127         assert(d.percent_bg_color == 0);
10128         assert(d.percent_fg_bold == 0);
10129         assert(d.barbrace_fg_color == 0);
10130         assert(d.barbrace_bg_color == 0);
10131         assert(d.barbrace_fg_bold == 0);
10132         assert(d.bar_fg_color == 0);
10133         assert(d.bar_bg_color == 0);
10134         assert(d.bar_fg_bold == 0);
10135         assert(io.in == 0);
10136         assert(io.out == 1);
10137         assert(io.in_ready == 0);
10138         assert(io.out_ready == 0);
10139         assert(io.eof_in == 0);
10140         assert(io.eof_out == 0);
10141         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10142         /* assert(io.cbuf == 0x0); */
10143         assert(io.last_read == 0);
10144         assert(io.last_write == 0);
10145         assert(io.total_read == 0);
10146         assert(io.total_write == 0);
10147         assert(io.total_size == 0);
10148         assert(io.total_size_known == 0);
10149         assert(io.timeout == 250000);
10150 
10151         assert(parse_args(out, argc, argv) == 0);
10152 
10153 #ifdef PRINT_DEBUG
10154         print();
10155 #endif
10156         assert(d.start_time == 0);
10157         assert(d.total_time == 0);
10158         assert(d.current_time == 0);
10159         assert(d.elapsed_time == 0);
10160         assert(d.percent_complete == 0);
10161         assert(d.display_interval == 1);
10162         assert(d.overtime_flag == 0);
10163         assert(d.k == 1024);
10164         assert(d.twiddle == '-');
10165         assert(d.screen_width == 1);
10166         assert(d.manual_width == 1);
10167         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10168         assert(d.display_datacount == 1);
10169         assert(d.display_throughput == 1);
10170         assert(d.display_time == 1);
10171         assert(d.display_percent == 1);
10172         assert(d.display_bar == 1);
10173         assert(d.display_summary == 1);
10174         assert(d.display_ansi == 0);
10175         assert(d.twiddle_fg_color == 0);
10176         assert(d.twiddle_bg_color == 0);
10177         assert(d.twiddle_fg_bold == 0);
10178         assert(d.datacount_fg_color == 0);
10179         assert(d.datacount_bg_color == 0);
10180         assert(d.datacount_fg_bold == 0);
10181         assert(d.throughput_label_fg_color == 0);
10182         assert(d.throughput_label_bg_color == 0);
10183         assert(d.throughput_label_fg_bold == 0);
10184         assert(d.throughput_fg_color == 0);
10185         assert(d.throughput_bg_color == 0);
10186         assert(d.throughput_fg_bold == 0);
10187         assert(d.time_label_fg_color == 0);
10188         assert(d.time_label_bg_color == 0);
10189         assert(d.time_label_fg_bold == 0);
10190         assert(d.percent_fg_color == 0);
10191         assert(d.percent_bg_color == 0);
10192         assert(d.percent_fg_bold == 0);
10193         assert(d.barbrace_fg_color == 0);
10194         assert(d.barbrace_bg_color == 0);
10195         assert(d.barbrace_fg_bold == 0);
10196         assert(d.bar_fg_color == 0);
10197         assert(d.bar_bg_color == 0);
10198         assert(d.bar_fg_bold == 0);
10199         assert(io.in == 0);
10200         assert(io.out == 1);
10201         assert(io.in_ready == 0);
10202         assert(io.out_ready == 0);
10203         assert(io.eof_in == 0);
10204         assert(io.eof_out == 0);
10205         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10206         /* assert(io.cbuf == 0x0); */
10207         assert(io.last_read == 0);
10208         assert(io.last_write == 0);
10209         assert(io.total_read == 0);
10210         assert(io.total_write == 0);
10211         assert(io.total_size == 0);
10212         assert(io.total_size_known == 0);
10213         assert(io.timeout == 250000);
10214 }
10215 
10216 void test76(FILE* out)
10217 {
10218         int argc = 0;
10219         char *argv[256] = { 0 };
10220 
10221         argv[argc++] = "ProgramName";
10222         argv[argc++] = "--display-twiddle";
10223 
10224         displayInit();
10225         ioInit();
10226 
10227 #ifdef PRINT_DEBUG
10228         print();
10229 #endif
10230         assert(d.start_time == 0);
10231         assert(d.total_time == 0);
10232         assert(d.current_time == 0);
10233         assert(d.elapsed_time == 0);
10234         assert(d.percent_complete == 0);
10235         assert(d.display_interval == 1);
10236         assert(d.overtime_flag == 0);
10237         assert(d.k == 1024);
10238         assert(d.twiddle == '-');
10239         assert(d.manual_width == 0);
10240         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10241         assert(d.display_datacount == 1);
10242         assert(d.display_throughput == 1);
10243         assert(d.display_time == 1);
10244         assert(d.display_percent == 1);
10245         assert(d.display_bar == 1);
10246         assert(d.display_summary == 1);
10247         assert(d.display_ansi == 0);
10248         assert(d.twiddle_fg_color == 0);
10249         assert(d.twiddle_bg_color == 0);
10250         assert(d.twiddle_fg_bold == 0);
10251         assert(d.datacount_fg_color == 0);
10252         assert(d.datacount_bg_color == 0);
10253         assert(d.datacount_fg_bold == 0);
10254         assert(d.throughput_label_fg_color == 0);
10255         assert(d.throughput_label_bg_color == 0);
10256         assert(d.throughput_label_fg_bold == 0);
10257         assert(d.throughput_fg_color == 0);
10258         assert(d.throughput_bg_color == 0);
10259         assert(d.throughput_fg_bold == 0);
10260         assert(d.time_label_fg_color == 0);
10261         assert(d.time_label_bg_color == 0);
10262         assert(d.time_label_fg_bold == 0);
10263         assert(d.percent_fg_color == 0);
10264         assert(d.percent_bg_color == 0);
10265         assert(d.percent_fg_bold == 0);
10266         assert(d.barbrace_fg_color == 0);
10267         assert(d.barbrace_bg_color == 0);
10268         assert(d.barbrace_fg_bold == 0);
10269         assert(d.bar_fg_color == 0);
10270         assert(d.bar_bg_color == 0);
10271         assert(d.bar_fg_bold == 0);
10272         assert(io.in == 0);
10273         assert(io.out == 1);
10274         assert(io.in_ready == 0);
10275         assert(io.out_ready == 0);
10276         assert(io.eof_in == 0);
10277         assert(io.eof_out == 0);
10278         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10279         /* assert(io.cbuf == 0x0); */
10280         assert(io.last_read == 0);
10281         assert(io.last_write == 0);
10282         assert(io.total_read == 0);
10283         assert(io.total_write == 0);
10284         assert(io.total_size == 0);
10285         assert(io.total_size_known == 0);
10286         assert(io.timeout == 250000);
10287 
10288         d.display_twiddle = 0;
10289         assert(parse_args(out, argc, argv) == 0);
10290 
10291 #ifdef PRINT_DEBUG
10292         print();
10293 #endif
10294         assert(d.start_time == 0);
10295         assert(d.total_time == 0);
10296         assert(d.current_time == 0);
10297         assert(d.elapsed_time == 0);
10298         assert(d.percent_complete == 0);
10299         assert(d.display_interval == 1);
10300         assert(d.overtime_flag == 0);
10301         assert(d.k == 1024);
10302         assert(d.twiddle == '-');
10303         assert(d.manual_width == 0); 
10304         assert(d.display_twiddle == 1);
10305         assert(d.display_datacount == 1);
10306         assert(d.display_throughput == 1);
10307         assert(d.display_time == 1);
10308         assert(d.display_percent == 1);
10309         assert(d.display_bar == 1);
10310         assert(d.display_summary == 1);
10311         assert(d.display_ansi == 0);
10312         assert(d.twiddle_fg_color == 0);
10313         assert(d.twiddle_bg_color == 0);
10314         assert(d.twiddle_fg_bold == 0);
10315         assert(d.datacount_fg_color == 0);
10316         assert(d.datacount_bg_color == 0);
10317         assert(d.datacount_fg_bold == 0);
10318         assert(d.throughput_label_fg_color == 0);
10319         assert(d.throughput_label_bg_color == 0);
10320         assert(d.throughput_label_fg_bold == 0);
10321         assert(d.throughput_fg_color == 0);
10322         assert(d.throughput_bg_color == 0);
10323         assert(d.throughput_fg_bold == 0);
10324         assert(d.time_label_fg_color == 0);
10325         assert(d.time_label_bg_color == 0);
10326         assert(d.time_label_fg_bold == 0);
10327         assert(d.percent_fg_color == 0);
10328         assert(d.percent_bg_color == 0);
10329         assert(d.percent_fg_bold == 0);
10330         assert(d.barbrace_fg_color == 0);
10331         assert(d.barbrace_bg_color == 0);
10332         assert(d.barbrace_fg_bold == 0);
10333         assert(d.bar_fg_color == 0);
10334         assert(d.bar_bg_color == 0);
10335         assert(d.bar_fg_bold == 0);
10336         assert(io.in == 0);
10337         assert(io.out == 1);
10338         assert(io.in_ready == 0);
10339         assert(io.out_ready == 0);
10340         assert(io.eof_in == 0);
10341         assert(io.eof_out == 0);
10342         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10343         /* assert(io.cbuf == 0x0); */
10344         assert(io.last_read == 0);
10345         assert(io.last_write == 0);
10346         assert(io.total_read == 0);
10347         assert(io.total_write == 0);
10348         assert(io.total_size == 0);
10349         assert(io.total_size_known == 0);
10350         assert(io.timeout == 250000);
10351 }
10352 
10353 void test77(FILE* out)
10354 {
10355         int argc = 0;
10356         char *argv[256] = { 0 };
10357 
10358         argv[argc++] = "ProgramName";
10359         argv[argc++] = "--no-twiddle";
10360 
10361         displayInit();
10362         ioInit();
10363 
10364 #ifdef PRINT_DEBUG
10365         print();
10366 #endif
10367         assert(d.start_time == 0);
10368         assert(d.total_time == 0);
10369         assert(d.current_time == 0);
10370         assert(d.elapsed_time == 0);
10371         assert(d.percent_complete == 0);
10372         assert(d.display_interval == 1);
10373         assert(d.overtime_flag == 0);
10374         assert(d.k == 1024);
10375         assert(d.twiddle == '-');
10376         assert(d.manual_width == 0);
10377         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10378         assert(d.display_datacount == 1);
10379         assert(d.display_throughput == 1);
10380         assert(d.display_time == 1);
10381         assert(d.display_percent == 1);
10382         assert(d.display_bar == 1);
10383         assert(d.display_summary == 1);
10384         assert(d.display_ansi == 0);
10385         assert(d.twiddle_fg_color == 0);
10386         assert(d.twiddle_bg_color == 0);
10387         assert(d.twiddle_fg_bold == 0);
10388         assert(d.datacount_fg_color == 0);
10389         assert(d.datacount_bg_color == 0);
10390         assert(d.datacount_fg_bold == 0);
10391         assert(d.throughput_label_fg_color == 0);
10392         assert(d.throughput_label_bg_color == 0);
10393         assert(d.throughput_label_fg_bold == 0);
10394         assert(d.throughput_fg_color == 0);
10395         assert(d.throughput_bg_color == 0);
10396         assert(d.throughput_fg_bold == 0);
10397         assert(d.time_label_fg_color == 0);
10398         assert(d.time_label_bg_color == 0);
10399         assert(d.time_label_fg_bold == 0);
10400         assert(d.percent_fg_color == 0);
10401         assert(d.percent_bg_color == 0);
10402         assert(d.percent_fg_bold == 0);
10403         assert(d.barbrace_fg_color == 0);
10404         assert(d.barbrace_bg_color == 0);
10405         assert(d.barbrace_fg_bold == 0);
10406         assert(d.bar_fg_color == 0);
10407         assert(d.bar_bg_color == 0);
10408         assert(d.bar_fg_bold == 0);
10409         assert(io.in == 0);
10410         assert(io.out == 1);
10411         assert(io.in_ready == 0);
10412         assert(io.out_ready == 0);
10413         assert(io.eof_in == 0);
10414         assert(io.eof_out == 0);
10415         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10416         /* assert(io.cbuf == 0x0); */
10417         assert(io.last_read == 0);
10418         assert(io.last_write == 0);
10419         assert(io.total_read == 0);
10420         assert(io.total_write == 0);
10421         assert(io.total_size == 0);
10422         assert(io.total_size_known == 0);
10423         assert(io.timeout == 250000);
10424 
10425         assert(parse_args(out, argc, argv) == 0);
10426 
10427 #ifdef PRINT_DEBUG
10428         print();
10429 #endif
10430         assert(d.start_time == 0);
10431         assert(d.total_time == 0);
10432         assert(d.current_time == 0);
10433         assert(d.elapsed_time == 0);
10434         assert(d.percent_complete == 0);
10435         assert(d.display_interval == 1);
10436         assert(d.overtime_flag == 0);
10437         assert(d.k == 1024);
10438         assert(d.twiddle == '-');
10439         assert(d.manual_width == 0); 
10440         assert(d.display_twiddle == 0);
10441         assert(d.display_datacount == 1);
10442         assert(d.display_throughput == 1);
10443         assert(d.display_time == 1);
10444         assert(d.display_percent == 1);
10445         assert(d.display_bar == 1);
10446         assert(d.display_summary == 1);
10447         assert(d.display_ansi == 0);
10448         assert(d.twiddle_fg_color == 0);
10449         assert(d.twiddle_bg_color == 0);
10450         assert(d.twiddle_fg_bold == 0);
10451         assert(d.datacount_fg_color == 0);
10452         assert(d.datacount_bg_color == 0);
10453         assert(d.datacount_fg_bold == 0);
10454         assert(d.throughput_label_fg_color == 0);
10455         assert(d.throughput_label_bg_color == 0);
10456         assert(d.throughput_label_fg_bold == 0);
10457         assert(d.throughput_fg_color == 0);
10458         assert(d.throughput_bg_color == 0);
10459         assert(d.throughput_fg_bold == 0);
10460         assert(d.time_label_fg_color == 0);
10461         assert(d.time_label_bg_color == 0);
10462         assert(d.time_label_fg_bold == 0);
10463         assert(d.percent_fg_color == 0);
10464         assert(d.percent_bg_color == 0);
10465         assert(d.percent_fg_bold == 0);
10466         assert(d.barbrace_fg_color == 0);
10467         assert(d.barbrace_bg_color == 0);
10468         assert(d.barbrace_fg_bold == 0);
10469         assert(d.bar_fg_color == 0);
10470         assert(d.bar_bg_color == 0);
10471         assert(d.bar_fg_bold == 0);
10472         assert(io.in == 0);
10473         assert(io.out == 1);
10474         assert(io.in_ready == 0);
10475         assert(io.out_ready == 0);
10476         assert(io.eof_in == 0);
10477         assert(io.eof_out == 0);
10478         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10479         /* assert(io.cbuf == 0x0); */
10480         assert(io.last_read == 0);
10481         assert(io.last_write == 0);
10482         assert(io.total_read == 0);
10483         assert(io.total_write == 0);
10484         assert(io.total_size == 0);
10485         assert(io.total_size_known == 0);
10486         assert(io.timeout == 250000);
10487 }
10488 
10489 void test78(FILE* out)
10490 {
10491         int argc = 0;
10492         char *argv[256] = { 0 };
10493 
10494         argv[argc++] = "ProgramName";
10495         argv[argc++] = "--display-count";
10496 
10497         displayInit();
10498         ioInit();
10499 
10500 #ifdef PRINT_DEBUG
10501         print();
10502 #endif
10503         assert(d.start_time == 0);
10504         assert(d.total_time == 0);
10505         assert(d.current_time == 0);
10506         assert(d.elapsed_time == 0);
10507         assert(d.percent_complete == 0);
10508         assert(d.display_interval == 1);
10509         assert(d.overtime_flag == 0);
10510         assert(d.k == 1024);
10511         assert(d.twiddle == '-');
10512         assert(d.manual_width == 0);
10513         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10514         assert(d.display_datacount == 1);
10515         assert(d.display_throughput == 1);
10516         assert(d.display_time == 1);
10517         assert(d.display_percent == 1);
10518         assert(d.display_bar == 1);
10519         assert(d.display_summary == 1);
10520         assert(d.display_ansi == 0);
10521         assert(d.twiddle_fg_color == 0);
10522         assert(d.twiddle_bg_color == 0);
10523         assert(d.twiddle_fg_bold == 0);
10524         assert(d.datacount_fg_color == 0);
10525         assert(d.datacount_bg_color == 0);
10526         assert(d.datacount_fg_bold == 0);
10527         assert(d.throughput_label_fg_color == 0);
10528         assert(d.throughput_label_bg_color == 0);
10529         assert(d.throughput_label_fg_bold == 0);
10530         assert(d.throughput_fg_color == 0);
10531         assert(d.throughput_bg_color == 0);
10532         assert(d.throughput_fg_bold == 0);
10533         assert(d.time_label_fg_color == 0);
10534         assert(d.time_label_bg_color == 0);
10535         assert(d.time_label_fg_bold == 0);
10536         assert(d.percent_fg_color == 0);
10537         assert(d.percent_bg_color == 0);
10538         assert(d.percent_fg_bold == 0);
10539         assert(d.barbrace_fg_color == 0);
10540         assert(d.barbrace_bg_color == 0);
10541         assert(d.barbrace_fg_bold == 0);
10542         assert(d.bar_fg_color == 0);
10543         assert(d.bar_bg_color == 0);
10544         assert(d.bar_fg_bold == 0);
10545         assert(io.in == 0);
10546         assert(io.out == 1);
10547         assert(io.in_ready == 0);
10548         assert(io.out_ready == 0);
10549         assert(io.eof_in == 0);
10550         assert(io.eof_out == 0);
10551         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10552         /* assert(io.cbuf == 0x0); */
10553         assert(io.last_read == 0);
10554         assert(io.last_write == 0);
10555         assert(io.total_read == 0);
10556         assert(io.total_write == 0);
10557         assert(io.total_size == 0);
10558         assert(io.total_size_known == 0);
10559         assert(io.timeout == 250000);
10560 
10561         d.display_datacount = 0;
10562         assert(parse_args(out, argc, argv) == 0);
10563 
10564 #ifdef PRINT_DEBUG
10565         print();
10566 #endif
10567         assert(d.start_time == 0);
10568         assert(d.total_time == 0);
10569         assert(d.current_time == 0);
10570         assert(d.elapsed_time == 0);
10571         assert(d.percent_complete == 0);
10572         assert(d.display_interval == 1);
10573         assert(d.overtime_flag == 0);
10574         assert(d.k == 1024);
10575         assert(d.twiddle == '-');
10576         assert(d.manual_width == 0); 
10577         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10578         assert(d.display_datacount == 1);
10579         assert(d.display_throughput == 1);
10580         assert(d.display_time == 1);
10581         assert(d.display_percent == 1);
10582         assert(d.display_bar == 1);
10583         assert(d.display_summary == 1);
10584         assert(d.display_ansi == 0);
10585         assert(d.twiddle_fg_color == 0);
10586         assert(d.twiddle_bg_color == 0);
10587         assert(d.twiddle_fg_bold == 0);
10588         assert(d.datacount_fg_color == 0);
10589         assert(d.datacount_bg_color == 0);
10590         assert(d.datacount_fg_bold == 0);
10591         assert(d.throughput_label_fg_color == 0);
10592         assert(d.throughput_label_bg_color == 0);
10593         assert(d.throughput_label_fg_bold == 0);
10594         assert(d.throughput_fg_color == 0);
10595         assert(d.throughput_bg_color == 0);
10596         assert(d.throughput_fg_bold == 0);
10597         assert(d.time_label_fg_color == 0);
10598         assert(d.time_label_bg_color == 0);
10599         assert(d.time_label_fg_bold == 0);
10600         assert(d.percent_fg_color == 0);
10601         assert(d.percent_bg_color == 0);
10602         assert(d.percent_fg_bold == 0);
10603         assert(d.barbrace_fg_color == 0);
10604         assert(d.barbrace_bg_color == 0);
10605         assert(d.barbrace_fg_bold == 0);
10606         assert(d.bar_fg_color == 0);
10607         assert(d.bar_bg_color == 0);
10608         assert(d.bar_fg_bold == 0);
10609         assert(io.in == 0);
10610         assert(io.out == 1);
10611         assert(io.in_ready == 0);
10612         assert(io.out_ready == 0);
10613         assert(io.eof_in == 0);
10614         assert(io.eof_out == 0);
10615         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10616         /* assert(io.cbuf == 0x0); */
10617         assert(io.last_read == 0);
10618         assert(io.last_write == 0);
10619         assert(io.total_read == 0);
10620         assert(io.total_write == 0);
10621         assert(io.total_size == 0);
10622         assert(io.total_size_known == 0);
10623         assert(io.timeout == 250000);
10624 }
10625 
10626 void test79(FILE* out)
10627 {
10628         int argc = 0;
10629         char *argv[256] = { 0 };
10630 
10631         argv[argc++] = "ProgramName";
10632         argv[argc++] = "--no-count";
10633 
10634         displayInit();
10635         ioInit();
10636 
10637 #ifdef PRINT_DEBUG
10638         print();
10639 #endif
10640         assert(d.start_time == 0);
10641         assert(d.total_time == 0);
10642         assert(d.current_time == 0);
10643         assert(d.elapsed_time == 0);
10644         assert(d.percent_complete == 0);
10645         assert(d.display_interval == 1);
10646         assert(d.overtime_flag == 0);
10647         assert(d.k == 1024);
10648         assert(d.twiddle == '-');
10649         assert(d.manual_width == 0);
10650         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10651         assert(d.display_datacount == 1);
10652         assert(d.display_throughput == 1);
10653         assert(d.display_time == 1);
10654         assert(d.display_percent == 1);
10655         assert(d.display_bar == 1);
10656         assert(d.display_summary == 1);
10657         assert(d.display_ansi == 0);
10658         assert(d.twiddle_fg_color == 0);
10659         assert(d.twiddle_bg_color == 0);
10660         assert(d.twiddle_fg_bold == 0);
10661         assert(d.datacount_fg_color == 0);
10662         assert(d.datacount_bg_color == 0);
10663         assert(d.datacount_fg_bold == 0);
10664         assert(d.throughput_label_fg_color == 0);
10665         assert(d.throughput_label_bg_color == 0);
10666         assert(d.throughput_label_fg_bold == 0);
10667         assert(d.throughput_fg_color == 0);
10668         assert(d.throughput_bg_color == 0);
10669         assert(d.throughput_fg_bold == 0);
10670         assert(d.time_label_fg_color == 0);
10671         assert(d.time_label_bg_color == 0);
10672         assert(d.time_label_fg_bold == 0);
10673         assert(d.percent_fg_color == 0);
10674         assert(d.percent_bg_color == 0);
10675         assert(d.percent_fg_bold == 0);
10676         assert(d.barbrace_fg_color == 0);
10677         assert(d.barbrace_bg_color == 0);
10678         assert(d.barbrace_fg_bold == 0);
10679         assert(d.bar_fg_color == 0);
10680         assert(d.bar_bg_color == 0);
10681         assert(d.bar_fg_bold == 0);
10682         assert(io.in == 0);
10683         assert(io.out == 1);
10684         assert(io.in_ready == 0);
10685         assert(io.out_ready == 0);
10686         assert(io.eof_in == 0);
10687         assert(io.eof_out == 0);
10688         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10689         /* assert(io.cbuf == 0x0); */
10690         assert(io.last_read == 0);
10691         assert(io.last_write == 0);
10692         assert(io.total_read == 0);
10693         assert(io.total_write == 0);
10694         assert(io.total_size == 0);
10695         assert(io.total_size_known == 0);
10696         assert(io.timeout == 250000);
10697 
10698         assert(parse_args(out, argc, argv) == 0);
10699 
10700 #ifdef PRINT_DEBUG
10701         print();
10702 #endif
10703         assert(d.start_time == 0);
10704         assert(d.total_time == 0);
10705         assert(d.current_time == 0);
10706         assert(d.elapsed_time == 0);
10707         assert(d.percent_complete == 0);
10708         assert(d.display_interval == 1);
10709         assert(d.overtime_flag == 0);
10710         assert(d.k == 1024);
10711         assert(d.twiddle == '-');
10712         assert(d.manual_width == 0); 
10713         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10714         assert(d.display_datacount == 0);
10715         assert(d.display_throughput == 1);
10716         assert(d.display_time == 1);
10717         assert(d.display_percent == 1);
10718         assert(d.display_bar == 1);
10719         assert(d.display_summary == 1);
10720         assert(d.display_ansi == 0);
10721         assert(d.twiddle_fg_color == 0);
10722         assert(d.twiddle_bg_color == 0);
10723         assert(d.twiddle_fg_bold == 0);
10724         assert(d.datacount_fg_color == 0);
10725         assert(d.datacount_bg_color == 0);
10726         assert(d.datacount_fg_bold == 0);
10727         assert(d.throughput_label_fg_color == 0);
10728         assert(d.throughput_label_bg_color == 0);
10729         assert(d.throughput_label_fg_bold == 0);
10730         assert(d.throughput_fg_color == 0);
10731         assert(d.throughput_bg_color == 0);
10732         assert(d.throughput_fg_bold == 0);
10733         assert(d.time_label_fg_color == 0);
10734         assert(d.time_label_bg_color == 0);
10735         assert(d.time_label_fg_bold == 0);
10736         assert(d.percent_fg_color == 0);
10737         assert(d.percent_bg_color == 0);
10738         assert(d.percent_fg_bold == 0);
10739         assert(d.barbrace_fg_color == 0);
10740         assert(d.barbrace_bg_color == 0);
10741         assert(d.barbrace_fg_bold == 0);
10742         assert(d.bar_fg_color == 0);
10743         assert(d.bar_bg_color == 0);
10744         assert(d.bar_fg_bold == 0);
10745         assert(io.in == 0);
10746         assert(io.out == 1);
10747         assert(io.in_ready == 0);
10748         assert(io.out_ready == 0);
10749         assert(io.eof_in == 0);
10750         assert(io.eof_out == 0);
10751         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10752         /* assert(io.cbuf == 0x0); */
10753         assert(io.last_read == 0);
10754         assert(io.last_write == 0);
10755         assert(io.total_read == 0);
10756         assert(io.total_write == 0);
10757         assert(io.total_size == 0);
10758         assert(io.total_size_known == 0);
10759         assert(io.timeout == 250000);
10760 }
10761 
10762 void test80(FILE* out)
10763 {
10764         int argc = 0;
10765         char *argv[256] = { 0 };
10766 
10767         argv[argc++] = "ProgramName";
10768         argv[argc++] = "--display-throughput";
10769 
10770         displayInit();
10771         ioInit();
10772 
10773 #ifdef PRINT_DEBUG
10774         print();
10775 #endif
10776         assert(d.start_time == 0);
10777         assert(d.total_time == 0);
10778         assert(d.current_time == 0);
10779         assert(d.elapsed_time == 0);
10780         assert(d.percent_complete == 0);
10781         assert(d.display_interval == 1);
10782         assert(d.overtime_flag == 0);
10783         assert(d.k == 1024);
10784         assert(d.twiddle == '-');
10785         assert(d.manual_width == 0);
10786         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10787         assert(d.display_datacount == 1);
10788         assert(d.display_throughput == 1);
10789         assert(d.display_time == 1);
10790         assert(d.display_percent == 1);
10791         assert(d.display_bar == 1);
10792         assert(d.display_summary == 1);
10793         assert(d.display_ansi == 0);
10794         assert(d.twiddle_fg_color == 0);
10795         assert(d.twiddle_bg_color == 0);
10796         assert(d.twiddle_fg_bold == 0);
10797         assert(d.datacount_fg_color == 0);
10798         assert(d.datacount_bg_color == 0);
10799         assert(d.datacount_fg_bold == 0);
10800         assert(d.throughput_label_fg_color == 0);
10801         assert(d.throughput_label_bg_color == 0);
10802         assert(d.throughput_label_fg_bold == 0);
10803         assert(d.throughput_fg_color == 0);
10804         assert(d.throughput_bg_color == 0);
10805         assert(d.throughput_fg_bold == 0);
10806         assert(d.time_label_fg_color == 0);
10807         assert(d.time_label_bg_color == 0);
10808         assert(d.time_label_fg_bold == 0);
10809         assert(d.percent_fg_color == 0);
10810         assert(d.percent_bg_color == 0);
10811         assert(d.percent_fg_bold == 0);
10812         assert(d.barbrace_fg_color == 0);
10813         assert(d.barbrace_bg_color == 0);
10814         assert(d.barbrace_fg_bold == 0);
10815         assert(d.bar_fg_color == 0);
10816         assert(d.bar_bg_color == 0);
10817         assert(d.bar_fg_bold == 0);
10818         assert(io.in == 0);
10819         assert(io.out == 1);
10820         assert(io.in_ready == 0);
10821         assert(io.out_ready == 0);
10822         assert(io.eof_in == 0);
10823         assert(io.eof_out == 0);
10824         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10825         /* assert(io.cbuf == 0x0); */
10826         assert(io.last_read == 0);
10827         assert(io.last_write == 0);
10828         assert(io.total_read == 0);
10829         assert(io.total_write == 0);
10830         assert(io.total_size == 0);
10831         assert(io.total_size_known == 0);
10832         assert(io.timeout == 250000);
10833 
10834         d.display_throughput = 0;
10835         assert(parse_args(out, argc, argv) == 0);
10836 
10837 #ifdef PRINT_DEBUG
10838         print();
10839 #endif
10840         assert(d.start_time == 0);
10841         assert(d.total_time == 0);
10842         assert(d.current_time == 0);
10843         assert(d.elapsed_time == 0);
10844         assert(d.percent_complete == 0);
10845         assert(d.display_interval == 1);
10846         assert(d.overtime_flag == 0);
10847         assert(d.k == 1024);
10848         assert(d.twiddle == '-');
10849         assert(d.manual_width == 0); 
10850         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10851         assert(d.display_datacount == 1);
10852         assert(d.display_throughput == 1);
10853         assert(d.display_time == 1);
10854         assert(d.display_percent == 1);
10855         assert(d.display_bar == 1);
10856         assert(d.display_summary == 1);
10857         assert(d.display_ansi == 0);
10858         assert(d.twiddle_fg_color == 0);
10859         assert(d.twiddle_bg_color == 0);
10860         assert(d.twiddle_fg_bold == 0);
10861         assert(d.datacount_fg_color == 0);
10862         assert(d.datacount_bg_color == 0);
10863         assert(d.datacount_fg_bold == 0);
10864         assert(d.throughput_label_fg_color == 0);
10865         assert(d.throughput_label_bg_color == 0);
10866         assert(d.throughput_label_fg_bold == 0);
10867         assert(d.throughput_fg_color == 0);
10868         assert(d.throughput_bg_color == 0);
10869         assert(d.throughput_fg_bold == 0);
10870         assert(d.time_label_fg_color == 0);
10871         assert(d.time_label_bg_color == 0);
10872         assert(d.time_label_fg_bold == 0);
10873         assert(d.percent_fg_color == 0);
10874         assert(d.percent_bg_color == 0);
10875         assert(d.percent_fg_bold == 0);
10876         assert(d.barbrace_fg_color == 0);
10877         assert(d.barbrace_bg_color == 0);
10878         assert(d.barbrace_fg_bold == 0);
10879         assert(d.bar_fg_color == 0);
10880         assert(d.bar_bg_color == 0);
10881         assert(d.bar_fg_bold == 0);
10882         assert(io.in == 0);
10883         assert(io.out == 1);
10884         assert(io.in_ready == 0);
10885         assert(io.out_ready == 0);
10886         assert(io.eof_in == 0);
10887         assert(io.eof_out == 0);
10888         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10889         /* assert(io.cbuf == 0x0); */
10890         assert(io.last_read == 0);
10891         assert(io.last_write == 0);
10892         assert(io.total_read == 0);
10893         assert(io.total_write == 0);
10894         assert(io.total_size == 0);
10895         assert(io.total_size_known == 0);
10896         assert(io.timeout == 250000);
10897 }
10898 
10899 void test81(FILE* out)
10900 {
10901         int argc = 0;
10902         char *argv[256] = { 0 };
10903 
10904         argv[argc++] = "ProgramName";
10905         argv[argc++] = "--no-throughput";
10906 
10907         displayInit();
10908         ioInit();
10909 
10910 #ifdef PRINT_DEBUG
10911         print();
10912 #endif
10913         assert(d.start_time == 0);
10914         assert(d.total_time == 0);
10915         assert(d.current_time == 0);
10916         assert(d.elapsed_time == 0);
10917         assert(d.percent_complete == 0);
10918         assert(d.display_interval == 1);
10919         assert(d.overtime_flag == 0);
10920         assert(d.k == 1024);
10921         assert(d.twiddle == '-');
10922         assert(d.manual_width == 0);
10923         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10924         assert(d.display_datacount == 1);
10925         assert(d.display_throughput == 1);
10926         assert(d.display_time == 1);
10927         assert(d.display_percent == 1);
10928         assert(d.display_bar == 1);
10929         assert(d.display_summary == 1);
10930         assert(d.display_ansi == 0);
10931         assert(d.twiddle_fg_color == 0);
10932         assert(d.twiddle_bg_color == 0);
10933         assert(d.twiddle_fg_bold == 0);
10934         assert(d.datacount_fg_color == 0);
10935         assert(d.datacount_bg_color == 0);
10936         assert(d.datacount_fg_bold == 0);
10937         assert(d.throughput_label_fg_color == 0);
10938         assert(d.throughput_label_bg_color == 0);
10939         assert(d.throughput_label_fg_bold == 0);
10940         assert(d.throughput_fg_color == 0);
10941         assert(d.throughput_bg_color == 0);
10942         assert(d.throughput_fg_bold == 0);
10943         assert(d.time_label_fg_color == 0);
10944         assert(d.time_label_bg_color == 0);
10945         assert(d.time_label_fg_bold == 0);
10946         assert(d.percent_fg_color == 0);
10947         assert(d.percent_bg_color == 0);
10948         assert(d.percent_fg_bold == 0);
10949         assert(d.barbrace_fg_color == 0);
10950         assert(d.barbrace_bg_color == 0);
10951         assert(d.barbrace_fg_bold == 0);
10952         assert(d.bar_fg_color == 0);
10953         assert(d.bar_bg_color == 0);
10954         assert(d.bar_fg_bold == 0);
10955         assert(io.in == 0);
10956         assert(io.out == 1);
10957         assert(io.in_ready == 0);
10958         assert(io.out_ready == 0);
10959         assert(io.eof_in == 0);
10960         assert(io.eof_out == 0);
10961         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
10962         /* assert(io.cbuf == 0x0); */
10963         assert(io.last_read == 0);
10964         assert(io.last_write == 0);
10965         assert(io.total_read == 0);
10966         assert(io.total_write == 0);
10967         assert(io.total_size == 0);
10968         assert(io.total_size_known == 0);
10969         assert(io.timeout == 250000);
10970 
10971         assert(parse_args(out, argc, argv) == 0);
10972 
10973 #ifdef PRINT_DEBUG
10974         print();
10975 #endif
10976         assert(d.start_time == 0);
10977         assert(d.total_time == 0);
10978         assert(d.current_time == 0);
10979         assert(d.elapsed_time == 0);
10980         assert(d.percent_complete == 0);
10981         assert(d.display_interval == 1);
10982         assert(d.overtime_flag == 0);
10983         assert(d.k == 1024);
10984         assert(d.twiddle == '-');
10985         assert(d.manual_width == 0); 
10986         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
10987         assert(d.display_datacount == 1);
10988         assert(d.display_throughput == 0);
10989         assert(d.display_time == 1);
10990         assert(d.display_percent == 1);
10991         assert(d.display_bar == 1);
10992         assert(d.display_summary == 1);
10993         assert(d.display_ansi == 0);
10994         assert(d.twiddle_fg_color == 0);
10995         assert(d.twiddle_bg_color == 0);
10996         assert(d.twiddle_fg_bold == 0);
10997         assert(d.datacount_fg_color == 0);
10998         assert(d.datacount_bg_color == 0);
10999         assert(d.datacount_fg_bold == 0);
11000         assert(d.throughput_label_fg_color == 0);
11001         assert(d.throughput_label_bg_color == 0);
11002         assert(d.throughput_label_fg_bold == 0);
11003         assert(d.throughput_fg_color == 0);
11004         assert(d.throughput_bg_color == 0);
11005         assert(d.throughput_fg_bold == 0);
11006         assert(d.time_label_fg_color == 0);
11007         assert(d.time_label_bg_color == 0);
11008         assert(d.time_label_fg_bold == 0);
11009         assert(d.percent_fg_color == 0);
11010         assert(d.percent_bg_color == 0);
11011         assert(d.percent_fg_bold == 0);
11012         assert(d.barbrace_fg_color == 0);
11013         assert(d.barbrace_bg_color == 0);
11014         assert(d.barbrace_fg_bold == 0);
11015         assert(d.bar_fg_color == 0);
11016         assert(d.bar_bg_color == 0);
11017         assert(d.bar_fg_bold == 0);
11018         assert(io.in == 0);
11019         assert(io.out == 1);
11020         assert(io.in_ready == 0);
11021         assert(io.out_ready == 0);
11022         assert(io.eof_in == 0);
11023         assert(io.eof_out == 0);
11024         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11025         /* assert(io.cbuf == 0x0); */
11026         assert(io.last_read == 0);
11027         assert(io.last_write == 0);
11028         assert(io.total_read == 0);
11029         assert(io.total_write == 0);
11030         assert(io.total_size == 0);
11031         assert(io.total_size_known == 0);
11032         assert(io.timeout == 250000);
11033 }
11034 
11035 void test82(FILE* out)
11036 {
11037         int argc = 0;
11038         char *argv[256] = { 0 };
11039 
11040         argv[argc++] = "ProgramName";
11041         argv[argc++] = "--display-time";
11042 
11043         displayInit();
11044         ioInit();
11045 
11046 #ifdef PRINT_DEBUG
11047         print();
11048 #endif
11049         assert(d.start_time == 0);
11050         assert(d.total_time == 0);
11051         assert(d.current_time == 0);
11052         assert(d.elapsed_time == 0);
11053         assert(d.percent_complete == 0);
11054         assert(d.display_interval == 1);
11055         assert(d.overtime_flag == 0);
11056         assert(d.k == 1024);
11057         assert(d.twiddle == '-');
11058         assert(d.manual_width == 0);
11059         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11060         assert(d.display_datacount == 1);
11061         assert(d.display_throughput == 1);
11062         assert(d.display_time == 1);
11063         assert(d.display_percent == 1);
11064         assert(d.display_bar == 1);
11065         assert(d.display_summary == 1);
11066         assert(d.display_ansi == 0);
11067         assert(d.twiddle_fg_color == 0);
11068         assert(d.twiddle_bg_color == 0);
11069         assert(d.twiddle_fg_bold == 0);
11070         assert(d.datacount_fg_color == 0);
11071         assert(d.datacount_bg_color == 0);
11072         assert(d.datacount_fg_bold == 0);
11073         assert(d.throughput_label_fg_color == 0);
11074         assert(d.throughput_label_bg_color == 0);
11075         assert(d.throughput_label_fg_bold == 0);
11076         assert(d.throughput_fg_color == 0);
11077         assert(d.throughput_bg_color == 0);
11078         assert(d.throughput_fg_bold == 0);
11079         assert(d.time_label_fg_color == 0);
11080         assert(d.time_label_bg_color == 0);
11081         assert(d.time_label_fg_bold == 0);
11082         assert(d.percent_fg_color == 0);
11083         assert(d.percent_bg_color == 0);
11084         assert(d.percent_fg_bold == 0);
11085         assert(d.barbrace_fg_color == 0);
11086         assert(d.barbrace_bg_color == 0);
11087         assert(d.barbrace_fg_bold == 0);
11088         assert(d.bar_fg_color == 0);
11089         assert(d.bar_bg_color == 0);
11090         assert(d.bar_fg_bold == 0);
11091         assert(io.in == 0);
11092         assert(io.out == 1);
11093         assert(io.in_ready == 0);
11094         assert(io.out_ready == 0);
11095         assert(io.eof_in == 0);
11096         assert(io.eof_out == 0);
11097         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11098         /* assert(io.cbuf == 0x0); */
11099         assert(io.last_read == 0);
11100         assert(io.last_write == 0);
11101         assert(io.total_read == 0);
11102         assert(io.total_write == 0);
11103         assert(io.total_size == 0);
11104         assert(io.total_size_known == 0);
11105         assert(io.timeout == 250000);
11106 
11107         d.display_time = 0;
11108         assert(parse_args(out, argc, argv) == 0);
11109 
11110 #ifdef PRINT_DEBUG
11111         print();
11112 #endif
11113         assert(d.start_time == 0);
11114         assert(d.total_time == 0);
11115         assert(d.current_time == 0);
11116         assert(d.elapsed_time == 0);
11117         assert(d.percent_complete == 0);
11118         assert(d.display_interval == 1);
11119         assert(d.overtime_flag == 0);
11120         assert(d.k == 1024);
11121         assert(d.twiddle == '-');
11122         assert(d.manual_width == 0); 
11123         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11124         assert(d.display_datacount == 1);
11125         assert(d.display_throughput == 1);
11126         assert(d.display_time == 1);
11127         assert(d.display_percent == 1);
11128         assert(d.display_bar == 1);
11129         assert(d.display_summary == 1);
11130         assert(d.display_ansi == 0);
11131         assert(d.twiddle_fg_color == 0);
11132         assert(d.twiddle_bg_color == 0);
11133         assert(d.twiddle_fg_bold == 0);
11134         assert(d.datacount_fg_color == 0);
11135         assert(d.datacount_bg_color == 0);
11136         assert(d.datacount_fg_bold == 0);
11137         assert(d.throughput_label_fg_color == 0);
11138         assert(d.throughput_label_bg_color == 0);
11139         assert(d.throughput_label_fg_bold == 0);
11140         assert(d.throughput_fg_color == 0);
11141         assert(d.throughput_bg_color == 0);
11142         assert(d.throughput_fg_bold == 0);
11143         assert(d.time_label_fg_color == 0);
11144         assert(d.time_label_bg_color == 0);
11145         assert(d.time_label_fg_bold == 0);
11146         assert(d.percent_fg_color == 0);
11147         assert(d.percent_bg_color == 0);
11148         assert(d.percent_fg_bold == 0);
11149         assert(d.barbrace_fg_color == 0);
11150         assert(d.barbrace_bg_color == 0);
11151         assert(d.barbrace_fg_bold == 0);
11152         assert(d.bar_fg_color == 0);
11153         assert(d.bar_bg_color == 0);
11154         assert(d.bar_fg_bold == 0);
11155         assert(io.in == 0);
11156         assert(io.out == 1);
11157         assert(io.in_ready == 0);
11158         assert(io.out_ready == 0);
11159         assert(io.eof_in == 0);
11160         assert(io.eof_out == 0);
11161         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11162         /* assert(io.cbuf == 0x0); */
11163         assert(io.last_read == 0);
11164         assert(io.last_write == 0);
11165         assert(io.total_read == 0);
11166         assert(io.total_write == 0);
11167         assert(io.total_size == 0);
11168         assert(io.total_size_known == 0);
11169         assert(io.timeout == 250000);
11170 }
11171 
11172 void test83(FILE* out)
11173 {
11174         int argc = 0;
11175         char *argv[256] = { 0 };
11176 
11177         argv[argc++] = "ProgramName";
11178         argv[argc++] = "--no-time";
11179 
11180         displayInit();
11181         ioInit();
11182 
11183 #ifdef PRINT_DEBUG
11184         print();
11185 #endif
11186         assert(d.start_time == 0);
11187         assert(d.total_time == 0);
11188         assert(d.current_time == 0);
11189         assert(d.elapsed_time == 0);
11190         assert(d.percent_complete == 0);
11191         assert(d.display_interval == 1);
11192         assert(d.overtime_flag == 0);
11193         assert(d.k == 1024);
11194         assert(d.twiddle == '-');
11195         assert(d.manual_width == 0);
11196         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11197         assert(d.display_datacount == 1);
11198         assert(d.display_throughput == 1);
11199         assert(d.display_time == 1);
11200         assert(d.display_percent == 1);
11201         assert(d.display_bar == 1);
11202         assert(d.display_summary == 1);
11203         assert(d.display_ansi == 0);
11204         assert(d.twiddle_fg_color == 0);
11205         assert(d.twiddle_bg_color == 0);
11206         assert(d.twiddle_fg_bold == 0);
11207         assert(d.datacount_fg_color == 0);
11208         assert(d.datacount_bg_color == 0);
11209         assert(d.datacount_fg_bold == 0);
11210         assert(d.throughput_label_fg_color == 0);
11211         assert(d.throughput_label_bg_color == 0);
11212         assert(d.throughput_label_fg_bold == 0);
11213         assert(d.throughput_fg_color == 0);
11214         assert(d.throughput_bg_color == 0);
11215         assert(d.throughput_fg_bold == 0);
11216         assert(d.time_label_fg_color == 0);
11217         assert(d.time_label_bg_color == 0);
11218         assert(d.time_label_fg_bold == 0);
11219         assert(d.percent_fg_color == 0);
11220         assert(d.percent_bg_color == 0);
11221         assert(d.percent_fg_bold == 0);
11222         assert(d.barbrace_fg_color == 0);
11223         assert(d.barbrace_bg_color == 0);
11224         assert(d.barbrace_fg_bold == 0);
11225         assert(d.bar_fg_color == 0);
11226         assert(d.bar_bg_color == 0);
11227         assert(d.bar_fg_bold == 0);
11228         assert(io.in == 0);
11229         assert(io.out == 1);
11230         assert(io.in_ready == 0);
11231         assert(io.out_ready == 0);
11232         assert(io.eof_in == 0);
11233         assert(io.eof_out == 0);
11234         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11235         /* assert(io.cbuf == 0x0); */
11236         assert(io.last_read == 0);
11237         assert(io.last_write == 0);
11238         assert(io.total_read == 0);
11239         assert(io.total_write == 0);
11240         assert(io.total_size == 0);
11241         assert(io.total_size_known == 0);
11242         assert(io.timeout == 250000);
11243 
11244         assert(parse_args(out, argc, argv) == 0);
11245 
11246 #ifdef PRINT_DEBUG
11247         print();
11248 #endif
11249         assert(d.start_time == 0);
11250         assert(d.total_time == 0);
11251         assert(d.current_time == 0);
11252         assert(d.elapsed_time == 0);
11253         assert(d.percent_complete == 0);
11254         assert(d.display_interval == 1);
11255         assert(d.overtime_flag == 0);
11256         assert(d.k == 1024);
11257         assert(d.twiddle == '-');
11258         assert(d.manual_width == 0); 
11259         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11260         assert(d.display_datacount == 1);
11261         assert(d.display_throughput == 1);
11262         assert(d.display_time == 0);
11263         assert(d.display_percent == 1);
11264         assert(d.display_bar == 1);
11265         assert(d.display_summary == 1);
11266         assert(d.display_ansi == 0);
11267         assert(d.twiddle_fg_color == 0);
11268         assert(d.twiddle_bg_color == 0);
11269         assert(d.twiddle_fg_bold == 0);
11270         assert(d.datacount_fg_color == 0);
11271         assert(d.datacount_bg_color == 0);
11272         assert(d.datacount_fg_bold == 0);
11273         assert(d.throughput_label_fg_color == 0);
11274         assert(d.throughput_label_bg_color == 0);
11275         assert(d.throughput_label_fg_bold == 0);
11276         assert(d.throughput_fg_color == 0);
11277         assert(d.throughput_bg_color == 0);
11278         assert(d.throughput_fg_bold == 0);
11279         assert(d.time_label_fg_color == 0);
11280         assert(d.time_label_bg_color == 0);
11281         assert(d.time_label_fg_bold == 0);
11282         assert(d.percent_fg_color == 0);
11283         assert(d.percent_bg_color == 0);
11284         assert(d.percent_fg_bold == 0);
11285         assert(d.barbrace_fg_color == 0);
11286         assert(d.barbrace_bg_color == 0);
11287         assert(d.barbrace_fg_bold == 0);
11288         assert(d.bar_fg_color == 0);
11289         assert(d.bar_bg_color == 0);
11290         assert(d.bar_fg_bold == 0);
11291         assert(io.in == 0);
11292         assert(io.out == 1);
11293         assert(io.in_ready == 0);
11294         assert(io.out_ready == 0);
11295         assert(io.eof_in == 0);
11296         assert(io.eof_out == 0);
11297         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11298         /* assert(io.cbuf == 0x0); */
11299         assert(io.last_read == 0);
11300         assert(io.last_write == 0);
11301         assert(io.total_read == 0);
11302         assert(io.total_write == 0);
11303         assert(io.total_size == 0);
11304         assert(io.total_size_known == 0);
11305         assert(io.timeout == 250000);
11306 }
11307 
11308 void test84(FILE* out)
11309 {
11310         int argc = 0;
11311         char *argv[256] = { 0 };
11312 
11313         argv[argc++] = "ProgramName";
11314         argv[argc++] = "--display-percent";
11315 
11316         displayInit();
11317         ioInit();
11318 
11319 #ifdef PRINT_DEBUG
11320         print();
11321 #endif
11322         assert(d.start_time == 0);
11323         assert(d.total_time == 0);
11324         assert(d.current_time == 0);
11325         assert(d.elapsed_time == 0);
11326         assert(d.percent_complete == 0);
11327         assert(d.display_interval == 1);
11328         assert(d.overtime_flag == 0);
11329         assert(d.k == 1024);
11330         assert(d.twiddle == '-');
11331         assert(d.manual_width == 0);
11332         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11333         assert(d.display_datacount == 1);
11334         assert(d.display_throughput == 1);
11335         assert(d.display_time == 1);
11336         assert(d.display_percent == 1);
11337         assert(d.display_bar == 1);
11338         assert(d.display_summary == 1);
11339         assert(d.display_ansi == 0);
11340         assert(d.twiddle_fg_color == 0);
11341         assert(d.twiddle_bg_color == 0);
11342         assert(d.twiddle_fg_bold == 0);
11343         assert(d.datacount_fg_color == 0);
11344         assert(d.datacount_bg_color == 0);
11345         assert(d.datacount_fg_bold == 0);
11346         assert(d.throughput_label_fg_color == 0);
11347         assert(d.throughput_label_bg_color == 0);
11348         assert(d.throughput_label_fg_bold == 0);
11349         assert(d.throughput_fg_color == 0);
11350         assert(d.throughput_bg_color == 0);
11351         assert(d.throughput_fg_bold == 0);
11352         assert(d.time_label_fg_color == 0);
11353         assert(d.time_label_bg_color == 0);
11354         assert(d.time_label_fg_bold == 0);
11355         assert(d.percent_fg_color == 0);
11356         assert(d.percent_bg_color == 0);
11357         assert(d.percent_fg_bold == 0);
11358         assert(d.barbrace_fg_color == 0);
11359         assert(d.barbrace_bg_color == 0);
11360         assert(d.barbrace_fg_bold == 0);
11361         assert(d.bar_fg_color == 0);
11362         assert(d.bar_bg_color == 0);
11363         assert(d.bar_fg_bold == 0);
11364         assert(io.in == 0);
11365         assert(io.out == 1);
11366         assert(io.in_ready == 0);
11367         assert(io.out_ready == 0);
11368         assert(io.eof_in == 0);
11369         assert(io.eof_out == 0);
11370         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11371         /* assert(io.cbuf == 0x0); */
11372         assert(io.last_read == 0);
11373         assert(io.last_write == 0);
11374         assert(io.total_read == 0);
11375         assert(io.total_write == 0);
11376         assert(io.total_size == 0);
11377         assert(io.total_size_known == 0);
11378         assert(io.timeout == 250000);
11379 
11380         d.display_percent = 0;
11381         assert(parse_args(out, argc, argv) == 0);
11382 
11383 #ifdef PRINT_DEBUG
11384         print();
11385 #endif
11386         assert(d.start_time == 0);
11387         assert(d.total_time == 0);
11388         assert(d.current_time == 0);
11389         assert(d.elapsed_time == 0);
11390         assert(d.percent_complete == 0);
11391         assert(d.display_interval == 1);
11392         assert(d.overtime_flag == 0);
11393         assert(d.k == 1024);
11394         assert(d.twiddle == '-');
11395         assert(d.manual_width == 0); 
11396         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11397         assert(d.display_datacount == 1);
11398         assert(d.display_throughput == 1);
11399         assert(d.display_time == 1);
11400         assert(d.display_percent == 1);
11401         assert(d.display_bar == 1);
11402         assert(d.display_summary == 1);
11403         assert(d.display_ansi == 0);
11404         assert(d.twiddle_fg_color == 0);
11405         assert(d.twiddle_bg_color == 0);
11406         assert(d.twiddle_fg_bold == 0);
11407         assert(d.datacount_fg_color == 0);
11408         assert(d.datacount_bg_color == 0);
11409         assert(d.datacount_fg_bold == 0);
11410         assert(d.throughput_label_fg_color == 0);
11411         assert(d.throughput_label_bg_color == 0);
11412         assert(d.throughput_label_fg_bold == 0);
11413         assert(d.throughput_fg_color == 0);
11414         assert(d.throughput_bg_color == 0);
11415         assert(d.throughput_fg_bold == 0);
11416         assert(d.time_label_fg_color == 0);
11417         assert(d.time_label_bg_color == 0);
11418         assert(d.time_label_fg_bold == 0);
11419         assert(d.percent_fg_color == 0);
11420         assert(d.percent_bg_color == 0);
11421         assert(d.percent_fg_bold == 0);
11422         assert(d.barbrace_fg_color == 0);
11423         assert(d.barbrace_bg_color == 0);
11424         assert(d.barbrace_fg_bold == 0);
11425         assert(d.bar_fg_color == 0);
11426         assert(d.bar_bg_color == 0);
11427         assert(d.bar_fg_bold == 0);
11428         assert(io.in == 0);
11429         assert(io.out == 1);
11430         assert(io.in_ready == 0);
11431         assert(io.out_ready == 0);
11432         assert(io.eof_in == 0);
11433         assert(io.eof_out == 0);
11434         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11435         /* assert(io.cbuf == 0x0); */
11436         assert(io.last_read == 0);
11437         assert(io.last_write == 0);
11438         assert(io.total_read == 0);
11439         assert(io.total_write == 0);
11440         assert(io.total_size == 0);
11441         assert(io.total_size_known == 0);
11442         assert(io.timeout == 250000);
11443 }
11444 
11445 void test85(FILE* out)
11446 {
11447         int argc = 0;
11448         char *argv[256] = { 0 };
11449 
11450         argv[argc++] = "ProgramName";
11451         argv[argc++] = "--no-percent";
11452 
11453         displayInit();
11454         ioInit();
11455 
11456 #ifdef PRINT_DEBUG
11457         print();
11458 #endif
11459         assert(d.start_time == 0);
11460         assert(d.total_time == 0);
11461         assert(d.current_time == 0);
11462         assert(d.elapsed_time == 0);
11463         assert(d.percent_complete == 0);
11464         assert(d.display_interval == 1);
11465         assert(d.overtime_flag == 0);
11466         assert(d.k == 1024);
11467         assert(d.twiddle == '-');
11468         assert(d.manual_width == 0);
11469         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11470         assert(d.display_datacount == 1);
11471         assert(d.display_throughput == 1);
11472         assert(d.display_time == 1);
11473         assert(d.display_percent == 1);
11474         assert(d.display_bar == 1);
11475         assert(d.display_summary == 1);
11476         assert(d.display_ansi == 0);
11477         assert(d.twiddle_fg_color == 0);
11478         assert(d.twiddle_bg_color == 0);
11479         assert(d.twiddle_fg_bold == 0);
11480         assert(d.datacount_fg_color == 0);
11481         assert(d.datacount_bg_color == 0);
11482         assert(d.datacount_fg_bold == 0);
11483         assert(d.throughput_label_fg_color == 0);
11484         assert(d.throughput_label_bg_color == 0);
11485         assert(d.throughput_label_fg_bold == 0);
11486         assert(d.throughput_fg_color == 0);
11487         assert(d.throughput_bg_color == 0);
11488         assert(d.throughput_fg_bold == 0);
11489         assert(d.time_label_fg_color == 0);
11490         assert(d.time_label_bg_color == 0);
11491         assert(d.time_label_fg_bold == 0);
11492         assert(d.percent_fg_color == 0);
11493         assert(d.percent_bg_color == 0);
11494         assert(d.percent_fg_bold == 0);
11495         assert(d.barbrace_fg_color == 0);
11496         assert(d.barbrace_bg_color == 0);
11497         assert(d.barbrace_fg_bold == 0);
11498         assert(d.bar_fg_color == 0);
11499         assert(d.bar_bg_color == 0);
11500         assert(d.bar_fg_bold == 0);
11501         assert(io.in == 0);
11502         assert(io.out == 1);
11503         assert(io.in_ready == 0);
11504         assert(io.out_ready == 0);
11505         assert(io.eof_in == 0);
11506         assert(io.eof_out == 0);
11507         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11508         /* assert(io.cbuf == 0x0); */
11509         assert(io.last_read == 0);
11510         assert(io.last_write == 0);
11511         assert(io.total_read == 0);
11512         assert(io.total_write == 0);
11513         assert(io.total_size == 0);
11514         assert(io.total_size_known == 0);
11515         assert(io.timeout == 250000);
11516 
11517         assert(parse_args(out, argc, argv) == 0);
11518 
11519 #ifdef PRINT_DEBUG
11520         print();
11521 #endif
11522         assert(d.start_time == 0);
11523         assert(d.total_time == 0);
11524         assert(d.current_time == 0);
11525         assert(d.elapsed_time == 0);
11526         assert(d.percent_complete == 0);
11527         assert(d.display_interval == 1);
11528         assert(d.overtime_flag == 0);
11529         assert(d.k == 1024);
11530         assert(d.twiddle == '-');
11531         assert(d.manual_width == 0); 
11532         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11533         assert(d.display_datacount == 1);
11534         assert(d.display_throughput == 1);
11535         assert(d.display_time == 1);
11536         assert(d.display_percent == 0);
11537         assert(d.display_bar == 1);
11538         assert(d.display_summary == 1);
11539         assert(d.display_ansi == 0);
11540         assert(d.twiddle_fg_color == 0);
11541         assert(d.twiddle_bg_color == 0);
11542         assert(d.twiddle_fg_bold == 0);
11543         assert(d.datacount_fg_color == 0);
11544         assert(d.datacount_bg_color == 0);
11545         assert(d.datacount_fg_bold == 0);
11546         assert(d.throughput_label_fg_color == 0);
11547         assert(d.throughput_label_bg_color == 0);
11548         assert(d.throughput_label_fg_bold == 0);
11549         assert(d.throughput_fg_color == 0);
11550         assert(d.throughput_bg_color == 0);
11551         assert(d.throughput_fg_bold == 0);
11552         assert(d.time_label_fg_color == 0);
11553         assert(d.time_label_bg_color == 0);
11554         assert(d.time_label_fg_bold == 0);
11555         assert(d.percent_fg_color == 0);
11556         assert(d.percent_bg_color == 0);
11557         assert(d.percent_fg_bold == 0);
11558         assert(d.barbrace_fg_color == 0);
11559         assert(d.barbrace_bg_color == 0);
11560         assert(d.barbrace_fg_bold == 0);
11561         assert(d.bar_fg_color == 0);
11562         assert(d.bar_bg_color == 0);
11563         assert(d.bar_fg_bold == 0);
11564         assert(io.in == 0);
11565         assert(io.out == 1);
11566         assert(io.in_ready == 0);
11567         assert(io.out_ready == 0);
11568         assert(io.eof_in == 0);
11569         assert(io.eof_out == 0);
11570         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11571         /* assert(io.cbuf == 0x0); */
11572         assert(io.last_read == 0);
11573         assert(io.last_write == 0);
11574         assert(io.total_read == 0);
11575         assert(io.total_write == 0);
11576         assert(io.total_size == 0);
11577         assert(io.total_size_known == 0);
11578         assert(io.timeout == 250000);
11579 }
11580 
11581 void test86(FILE* out)
11582 {
11583         int argc = 0;
11584         char *argv[256] = { 0 };
11585 
11586         argv[argc++] = "ProgramName";
11587         argv[argc++] = "--display-bar";
11588 
11589         displayInit();
11590         ioInit();
11591 
11592 #ifdef PRINT_DEBUG
11593         print();
11594 #endif
11595         assert(d.start_time == 0);
11596         assert(d.total_time == 0);
11597         assert(d.current_time == 0);
11598         assert(d.elapsed_time == 0);
11599         assert(d.percent_complete == 0);
11600         assert(d.display_interval == 1);
11601         assert(d.overtime_flag == 0);
11602         assert(d.k == 1024);
11603         assert(d.twiddle == '-');
11604         assert(d.manual_width == 0);
11605         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11606         assert(d.display_datacount == 1);
11607         assert(d.display_throughput == 1);
11608         assert(d.display_time == 1);
11609         assert(d.display_percent == 1);
11610         assert(d.display_bar == 1);
11611         assert(d.display_summary == 1);
11612         assert(d.display_ansi == 0);
11613         assert(d.twiddle_fg_color == 0);
11614         assert(d.twiddle_bg_color == 0);
11615         assert(d.twiddle_fg_bold == 0);
11616         assert(d.datacount_fg_color == 0);
11617         assert(d.datacount_bg_color == 0);
11618         assert(d.datacount_fg_bold == 0);
11619         assert(d.throughput_label_fg_color == 0);
11620         assert(d.throughput_label_bg_color == 0);
11621         assert(d.throughput_label_fg_bold == 0);
11622         assert(d.throughput_fg_color == 0);
11623         assert(d.throughput_bg_color == 0);
11624         assert(d.throughput_fg_bold == 0);
11625         assert(d.time_label_fg_color == 0);
11626         assert(d.time_label_bg_color == 0);
11627         assert(d.time_label_fg_bold == 0);
11628         assert(d.percent_fg_color == 0);
11629         assert(d.percent_bg_color == 0);
11630         assert(d.percent_fg_bold == 0);
11631         assert(d.barbrace_fg_color == 0);
11632         assert(d.barbrace_bg_color == 0);
11633         assert(d.barbrace_fg_bold == 0);
11634         assert(d.bar_fg_color == 0);
11635         assert(d.bar_bg_color == 0);
11636         assert(d.bar_fg_bold == 0);
11637         assert(io.in == 0);
11638         assert(io.out == 1);
11639         assert(io.in_ready == 0);
11640         assert(io.out_ready == 0);
11641         assert(io.eof_in == 0);
11642         assert(io.eof_out == 0);
11643         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11644         /* assert(io.cbuf == 0x0); */
11645         assert(io.last_read == 0);
11646         assert(io.last_write == 0);
11647         assert(io.total_read == 0);
11648         assert(io.total_write == 0);
11649         assert(io.total_size == 0);
11650         assert(io.total_size_known == 0);
11651         assert(io.timeout == 250000);
11652 
11653         d.display_bar = 0;
11654         assert(parse_args(out, argc, argv) == 0);
11655 
11656 #ifdef PRINT_DEBUG
11657         print();
11658 #endif
11659         assert(d.start_time == 0);
11660         assert(d.total_time == 0);
11661         assert(d.current_time == 0);
11662         assert(d.elapsed_time == 0);
11663         assert(d.percent_complete == 0);
11664         assert(d.display_interval == 1);
11665         assert(d.overtime_flag == 0);
11666         assert(d.k == 1024);
11667         assert(d.twiddle == '-');
11668         assert(d.manual_width == 0); 
11669         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11670         assert(d.display_datacount == 1);
11671         assert(d.display_throughput == 1);
11672         assert(d.display_time == 1);
11673         assert(d.display_percent == 1);
11674         assert(d.display_bar == 1);
11675         assert(d.display_summary == 1);
11676         assert(d.display_ansi == 0);
11677         assert(d.twiddle_fg_color == 0);
11678         assert(d.twiddle_bg_color == 0);
11679         assert(d.twiddle_fg_bold == 0);
11680         assert(d.datacount_fg_color == 0);
11681         assert(d.datacount_bg_color == 0);
11682         assert(d.datacount_fg_bold == 0);
11683         assert(d.throughput_label_fg_color == 0);
11684         assert(d.throughput_label_bg_color == 0);
11685         assert(d.throughput_label_fg_bold == 0);
11686         assert(d.throughput_fg_color == 0);
11687         assert(d.throughput_bg_color == 0);
11688         assert(d.throughput_fg_bold == 0);
11689         assert(d.time_label_fg_color == 0);
11690         assert(d.time_label_bg_color == 0);
11691         assert(d.time_label_fg_bold == 0);
11692         assert(d.percent_fg_color == 0);
11693         assert(d.percent_bg_color == 0);
11694         assert(d.percent_fg_bold == 0);
11695         assert(d.barbrace_fg_color == 0);
11696         assert(d.barbrace_bg_color == 0);
11697         assert(d.barbrace_fg_bold == 0);
11698         assert(d.bar_fg_color == 0);
11699         assert(d.bar_bg_color == 0);
11700         assert(d.bar_fg_bold == 0);
11701         assert(io.in == 0);
11702         assert(io.out == 1);
11703         assert(io.in_ready == 0);
11704         assert(io.out_ready == 0);
11705         assert(io.eof_in == 0);
11706         assert(io.eof_out == 0);
11707         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11708         /* assert(io.cbuf == 0x0); */
11709         assert(io.last_read == 0);
11710         assert(io.last_write == 0);
11711         assert(io.total_read == 0);
11712         assert(io.total_write == 0);
11713         assert(io.total_size == 0);
11714         assert(io.total_size_known == 0);
11715         assert(io.timeout == 250000);
11716 }
11717 
11718 void test87(FILE* out)
11719 {
11720         int argc = 0;
11721         char *argv[256] = { 0 };
11722 
11723         argv[argc++] = "ProgramName";
11724         argv[argc++] = "--no-bar";
11725 
11726         displayInit();
11727         ioInit();
11728 
11729 #ifdef PRINT_DEBUG
11730         print();
11731 #endif
11732         assert(d.start_time == 0);
11733         assert(d.total_time == 0);
11734         assert(d.current_time == 0);
11735         assert(d.elapsed_time == 0);
11736         assert(d.percent_complete == 0);
11737         assert(d.display_interval == 1);
11738         assert(d.overtime_flag == 0);
11739         assert(d.k == 1024);
11740         assert(d.twiddle == '-');
11741         assert(d.manual_width == 0);
11742         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11743         assert(d.display_datacount == 1);
11744         assert(d.display_throughput == 1);
11745         assert(d.display_time == 1);
11746         assert(d.display_percent == 1);
11747         assert(d.display_bar == 1);
11748         assert(d.display_summary == 1);
11749         assert(d.display_ansi == 0);
11750         assert(d.twiddle_fg_color == 0);
11751         assert(d.twiddle_bg_color == 0);
11752         assert(d.twiddle_fg_bold == 0);
11753         assert(d.datacount_fg_color == 0);
11754         assert(d.datacount_bg_color == 0);
11755         assert(d.datacount_fg_bold == 0);
11756         assert(d.throughput_label_fg_color == 0);
11757         assert(d.throughput_label_bg_color == 0);
11758         assert(d.throughput_label_fg_bold == 0);
11759         assert(d.throughput_fg_color == 0);
11760         assert(d.throughput_bg_color == 0);
11761         assert(d.throughput_fg_bold == 0);
11762         assert(d.time_label_fg_color == 0);
11763         assert(d.time_label_bg_color == 0);
11764         assert(d.time_label_fg_bold == 0);
11765         assert(d.percent_fg_color == 0);
11766         assert(d.percent_bg_color == 0);
11767         assert(d.percent_fg_bold == 0);
11768         assert(d.barbrace_fg_color == 0);
11769         assert(d.barbrace_bg_color == 0);
11770         assert(d.barbrace_fg_bold == 0);
11771         assert(d.bar_fg_color == 0);
11772         assert(d.bar_bg_color == 0);
11773         assert(d.bar_fg_bold == 0);
11774         assert(io.in == 0);
11775         assert(io.out == 1);
11776         assert(io.in_ready == 0);
11777         assert(io.out_ready == 0);
11778         assert(io.eof_in == 0);
11779         assert(io.eof_out == 0);
11780         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11781         /* assert(io.cbuf == 0x0); */
11782         assert(io.last_read == 0);
11783         assert(io.last_write == 0);
11784         assert(io.total_read == 0);
11785         assert(io.total_write == 0);
11786         assert(io.total_size == 0);
11787         assert(io.total_size_known == 0);
11788         assert(io.timeout == 250000);
11789 
11790         assert(parse_args(out, argc, argv) == 0);
11791 
11792 #ifdef PRINT_DEBUG
11793         print();
11794 #endif
11795         assert(d.start_time == 0);
11796         assert(d.total_time == 0);
11797         assert(d.current_time == 0);
11798         assert(d.elapsed_time == 0);
11799         assert(d.percent_complete == 0);
11800         assert(d.display_interval == 1);
11801         assert(d.overtime_flag == 0);
11802         assert(d.k == 1024);
11803         assert(d.twiddle == '-');
11804         assert(d.manual_width == 0); 
11805         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11806         assert(d.display_datacount == 1);
11807         assert(d.display_throughput == 1);
11808         assert(d.display_time == 1);
11809         assert(d.display_percent == 1);
11810         assert(d.display_bar == 0);
11811         assert(d.display_summary == 1);
11812         assert(d.display_ansi == 0);
11813         assert(d.twiddle_fg_color == 0);
11814         assert(d.twiddle_bg_color == 0);
11815         assert(d.twiddle_fg_bold == 0);
11816         assert(d.datacount_fg_color == 0);
11817         assert(d.datacount_bg_color == 0);
11818         assert(d.datacount_fg_bold == 0);
11819         assert(d.throughput_label_fg_color == 0);
11820         assert(d.throughput_label_bg_color == 0);
11821         assert(d.throughput_label_fg_bold == 0);
11822         assert(d.throughput_fg_color == 0);
11823         assert(d.throughput_bg_color == 0);
11824         assert(d.throughput_fg_bold == 0);
11825         assert(d.time_label_fg_color == 0);
11826         assert(d.time_label_bg_color == 0);
11827         assert(d.time_label_fg_bold == 0);
11828         assert(d.percent_fg_color == 0);
11829         assert(d.percent_bg_color == 0);
11830         assert(d.percent_fg_bold == 0);
11831         assert(d.barbrace_fg_color == 0);
11832         assert(d.barbrace_bg_color == 0);
11833         assert(d.barbrace_fg_bold == 0);
11834         assert(d.bar_fg_color == 0);
11835         assert(d.bar_bg_color == 0);
11836         assert(d.bar_fg_bold == 0);
11837         assert(io.in == 0);
11838         assert(io.out == 1);
11839         assert(io.in_ready == 0);
11840         assert(io.out_ready == 0);
11841         assert(io.eof_in == 0);
11842         assert(io.eof_out == 0);
11843         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11844         /* assert(io.cbuf == 0x0); */
11845         assert(io.last_read == 0);
11846         assert(io.last_write == 0);
11847         assert(io.total_read == 0);
11848         assert(io.total_write == 0);
11849         assert(io.total_size == 0);
11850         assert(io.total_size_known == 0);
11851         assert(io.timeout == 250000);
11852 }
11853 
11854 void test88(FILE* out)
11855 {
11856         int argc = 0;
11857         char *argv[256] = { 0 };
11858 
11859         argv[argc++] = "ProgramName";
11860         argv[argc++] = "--display-summary";
11861 
11862         displayInit();
11863         ioInit();
11864 
11865 #ifdef PRINT_DEBUG
11866         print();
11867 #endif
11868         assert(d.start_time == 0);
11869         assert(d.total_time == 0);
11870         assert(d.current_time == 0);
11871         assert(d.elapsed_time == 0);
11872         assert(d.percent_complete == 0);
11873         assert(d.display_interval == 1);
11874         assert(d.overtime_flag == 0);
11875         assert(d.k == 1024);
11876         assert(d.twiddle == '-');
11877         assert(d.manual_width == 0);
11878         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11879         assert(d.display_datacount == 1);
11880         assert(d.display_throughput == 1);
11881         assert(d.display_time == 1);
11882         assert(d.display_percent == 1);
11883         assert(d.display_bar == 1);
11884         assert(d.display_summary == 1);
11885         assert(d.display_ansi == 0);
11886         assert(d.twiddle_fg_color == 0);
11887         assert(d.twiddle_bg_color == 0);
11888         assert(d.twiddle_fg_bold == 0);
11889         assert(d.datacount_fg_color == 0);
11890         assert(d.datacount_bg_color == 0);
11891         assert(d.datacount_fg_bold == 0);
11892         assert(d.throughput_label_fg_color == 0);
11893         assert(d.throughput_label_bg_color == 0);
11894         assert(d.throughput_label_fg_bold == 0);
11895         assert(d.throughput_fg_color == 0);
11896         assert(d.throughput_bg_color == 0);
11897         assert(d.throughput_fg_bold == 0);
11898         assert(d.time_label_fg_color == 0);
11899         assert(d.time_label_bg_color == 0);
11900         assert(d.time_label_fg_bold == 0);
11901         assert(d.percent_fg_color == 0);
11902         assert(d.percent_bg_color == 0);
11903         assert(d.percent_fg_bold == 0);
11904         assert(d.barbrace_fg_color == 0);
11905         assert(d.barbrace_bg_color == 0);
11906         assert(d.barbrace_fg_bold == 0);
11907         assert(d.bar_fg_color == 0);
11908         assert(d.bar_bg_color == 0);
11909         assert(d.bar_fg_bold == 0);
11910         assert(io.in == 0);
11911         assert(io.out == 1);
11912         assert(io.in_ready == 0);
11913         assert(io.out_ready == 0);
11914         assert(io.eof_in == 0);
11915         assert(io.eof_out == 0);
11916         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11917         /* assert(io.cbuf == 0x0); */
11918         assert(io.last_read == 0);
11919         assert(io.last_write == 0);
11920         assert(io.total_read == 0);
11921         assert(io.total_write == 0);
11922         assert(io.total_size == 0);
11923         assert(io.total_size_known == 0);
11924         assert(io.timeout == 250000);
11925 
11926         d.display_summary = 0;
11927         assert(parse_args(out, argc, argv) == 0);
11928 
11929 #ifdef PRINT_DEBUG
11930         print();
11931 #endif
11932         assert(d.start_time == 0);
11933         assert(d.total_time == 0);
11934         assert(d.current_time == 0);
11935         assert(d.elapsed_time == 0);
11936         assert(d.percent_complete == 0);
11937         assert(d.display_interval == 1);
11938         assert(d.overtime_flag == 0);
11939         assert(d.k == 1024);
11940         assert(d.twiddle == '-');
11941         assert(d.manual_width == 0); 
11942         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
11943         assert(d.display_datacount == 1);
11944         assert(d.display_throughput == 1);
11945         assert(d.display_time == 1);
11946         assert(d.display_percent == 1);
11947         assert(d.display_bar == 1);
11948         assert(d.display_summary == 1);
11949         assert(d.display_ansi == 0);
11950         assert(d.twiddle_fg_color == 0);
11951         assert(d.twiddle_bg_color == 0);
11952         assert(d.twiddle_fg_bold == 0);
11953         assert(d.datacount_fg_color == 0);
11954         assert(d.datacount_bg_color == 0);
11955         assert(d.datacount_fg_bold == 0);
11956         assert(d.throughput_label_fg_color == 0);
11957         assert(d.throughput_label_bg_color == 0);
11958         assert(d.throughput_label_fg_bold == 0);
11959         assert(d.throughput_fg_color == 0);
11960         assert(d.throughput_bg_color == 0);
11961         assert(d.throughput_fg_bold == 0);
11962         assert(d.time_label_fg_color == 0);
11963         assert(d.time_label_bg_color == 0);
11964         assert(d.time_label_fg_bold == 0);
11965         assert(d.percent_fg_color == 0);
11966         assert(d.percent_bg_color == 0);
11967         assert(d.percent_fg_bold == 0);
11968         assert(d.barbrace_fg_color == 0);
11969         assert(d.barbrace_bg_color == 0);
11970         assert(d.barbrace_fg_bold == 0);
11971         assert(d.bar_fg_color == 0);
11972         assert(d.bar_bg_color == 0);
11973         assert(d.bar_fg_bold == 0);
11974         assert(io.in == 0);
11975         assert(io.out == 1);
11976         assert(io.in_ready == 0);
11977         assert(io.out_ready == 0);
11978         assert(io.eof_in == 0);
11979         assert(io.eof_out == 0);
11980         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
11981         /* assert(io.cbuf == 0x0); */
11982         assert(io.last_read == 0);
11983         assert(io.last_write == 0);
11984         assert(io.total_read == 0);
11985         assert(io.total_write == 0);
11986         assert(io.total_size == 0);
11987         assert(io.total_size_known == 0);
11988         assert(io.timeout == 250000);
11989 }
11990 
11991 void test89(FILE* out)
11992 {
11993         int argc = 0;
11994         char *argv[256] = { 0 };
11995 
11996         argv[argc++] = "ProgramName";
11997         argv[argc++] = "--no-summary";
11998 
11999         displayInit();
12000         ioInit();
12001 
12002 #ifdef PRINT_DEBUG
12003         print();
12004 #endif
12005         assert(d.start_time == 0);
12006         assert(d.total_time == 0);
12007         assert(d.current_time == 0);
12008         assert(d.elapsed_time == 0);
12009         assert(d.percent_complete == 0);
12010         assert(d.display_interval == 1);
12011         assert(d.overtime_flag == 0);
12012         assert(d.k == 1024);
12013         assert(d.twiddle == '-');
12014         assert(d.manual_width == 0);
12015         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12016         assert(d.display_datacount == 1);
12017         assert(d.display_throughput == 1);
12018         assert(d.display_time == 1);
12019         assert(d.display_percent == 1);
12020         assert(d.display_bar == 1);
12021         assert(d.display_summary == 1);
12022         assert(d.display_ansi == 0);
12023         assert(d.twiddle_fg_color == 0);
12024         assert(d.twiddle_bg_color == 0);
12025         assert(d.twiddle_fg_bold == 0);
12026         assert(d.datacount_fg_color == 0);
12027         assert(d.datacount_bg_color == 0);
12028         assert(d.datacount_fg_bold == 0);
12029         assert(d.throughput_label_fg_color == 0);
12030         assert(d.throughput_label_bg_color == 0);
12031         assert(d.throughput_label_fg_bold == 0);
12032         assert(d.throughput_fg_color == 0);
12033         assert(d.throughput_bg_color == 0);
12034         assert(d.throughput_fg_bold == 0);
12035         assert(d.time_label_fg_color == 0);
12036         assert(d.time_label_bg_color == 0);
12037         assert(d.time_label_fg_bold == 0);
12038         assert(d.percent_fg_color == 0);
12039         assert(d.percent_bg_color == 0);
12040         assert(d.percent_fg_bold == 0);
12041         assert(d.barbrace_fg_color == 0);
12042         assert(d.barbrace_bg_color == 0);
12043         assert(d.barbrace_fg_bold == 0);
12044         assert(d.bar_fg_color == 0);
12045         assert(d.bar_bg_color == 0);
12046         assert(d.bar_fg_bold == 0);
12047         assert(io.in == 0);
12048         assert(io.out == 1);
12049         assert(io.in_ready == 0);
12050         assert(io.out_ready == 0);
12051         assert(io.eof_in == 0);
12052         assert(io.eof_out == 0);
12053         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12054         /* assert(io.cbuf == 0x0); */
12055         assert(io.last_read == 0);
12056         assert(io.last_write == 0);
12057         assert(io.total_read == 0);
12058         assert(io.total_write == 0);
12059         assert(io.total_size == 0);
12060         assert(io.total_size_known == 0);
12061         assert(io.timeout == 250000);
12062 
12063         assert(parse_args(out, argc, argv) == 0);
12064 
12065 #ifdef PRINT_DEBUG
12066         print();
12067 #endif
12068         assert(d.start_time == 0);
12069         assert(d.total_time == 0);
12070         assert(d.current_time == 0);
12071         assert(d.elapsed_time == 0);
12072         assert(d.percent_complete == 0);
12073         assert(d.display_interval == 1);
12074         assert(d.overtime_flag == 0);
12075         assert(d.k == 1024);
12076         assert(d.twiddle == '-');
12077         assert(d.manual_width == 0); 
12078         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12079         assert(d.display_datacount == 1);
12080         assert(d.display_throughput == 1);
12081         assert(d.display_time == 1);
12082         assert(d.display_percent == 1);
12083         assert(d.display_bar == 1);
12084         assert(d.display_summary == 0);
12085         assert(d.display_ansi == 0);
12086         assert(d.twiddle_fg_color == 0);
12087         assert(d.twiddle_bg_color == 0);
12088         assert(d.twiddle_fg_bold == 0);
12089         assert(d.datacount_fg_color == 0);
12090         assert(d.datacount_bg_color == 0);
12091         assert(d.datacount_fg_bold == 0);
12092         assert(d.throughput_label_fg_color == 0);
12093         assert(d.throughput_label_bg_color == 0);
12094         assert(d.throughput_label_fg_bold == 0);
12095         assert(d.throughput_fg_color == 0);
12096         assert(d.throughput_bg_color == 0);
12097         assert(d.throughput_fg_bold == 0);
12098         assert(d.time_label_fg_color == 0);
12099         assert(d.time_label_bg_color == 0);
12100         assert(d.time_label_fg_bold == 0);
12101         assert(d.percent_fg_color == 0);
12102         assert(d.percent_bg_color == 0);
12103         assert(d.percent_fg_bold == 0);
12104         assert(d.barbrace_fg_color == 0);
12105         assert(d.barbrace_bg_color == 0);
12106         assert(d.barbrace_fg_bold == 0);
12107         assert(d.bar_fg_color == 0);
12108         assert(d.bar_bg_color == 0);
12109         assert(d.bar_fg_bold == 0);
12110         assert(io.in == 0);
12111         assert(io.out == 1);
12112         assert(io.in_ready == 0);
12113         assert(io.out_ready == 0);
12114         assert(io.eof_in == 0);
12115         assert(io.eof_out == 0);
12116         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12117         /* assert(io.cbuf == 0x0); */
12118         assert(io.last_read == 0);
12119         assert(io.last_write == 0);
12120         assert(io.total_read == 0);
12121         assert(io.total_write == 0);
12122         assert(io.total_size == 0);
12123         assert(io.total_size_known == 0);
12124         assert(io.timeout == 250000);
12125 }
12126 
12127 void test90(FILE* out)
12128 {
12129         int argc = 0;
12130         char *argv[256] = { 0 };
12131 
12132         argv[argc++] = "ProgramName";
12133         argv[argc++] = "--display-all";
12134 
12135         displayInit();
12136         ioInit();
12137 
12138 #ifdef PRINT_DEBUG
12139         print();
12140 #endif
12141         assert(d.start_time == 0);
12142         assert(d.total_time == 0);
12143         assert(d.current_time == 0);
12144         assert(d.elapsed_time == 0);
12145         assert(d.percent_complete == 0);
12146         assert(d.display_interval == 1);
12147         assert(d.overtime_flag == 0);
12148         assert(d.k == 1024);
12149         assert(d.twiddle == '-');
12150         assert(d.manual_width == 0);
12151         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12152         assert(d.display_datacount == 1);
12153         assert(d.display_throughput == 1);
12154         assert(d.display_time == 1);
12155         assert(d.display_percent == 1);
12156         assert(d.display_bar == 1);
12157         assert(d.display_summary == 1);
12158         assert(d.display_ansi == 0);
12159         assert(d.twiddle_fg_color == 0);
12160         assert(d.twiddle_bg_color == 0);
12161         assert(d.twiddle_fg_bold == 0);
12162         assert(d.datacount_fg_color == 0);
12163         assert(d.datacount_bg_color == 0);
12164         assert(d.datacount_fg_bold == 0);
12165         assert(d.throughput_label_fg_color == 0);
12166         assert(d.throughput_label_bg_color == 0);
12167         assert(d.throughput_label_fg_bold == 0);
12168         assert(d.throughput_fg_color == 0);
12169         assert(d.throughput_bg_color == 0);
12170         assert(d.throughput_fg_bold == 0);
12171         assert(d.time_label_fg_color == 0);
12172         assert(d.time_label_bg_color == 0);
12173         assert(d.time_label_fg_bold == 0);
12174         assert(d.percent_fg_color == 0);
12175         assert(d.percent_bg_color == 0);
12176         assert(d.percent_fg_bold == 0);
12177         assert(d.barbrace_fg_color == 0);
12178         assert(d.barbrace_bg_color == 0);
12179         assert(d.barbrace_fg_bold == 0);
12180         assert(d.bar_fg_color == 0);
12181         assert(d.bar_bg_color == 0);
12182         assert(d.bar_fg_bold == 0);
12183         assert(io.in == 0);
12184         assert(io.out == 1);
12185         assert(io.in_ready == 0);
12186         assert(io.out_ready == 0);
12187         assert(io.eof_in == 0);
12188         assert(io.eof_out == 0);
12189         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12190         /* assert(io.cbuf == 0x0); */
12191         assert(io.last_read == 0);
12192         assert(io.last_write == 0);
12193         assert(io.total_read == 0);
12194         assert(io.total_write == 0);
12195         assert(io.total_size == 0);
12196         assert(io.total_size_known == 0);
12197         assert(io.timeout == 250000);
12198 
12199         d.display_twiddle = 0;
12200         d.display_datacount = 0;
12201         d.display_throughput = 0;
12202         d.display_time = 0;
12203         d.display_percent = 0;
12204         d.display_bar = 0;
12205         d.display_summary = 0;
12206         assert(parse_args(out, argc, argv) == 0);
12207 
12208 #ifdef PRINT_DEBUG
12209         print();
12210 #endif
12211         assert(d.start_time == 0);
12212         assert(d.total_time == 0);
12213         assert(d.current_time == 0);
12214         assert(d.elapsed_time == 0);
12215         assert(d.percent_complete == 0);
12216         assert(d.display_interval == 1);
12217         assert(d.overtime_flag == 0);
12218         assert(d.k == 1024);
12219         assert(d.twiddle == '-');
12220         assert(d.manual_width == 0); 
12221         assert(d.display_twiddle == 1);
12222         assert(d.display_datacount == 1);
12223         assert(d.display_throughput == 1);
12224         assert(d.display_time == 1);
12225         assert(d.display_percent == 1);
12226         assert(d.display_bar == 1);
12227         assert(d.display_summary == 1);
12228         assert(d.display_ansi == 0);
12229         assert(d.twiddle_fg_color == 0);
12230         assert(d.twiddle_bg_color == 0);
12231         assert(d.twiddle_fg_bold == 0);
12232         assert(d.datacount_fg_color == 0);
12233         assert(d.datacount_bg_color == 0);
12234         assert(d.datacount_fg_bold == 0);
12235         assert(d.throughput_label_fg_color == 0);
12236         assert(d.throughput_label_bg_color == 0);
12237         assert(d.throughput_label_fg_bold == 0);
12238         assert(d.throughput_fg_color == 0);
12239         assert(d.throughput_bg_color == 0);
12240         assert(d.throughput_fg_bold == 0);
12241         assert(d.time_label_fg_color == 0);
12242         assert(d.time_label_bg_color == 0);
12243         assert(d.time_label_fg_bold == 0);
12244         assert(d.percent_fg_color == 0);
12245         assert(d.percent_bg_color == 0);
12246         assert(d.percent_fg_bold == 0);
12247         assert(d.barbrace_fg_color == 0);
12248         assert(d.barbrace_bg_color == 0);
12249         assert(d.barbrace_fg_bold == 0);
12250         assert(d.bar_fg_color == 0);
12251         assert(d.bar_bg_color == 0);
12252         assert(d.bar_fg_bold == 0);
12253         assert(io.in == 0);
12254         assert(io.out == 1);
12255         assert(io.in_ready == 0);
12256         assert(io.out_ready == 0);
12257         assert(io.eof_in == 0);
12258         assert(io.eof_out == 0);
12259         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12260         /* assert(io.cbuf == 0x0); */
12261         assert(io.last_read == 0);
12262         assert(io.last_write == 0);
12263         assert(io.total_read == 0);
12264         assert(io.total_write == 0);
12265         assert(io.total_size == 0);
12266         assert(io.total_size_known == 0);
12267         assert(io.timeout == 250000);
12268 }
12269 
12270 void test91(FILE* out)
12271 {
12272         int argc = 0;
12273         char *argv[256] = { 0 };
12274 
12275         argv[argc++] = "ProgramName";
12276         argv[argc++] = "--display-none";
12277 
12278         displayInit();
12279         ioInit();
12280 
12281 #ifdef PRINT_DEBUG
12282         print();
12283 #endif
12284         assert(d.start_time == 0);
12285         assert(d.total_time == 0);
12286         assert(d.current_time == 0);
12287         assert(d.elapsed_time == 0);
12288         assert(d.percent_complete == 0);
12289         assert(d.display_interval == 1);
12290         assert(d.overtime_flag == 0);
12291         assert(d.k == 1024);
12292         assert(d.twiddle == '-');
12293         assert(d.manual_width == 0);
12294         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12295         assert(d.display_datacount == 1);
12296         assert(d.display_throughput == 1);
12297         assert(d.display_time == 1);
12298         assert(d.display_percent == 1);
12299         assert(d.display_bar == 1);
12300         assert(d.display_summary == 1);
12301         assert(d.display_ansi == 0);
12302         assert(d.twiddle_fg_color == 0);
12303         assert(d.twiddle_bg_color == 0);
12304         assert(d.twiddle_fg_bold == 0);
12305         assert(d.datacount_fg_color == 0);
12306         assert(d.datacount_bg_color == 0);
12307         assert(d.datacount_fg_bold == 0);
12308         assert(d.throughput_label_fg_color == 0);
12309         assert(d.throughput_label_bg_color == 0);
12310         assert(d.throughput_label_fg_bold == 0);
12311         assert(d.throughput_fg_color == 0);
12312         assert(d.throughput_bg_color == 0);
12313         assert(d.throughput_fg_bold == 0);
12314         assert(d.time_label_fg_color == 0);
12315         assert(d.time_label_bg_color == 0);
12316         assert(d.time_label_fg_bold == 0);
12317         assert(d.percent_fg_color == 0);
12318         assert(d.percent_bg_color == 0);
12319         assert(d.percent_fg_bold == 0);
12320         assert(d.barbrace_fg_color == 0);
12321         assert(d.barbrace_bg_color == 0);
12322         assert(d.barbrace_fg_bold == 0);
12323         assert(d.bar_fg_color == 0);
12324         assert(d.bar_bg_color == 0);
12325         assert(d.bar_fg_bold == 0);
12326         assert(io.in == 0);
12327         assert(io.out == 1);
12328         assert(io.in_ready == 0);
12329         assert(io.out_ready == 0);
12330         assert(io.eof_in == 0);
12331         assert(io.eof_out == 0);
12332         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12333         /* assert(io.cbuf == 0x0); */
12334         assert(io.last_read == 0);
12335         assert(io.last_write == 0);
12336         assert(io.total_read == 0);
12337         assert(io.total_write == 0);
12338         assert(io.total_size == 0);
12339         assert(io.total_size_known == 0);
12340         assert(io.timeout == 250000);
12341 
12342         assert(parse_args(out, argc, argv) == 0);
12343 
12344 #ifdef PRINT_DEBUG
12345         print();
12346 #endif
12347         assert(d.start_time == 0);
12348         assert(d.total_time == 0);
12349         assert(d.current_time == 0);
12350         assert(d.elapsed_time == 0);
12351         assert(d.percent_complete == 0);
12352         assert(d.display_interval == 1);
12353         assert(d.overtime_flag == 0);
12354         assert(d.k == 1024);
12355         assert(d.twiddle == '-');
12356         assert(d.manual_width == 0); 
12357         assert(d.display_twiddle == 0);
12358         assert(d.display_datacount == 0);
12359         assert(d.display_throughput == 0);
12360         assert(d.display_time == 0);
12361         assert(d.display_percent == 0);
12362         assert(d.display_bar == 0);
12363         assert(d.display_summary == 0);
12364         assert(d.display_ansi == 0);
12365         assert(d.twiddle_fg_color == 0);
12366         assert(d.twiddle_bg_color == 0);
12367         assert(d.twiddle_fg_bold == 0);
12368         assert(d.datacount_fg_color == 0);
12369         assert(d.datacount_bg_color == 0);
12370         assert(d.datacount_fg_bold == 0);
12371         assert(d.throughput_label_fg_color == 0);
12372         assert(d.throughput_label_bg_color == 0);
12373         assert(d.throughput_label_fg_bold == 0);
12374         assert(d.throughput_fg_color == 0);
12375         assert(d.throughput_bg_color == 0);
12376         assert(d.throughput_fg_bold == 0);
12377         assert(d.time_label_fg_color == 0);
12378         assert(d.time_label_bg_color == 0);
12379         assert(d.time_label_fg_bold == 0);
12380         assert(d.percent_fg_color == 0);
12381         assert(d.percent_bg_color == 0);
12382         assert(d.percent_fg_bold == 0);
12383         assert(d.barbrace_fg_color == 0);
12384         assert(d.barbrace_bg_color == 0);
12385         assert(d.barbrace_fg_bold == 0);
12386         assert(d.bar_fg_color == 0);
12387         assert(d.bar_bg_color == 0);
12388         assert(d.bar_fg_bold == 0);
12389         assert(io.in == 0);
12390         assert(io.out == 1);
12391         assert(io.in_ready == 0);
12392         assert(io.out_ready == 0);
12393         assert(io.eof_in == 0);
12394         assert(io.eof_out == 0);
12395         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12396         /* assert(io.cbuf == 0x0); */
12397         assert(io.last_read == 0);
12398         assert(io.last_write == 0);
12399         assert(io.total_read == 0);
12400         assert(io.total_write == 0);
12401         assert(io.total_size == 0);
12402         assert(io.total_size_known == 0);
12403         assert(io.timeout == 250000);
12404 }
12405 
12406 void test92(FILE* out)
12407 {
12408         int argc = 0;
12409         char *argv[256] = { 0 };
12410 
12411         argv[argc++] = "ProgramName";
12412         argv[argc++] = "-sw-1";
12413 
12414         displayInit();
12415         ioInit();
12416 
12417 #ifdef PRINT_DEBUG
12418         print();
12419 #endif
12420         assert(d.start_time == 0);
12421         assert(d.total_time == 0);
12422         assert(d.current_time == 0);
12423         assert(d.elapsed_time == 0);
12424         assert(d.percent_complete == 0);
12425         assert(d.display_interval == 1);
12426         assert(d.overtime_flag == 0);
12427         assert(d.k == 1024);
12428         assert(d.twiddle == '-');
12429         assert(d.manual_width == 0);
12430         assert(d.screen_width_minus_one == 0);
12431         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12432         assert(d.display_datacount == 1);
12433         assert(d.display_throughput == 1);
12434         assert(d.display_time == 1);
12435         assert(d.display_percent == 1);
12436         assert(d.display_bar == 1);
12437         assert(d.display_summary == 1);
12438         assert(d.display_ansi == 0);
12439         assert(d.twiddle_fg_color == 0);
12440         assert(d.twiddle_bg_color == 0);
12441         assert(d.twiddle_fg_bold == 0);
12442         assert(d.datacount_fg_color == 0);
12443         assert(d.datacount_bg_color == 0);
12444         assert(d.datacount_fg_bold == 0);
12445         assert(d.throughput_label_fg_color == 0);
12446         assert(d.throughput_label_bg_color == 0);
12447         assert(d.throughput_label_fg_bold == 0);
12448         assert(d.throughput_fg_color == 0);
12449         assert(d.throughput_bg_color == 0);
12450         assert(d.throughput_fg_bold == 0);
12451         assert(d.time_label_fg_color == 0);
12452         assert(d.time_label_bg_color == 0);
12453         assert(d.time_label_fg_bold == 0);
12454         assert(d.percent_fg_color == 0);
12455         assert(d.percent_bg_color == 0);
12456         assert(d.percent_fg_bold == 0);
12457         assert(d.barbrace_fg_color == 0);
12458         assert(d.barbrace_bg_color == 0);
12459         assert(d.barbrace_fg_bold == 0);
12460         assert(d.bar_fg_color == 0);
12461         assert(d.bar_bg_color == 0);
12462         assert(d.bar_fg_bold == 0);
12463         assert(io.in == 0);
12464         assert(io.out == 1);
12465         assert(io.in_ready == 0);
12466         assert(io.out_ready == 0);
12467         assert(io.eof_in == 0);
12468         assert(io.eof_out == 0);
12469         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12470         /* assert(io.cbuf == 0x0); */
12471         assert(io.last_read == 0);
12472         assert(io.last_write == 0);
12473         assert(io.total_read == 0);
12474         assert(io.total_write == 0);
12475         assert(io.total_size == 0);
12476         assert(io.total_size_known == 0);
12477         assert(io.timeout == 250000);
12478 
12479         assert(parse_args(out, argc, argv) == 0);
12480 
12481 #ifdef PRINT_DEBUG
12482         print();
12483 #endif
12484         assert(d.start_time == 0);
12485         assert(d.total_time == 0);
12486         assert(d.current_time == 0);
12487         assert(d.elapsed_time == 0);
12488         assert(d.percent_complete == 0);
12489         assert(d.display_interval == 1);
12490         assert(d.overtime_flag == 0);
12491         assert(d.k == 1024);
12492         assert(d.twiddle == '-');
12493         assert(d.manual_width == 0); 
12494         assert(d.screen_width_minus_one == 1);
12495         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12496         assert(d.display_datacount == 1);
12497         assert(d.display_throughput == 1);
12498         assert(d.display_time == 1);
12499         assert(d.display_percent == 1);
12500         assert(d.display_bar == 1);
12501         assert(d.display_summary == 1);
12502         assert(d.display_ansi == 0);
12503         assert(d.twiddle_fg_color == 0);
12504         assert(d.twiddle_bg_color == 0);
12505         assert(d.twiddle_fg_bold == 0);
12506         assert(d.datacount_fg_color == 0);
12507         assert(d.datacount_bg_color == 0);
12508         assert(d.datacount_fg_bold == 0);
12509         assert(d.throughput_label_fg_color == 0);
12510         assert(d.throughput_label_bg_color == 0);
12511         assert(d.throughput_label_fg_bold == 0);
12512         assert(d.throughput_fg_color == 0);
12513         assert(d.throughput_bg_color == 0);
12514         assert(d.throughput_fg_bold == 0);
12515         assert(d.time_label_fg_color == 0);
12516         assert(d.time_label_bg_color == 0);
12517         assert(d.time_label_fg_bold == 0);
12518         assert(d.percent_fg_color == 0);
12519         assert(d.percent_bg_color == 0);
12520         assert(d.percent_fg_bold == 0);
12521         assert(d.barbrace_fg_color == 0);
12522         assert(d.barbrace_bg_color == 0);
12523         assert(d.barbrace_fg_bold == 0);
12524         assert(d.bar_fg_color == 0);
12525         assert(d.bar_bg_color == 0);
12526         assert(d.bar_fg_bold == 0);
12527         assert(io.in == 0);
12528         assert(io.out == 1);
12529         assert(io.in_ready == 0);
12530         assert(io.out_ready == 0);
12531         assert(io.eof_in == 0);
12532         assert(io.eof_out == 0);
12533         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12534         /* assert(io.cbuf == 0x0); */
12535         assert(io.last_read == 0);
12536         assert(io.last_write == 0);
12537         assert(io.total_read == 0);
12538         assert(io.total_write == 0);
12539         assert(io.total_size == 0);
12540         assert(io.total_size_known == 0);
12541         assert(io.timeout == 250000);
12542 }
12543 
12544 void test93(FILE* out)
12545 {
12546         int argc = 0;
12547         char *argv[256] = { 0 };
12548 
12549         argv[argc++] = "ProgramName";
12550         argv[argc++] = "--screen-width-minus-one";
12551 
12552         displayInit();
12553         ioInit();
12554 
12555 #ifdef PRINT_DEBUG
12556         print();
12557 #endif
12558         assert(d.start_time == 0);
12559         assert(d.total_time == 0);
12560         assert(d.current_time == 0);
12561         assert(d.elapsed_time == 0);
12562         assert(d.percent_complete == 0);
12563         assert(d.display_interval == 1);
12564         assert(d.overtime_flag == 0);
12565         assert(d.k == 1024);
12566         assert(d.twiddle == '-');
12567         assert(d.manual_width == 0);
12568         assert(d.screen_width_minus_one == 0);
12569         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12570         assert(d.display_datacount == 1);
12571         assert(d.display_throughput == 1);
12572         assert(d.display_time == 1);
12573         assert(d.display_percent == 1);
12574         assert(d.display_bar == 1);
12575         assert(d.display_summary == 1);
12576         assert(d.display_ansi == 0);
12577         assert(d.twiddle_fg_color == 0);
12578         assert(d.twiddle_bg_color == 0);
12579         assert(d.twiddle_fg_bold == 0);
12580         assert(d.datacount_fg_color == 0);
12581         assert(d.datacount_bg_color == 0);
12582         assert(d.datacount_fg_bold == 0);
12583         assert(d.throughput_label_fg_color == 0);
12584         assert(d.throughput_label_bg_color == 0);
12585         assert(d.throughput_label_fg_bold == 0);
12586         assert(d.throughput_fg_color == 0);
12587         assert(d.throughput_bg_color == 0);
12588         assert(d.throughput_fg_bold == 0);
12589         assert(d.time_label_fg_color == 0);
12590         assert(d.time_label_bg_color == 0);
12591         assert(d.time_label_fg_bold == 0);
12592         assert(d.percent_fg_color == 0);
12593         assert(d.percent_bg_color == 0);
12594         assert(d.percent_fg_bold == 0);
12595         assert(d.barbrace_fg_color == 0);
12596         assert(d.barbrace_bg_color == 0);
12597         assert(d.barbrace_fg_bold == 0);
12598         assert(d.bar_fg_color == 0);
12599         assert(d.bar_bg_color == 0);
12600         assert(d.bar_fg_bold == 0);
12601         assert(io.in == 0);
12602         assert(io.out == 1);
12603         assert(io.in_ready == 0);
12604         assert(io.out_ready == 0);
12605         assert(io.eof_in == 0);
12606         assert(io.eof_out == 0);
12607         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12608         /* assert(io.cbuf == 0x0); */
12609         assert(io.last_read == 0);
12610         assert(io.last_write == 0);
12611         assert(io.total_read == 0);
12612         assert(io.total_write == 0);
12613         assert(io.total_size == 0);
12614         assert(io.total_size_known == 0);
12615         assert(io.timeout == 250000);
12616 
12617         assert(parse_args(out, argc, argv) == 0);
12618 
12619 #ifdef PRINT_DEBUG
12620         print();
12621 #endif
12622         assert(d.start_time == 0);
12623         assert(d.total_time == 0);
12624         assert(d.current_time == 0);
12625         assert(d.elapsed_time == 0);
12626         assert(d.percent_complete == 0);
12627         assert(d.display_interval == 1);
12628         assert(d.overtime_flag == 0);
12629         assert(d.k == 1024);
12630         assert(d.twiddle == '-');
12631         assert(d.manual_width == 0); 
12632         assert(d.screen_width_minus_one == 1);
12633         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12634         assert(d.display_datacount == 1);
12635         assert(d.display_throughput == 1);
12636         assert(d.display_time == 1);
12637         assert(d.display_percent == 1);
12638         assert(d.display_bar == 1);
12639         assert(d.display_summary == 1);
12640         assert(d.display_ansi == 0);
12641         assert(d.twiddle_fg_color == 0);
12642         assert(d.twiddle_bg_color == 0);
12643         assert(d.twiddle_fg_bold == 0);
12644         assert(d.datacount_fg_color == 0);
12645         assert(d.datacount_bg_color == 0);
12646         assert(d.datacount_fg_bold == 0);
12647         assert(d.throughput_label_fg_color == 0);
12648         assert(d.throughput_label_bg_color == 0);
12649         assert(d.throughput_label_fg_bold == 0);
12650         assert(d.throughput_fg_color == 0);
12651         assert(d.throughput_bg_color == 0);
12652         assert(d.throughput_fg_bold == 0);
12653         assert(d.time_label_fg_color == 0);
12654         assert(d.time_label_bg_color == 0);
12655         assert(d.time_label_fg_bold == 0);
12656         assert(d.percent_fg_color == 0);
12657         assert(d.percent_bg_color == 0);
12658         assert(d.percent_fg_bold == 0);
12659         assert(d.barbrace_fg_color == 0);
12660         assert(d.barbrace_bg_color == 0);
12661         assert(d.barbrace_fg_bold == 0);
12662         assert(d.bar_fg_color == 0);
12663         assert(d.bar_bg_color == 0);
12664         assert(d.bar_fg_bold == 0);
12665         assert(io.in == 0);
12666         assert(io.out == 1);
12667         assert(io.in_ready == 0);
12668         assert(io.out_ready == 0);
12669         assert(io.eof_in == 0);
12670         assert(io.eof_out == 0);
12671         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12672         /* assert(io.cbuf == 0x0); */
12673         assert(io.last_read == 0);
12674         assert(io.last_write == 0);
12675         assert(io.total_read == 0);
12676         assert(io.total_write == 0);
12677         assert(io.total_size == 0);
12678         assert(io.total_size_known == 0);
12679         assert(io.timeout == 250000);
12680 }
12681 
12682 void test94(FILE *out)
12683 {
12684         unlink("./test-rcfile.txt");
12685 
12686         clear_errno();
12687         ioInit();
12688         displayInit();
12689 
12690 #ifdef PRINT_DEBUG
12691         print();
12692 #endif
12693         assert(d.start_time == 0);
12694         assert(d.total_time == 0);
12695         assert(d.current_time == 0);
12696         assert(d.elapsed_time == 0);
12697         assert(d.percent_complete == 0);
12698         assert(d.display_interval == 1);
12699         assert(d.overtime_flag == 0);
12700         assert(d.k == 1024);
12701         assert(d.twiddle == '-');
12702         assert(d.manual_width == 0);
12703         assert(d.screen_width_minus_one == 0);
12704         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12705         assert(d.display_datacount == 1);
12706         assert(d.display_throughput == 1);
12707         assert(d.display_time == 1);
12708         assert(d.display_percent == 1);
12709         assert(d.display_bar == 1);
12710         assert(d.display_summary == 1);
12711         assert(d.display_ansi == 0);
12712         assert(d.twiddle_fg_color == 0);
12713         assert(d.twiddle_bg_color == 0);
12714         assert(d.twiddle_fg_bold == 0);
12715         assert(d.datacount_fg_color == 0);
12716         assert(d.datacount_bg_color == 0);
12717         assert(d.datacount_fg_bold == 0);
12718         assert(d.throughput_label_fg_color == 0);
12719         assert(d.throughput_label_bg_color == 0);
12720         assert(d.throughput_label_fg_bold == 0);
12721         assert(d.throughput_fg_color == 0);
12722         assert(d.throughput_bg_color == 0);
12723         assert(d.throughput_fg_bold == 0);
12724         assert(d.time_label_fg_color == 0);
12725         assert(d.time_label_bg_color == 0);
12726         assert(d.time_label_fg_bold == 0);
12727         assert(d.percent_fg_color == 0);
12728         assert(d.percent_bg_color == 0);
12729         assert(d.percent_fg_bold == 0);
12730         assert(d.barbrace_fg_color == 0);
12731         assert(d.barbrace_bg_color == 0);
12732         assert(d.barbrace_fg_bold == 0);
12733         assert(d.bar_fg_color == 0);
12734         assert(d.bar_bg_color == 0);
12735         assert(d.bar_fg_bold == 0);
12736         assert(io.in == 0);
12737         assert(io.out == 1);
12738         assert(io.in_ready == 0);
12739         assert(io.out_ready == 0);
12740         assert(io.eof_in == 0);
12741         assert(io.eof_out == 0);
12742         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12743         /* assert(io.cbuf == 0x0); */
12744         assert(io.last_read == 0);
12745         assert(io.last_write == 0);
12746         assert(io.total_read == 0);
12747         assert(io.total_write == 0);
12748         assert(io.total_size == 0);
12749         assert(io.total_size_known == 0);
12750         assert(io.timeout == 250000);
12751 
12752         assert(test_parse_rc(out,0));
12753 
12754 #ifdef PRINT_DEBUG
12755         print();
12756 #endif
12757         assert(d.start_time == 0);
12758         assert(d.total_time == 0);
12759         assert(d.current_time == 0);
12760         assert(d.elapsed_time == 0);
12761         assert(d.percent_complete == 0);
12762         assert(d.display_interval == 1);
12763         assert(d.overtime_flag == 0);
12764         assert(d.k == 1024);
12765         assert(d.twiddle == '-');
12766         assert(d.manual_width == 0);
12767         assert(d.screen_width_minus_one == 0);
12768         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12769         assert(d.display_datacount == 1);
12770         assert(d.display_throughput == 1);
12771         assert(d.display_time == 1);
12772         assert(d.display_percent == 1);
12773         assert(d.display_bar == 1);
12774         assert(d.display_summary == 1);
12775         assert(d.display_ansi == 0);
12776         assert(d.twiddle_fg_color == 0);
12777         assert(d.twiddle_bg_color == 0);
12778         assert(d.twiddle_fg_bold == 0);
12779         assert(d.datacount_fg_color == 0);
12780         assert(d.datacount_bg_color == 0);
12781         assert(d.datacount_fg_bold == 0);
12782         assert(d.throughput_label_fg_color == 0);
12783         assert(d.throughput_label_bg_color == 0);
12784         assert(d.throughput_label_fg_bold == 0);
12785         assert(d.throughput_fg_color == 0);
12786         assert(d.throughput_bg_color == 0);
12787         assert(d.throughput_fg_bold == 0);
12788         assert(d.time_label_fg_color == 0);
12789         assert(d.time_label_bg_color == 0);
12790         assert(d.time_label_fg_bold == 0);
12791         assert(d.percent_fg_color == 0);
12792         assert(d.percent_bg_color == 0);
12793         assert(d.percent_fg_bold == 0);
12794         assert(d.barbrace_fg_color == 0);
12795         assert(d.barbrace_bg_color == 0);
12796         assert(d.barbrace_fg_bold == 0);
12797         assert(d.bar_fg_color == 0);
12798         assert(d.bar_bg_color == 0);
12799         assert(d.bar_fg_bold == 0);
12800         assert(io.in == 0);
12801         assert(io.out == 1);
12802         assert(io.in_ready == 0);
12803         assert(io.out_ready == 0);
12804         assert(io.eof_in == 0);
12805         assert(io.eof_out == 0);
12806         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12807         /* assert(io.cbuf == 0x0); */
12808         assert(io.last_read == 0);
12809         assert(io.last_write == 0);
12810         assert(io.total_read == 0);
12811         assert(io.total_write == 0);
12812         assert(io.total_size == 0);
12813         assert(io.total_size_known == 0);
12814         assert(io.timeout == 250000);
12815 
12816         clear_errno();
12817 }
12818 
12819 void test95(FILE *out)
12820 {
12821         FILE *tmp_rcfile = 0;
12822         
12823         clear_errno();
12824         ioInit();
12825         displayInit();
12826 
12827         tmp_rcfile = fopen("test-rcfile.txt", "w");
12828         assert(tmp_rcfile != 0);
12829         fclose(tmp_rcfile);
12830 
12831 #ifdef PRINT_DEBUG
12832         print();
12833 #endif
12834         assert(d.start_time == 0);
12835         assert(d.total_time == 0);
12836         assert(d.current_time == 0);
12837         assert(d.elapsed_time == 0);
12838         assert(d.percent_complete == 0);
12839         assert(d.display_interval == 1);
12840         assert(d.overtime_flag == 0);
12841         assert(d.k == 1024);
12842         assert(d.twiddle == '-');
12843         assert(d.manual_width == 0);
12844         assert(d.screen_width_minus_one == 0);
12845         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12846         assert(d.display_datacount == 1);
12847         assert(d.display_throughput == 1);
12848         assert(d.display_time == 1);
12849         assert(d.display_percent == 1);
12850         assert(d.display_bar == 1);
12851         assert(d.display_summary == 1);
12852         assert(d.display_ansi == 0);
12853         assert(d.twiddle_fg_color == 0);
12854         assert(d.twiddle_bg_color == 0);
12855         assert(d.twiddle_fg_bold == 0);
12856         assert(d.datacount_fg_color == 0);
12857         assert(d.datacount_bg_color == 0);
12858         assert(d.datacount_fg_bold == 0);
12859         assert(d.throughput_label_fg_color == 0);
12860         assert(d.throughput_label_bg_color == 0);
12861         assert(d.throughput_label_fg_bold == 0);
12862         assert(d.throughput_fg_color == 0);
12863         assert(d.throughput_bg_color == 0);
12864         assert(d.throughput_fg_bold == 0);
12865         assert(d.time_label_fg_color == 0);
12866         assert(d.time_label_bg_color == 0);
12867         assert(d.time_label_fg_bold == 0);
12868         assert(d.percent_fg_color == 0);
12869         assert(d.percent_bg_color == 0);
12870         assert(d.percent_fg_bold == 0);
12871         assert(d.barbrace_fg_color == 0);
12872         assert(d.barbrace_bg_color == 0);
12873         assert(d.barbrace_fg_bold == 0);
12874         assert(d.bar_fg_color == 0);
12875         assert(d.bar_bg_color == 0);
12876         assert(d.bar_fg_bold == 0);
12877         assert(io.in == 0);
12878         assert(io.out == 1);
12879         assert(io.in_ready == 0);
12880         assert(io.out_ready == 0);
12881         assert(io.eof_in == 0);
12882         assert(io.eof_out == 0);
12883         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12884         /* assert(io.cbuf == 0x0); */
12885         assert(io.last_read == 0);
12886         assert(io.last_write == 0);
12887         assert(io.total_read == 0);
12888         assert(io.total_write == 0);
12889         assert(io.total_size == 0);
12890         assert(io.total_size_known == 0);
12891         assert(io.timeout == 250000);
12892 
12893         assert(test_parse_rc(out,0));
12894 
12895 #ifdef PRINT_DEBUG
12896         print();
12897 #endif
12898         assert(d.start_time == 0);
12899         assert(d.total_time == 0);
12900         assert(d.current_time == 0);
12901         assert(d.elapsed_time == 0);
12902         assert(d.percent_complete == 0);
12903         assert(d.display_interval == 1);
12904         assert(d.overtime_flag == 0);
12905         assert(d.k == 1024);
12906         assert(d.twiddle == '-');
12907         assert(d.manual_width == 0);
12908         assert(d.screen_width_minus_one == 0);
12909         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12910         assert(d.display_datacount == 1);
12911         assert(d.display_throughput == 1);
12912         assert(d.display_time == 1);
12913         assert(d.display_percent == 1);
12914         assert(d.display_bar == 1);
12915         assert(d.display_summary == 1);
12916         assert(d.display_ansi == 0);
12917         assert(d.twiddle_fg_color == 0);
12918         assert(d.twiddle_bg_color == 0);
12919         assert(d.twiddle_fg_bold == 0);
12920         assert(d.datacount_fg_color == 0);
12921         assert(d.datacount_bg_color == 0);
12922         assert(d.datacount_fg_bold == 0);
12923         assert(d.throughput_label_fg_color == 0);
12924         assert(d.throughput_label_bg_color == 0);
12925         assert(d.throughput_label_fg_bold == 0);
12926         assert(d.throughput_fg_color == 0);
12927         assert(d.throughput_bg_color == 0);
12928         assert(d.throughput_fg_bold == 0);
12929         assert(d.time_label_fg_color == 0);
12930         assert(d.time_label_bg_color == 0);
12931         assert(d.time_label_fg_bold == 0);
12932         assert(d.percent_fg_color == 0);
12933         assert(d.percent_bg_color == 0);
12934         assert(d.percent_fg_bold == 0);
12935         assert(d.barbrace_fg_color == 0);
12936         assert(d.barbrace_bg_color == 0);
12937         assert(d.barbrace_fg_bold == 0);
12938         assert(d.bar_fg_color == 0);
12939         assert(d.bar_bg_color == 0);
12940         assert(d.bar_fg_bold == 0);
12941         assert(io.in == 0);
12942         assert(io.out == 1);
12943         assert(io.in_ready == 0);
12944         assert(io.out_ready == 0);
12945         assert(io.eof_in == 0);
12946         assert(io.eof_out == 0);
12947         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
12948         /* assert(io.cbuf == 0x0); */
12949         assert(io.last_read == 0);
12950         assert(io.last_write == 0);
12951         assert(io.total_read == 0);
12952         assert(io.total_write == 0);
12953         assert(io.total_size == 0);
12954         assert(io.total_size_known == 0);
12955         assert(io.timeout == 250000);
12956 
12957         assert(unlink("./test-rcfile.txt") == 0);
12958 }
12959 
12960 void test96(FILE *out)
12961 {
12962         FILE *tmp_rcfile = 0;
12963         
12964         clear_errno();
12965         ioInit();
12966         displayInit();
12967 
12968         tmp_rcfile = fopen("test-rcfile.txt", "w");
12969         assert(tmp_rcfile != 0);
12970         fprintf(tmp_rcfile, "buffer");
12971         fclose(tmp_rcfile);
12972 
12973 #ifdef PRINT_DEBUG
12974         print();
12975 #endif
12976         assert(d.start_time == 0);
12977         assert(d.total_time == 0);
12978         assert(d.current_time == 0);
12979         assert(d.elapsed_time == 0);
12980         assert(d.percent_complete == 0);
12981         assert(d.display_interval == 1);
12982         assert(d.overtime_flag == 0);
12983         assert(d.k == 1024);
12984         assert(d.twiddle == '-');
12985         assert(d.manual_width == 0);
12986         assert(d.screen_width_minus_one == 0);
12987         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
12988         assert(d.display_datacount == 1);
12989         assert(d.display_throughput == 1);
12990         assert(d.display_time == 1);
12991         assert(d.display_percent == 1);
12992         assert(d.display_bar == 1);
12993         assert(d.display_summary == 1);
12994         assert(d.display_ansi == 0);
12995         assert(d.twiddle_fg_color == 0);
12996         assert(d.twiddle_bg_color == 0);
12997         assert(d.twiddle_fg_bold == 0);
12998         assert(d.datacount_fg_color == 0);
12999         assert(d.datacount_bg_color == 0);
13000         assert(d.datacount_fg_bold == 0);
13001         assert(d.throughput_label_fg_color == 0);
13002         assert(d.throughput_label_bg_color == 0);
13003         assert(d.throughput_label_fg_bold == 0);
13004         assert(d.throughput_fg_color == 0);
13005         assert(d.throughput_bg_color == 0);
13006         assert(d.throughput_fg_bold == 0);
13007         assert(d.time_label_fg_color == 0);
13008         assert(d.time_label_bg_color == 0);
13009         assert(d.time_label_fg_bold == 0);
13010         assert(d.percent_fg_color == 0);
13011         assert(d.percent_bg_color == 0);
13012         assert(d.percent_fg_bold == 0);
13013         assert(d.barbrace_fg_color == 0);
13014         assert(d.barbrace_bg_color == 0);
13015         assert(d.barbrace_fg_bold == 0);
13016         assert(d.bar_fg_color == 0);
13017         assert(d.bar_bg_color == 0);
13018         assert(d.bar_fg_bold == 0);
13019         assert(io.in == 0);
13020         assert(io.out == 1);
13021         assert(io.in_ready == 0);
13022         assert(io.out_ready == 0);
13023         assert(io.eof_in == 0);
13024         assert(io.eof_out == 0);
13025         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13026         /* assert(io.cbuf == 0x0); */
13027         assert(io.last_read == 0);
13028         assert(io.last_write == 0);
13029         assert(io.total_read == 0);
13030         assert(io.total_write == 0);
13031         assert(io.total_size == 0);
13032         assert(io.total_size_known == 0);
13033         assert(io.timeout == 250000);
13034 
13035         assert(test_parse_rc(out,1));
13036 
13037 #ifdef PRINT_DEBUG
13038         print();
13039 #endif
13040         assert(d.start_time == 0);
13041         assert(d.total_time == 0);
13042         assert(d.current_time == 0);
13043         assert(d.elapsed_time == 0);
13044         assert(d.percent_complete == 0);
13045         assert(d.display_interval == 1);
13046         assert(d.overtime_flag == 0);
13047         assert(d.k == 1024);
13048         assert(d.twiddle == '-');
13049         assert(d.manual_width == 0);
13050         assert(d.screen_width_minus_one == 0);
13051         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13052         assert(d.display_datacount == 1);
13053         assert(d.display_throughput == 1);
13054         assert(d.display_time == 1);
13055         assert(d.display_percent == 1);
13056         assert(d.display_bar == 1);
13057         assert(d.display_summary == 1);
13058         assert(d.display_ansi == 0);
13059         assert(d.twiddle_fg_color == 0);
13060         assert(d.twiddle_bg_color == 0);
13061         assert(d.twiddle_fg_bold == 0);
13062         assert(d.datacount_fg_color == 0);
13063         assert(d.datacount_bg_color == 0);
13064         assert(d.datacount_fg_bold == 0);
13065         assert(d.throughput_label_fg_color == 0);
13066         assert(d.throughput_label_bg_color == 0);
13067         assert(d.throughput_label_fg_bold == 0);
13068         assert(d.throughput_fg_color == 0);
13069         assert(d.throughput_bg_color == 0);
13070         assert(d.throughput_fg_bold == 0);
13071         assert(d.time_label_fg_color == 0);
13072         assert(d.time_label_bg_color == 0);
13073         assert(d.time_label_fg_bold == 0);
13074         assert(d.percent_fg_color == 0);
13075         assert(d.percent_bg_color == 0);
13076         assert(d.percent_fg_bold == 0);
13077         assert(d.barbrace_fg_color == 0);
13078         assert(d.barbrace_bg_color == 0);
13079         assert(d.barbrace_fg_bold == 0);
13080         assert(d.bar_fg_color == 0);
13081         assert(d.bar_bg_color == 0);
13082         assert(d.bar_fg_bold == 0);
13083         assert(io.in == 0);
13084         assert(io.out == 1);
13085         assert(io.in_ready == 0);
13086         assert(io.out_ready == 0);
13087         assert(io.eof_in == 0);
13088         assert(io.eof_out == 0);
13089         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13090         /* assert(io.cbuf == 0x0); */
13091         assert(io.last_read == 0);
13092         assert(io.last_write == 0);
13093         assert(io.total_read == 0);
13094         assert(io.total_write == 0);
13095         assert(io.total_size == 0);
13096         assert(io.total_size_known == 0);
13097         assert(io.timeout == 250000);
13098 
13099         assert(unlink("./test-rcfile.txt") == 0);
13100 }
13101 
13102 void test97(FILE *out)
13103 {
13104         FILE *tmp_rcfile = 0;
13105         
13106         clear_errno();
13107         ioInit();
13108         displayInit();
13109 
13110         tmp_rcfile = fopen("test-rcfile.txt", "w");
13111         assert(tmp_rcfile != 0);
13112         fprintf(tmp_rcfile, "buffer:");
13113         fclose(tmp_rcfile);
13114 
13115 #ifdef PRINT_DEBUG
13116         print();
13117 #endif
13118         assert(d.start_time == 0);
13119         assert(d.total_time == 0);
13120         assert(d.current_time == 0);
13121         assert(d.elapsed_time == 0);
13122         assert(d.percent_complete == 0);
13123         assert(d.display_interval == 1);
13124         assert(d.overtime_flag == 0);
13125         assert(d.k == 1024);
13126         assert(d.twiddle == '-');
13127         assert(d.manual_width == 0);
13128         assert(d.screen_width_minus_one == 0);
13129         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13130         assert(d.display_datacount == 1);
13131         assert(d.display_throughput == 1);
13132         assert(d.display_time == 1);
13133         assert(d.display_percent == 1);
13134         assert(d.display_bar == 1);
13135         assert(d.display_summary == 1);
13136         assert(d.display_ansi == 0);
13137         assert(d.twiddle_fg_color == 0);
13138         assert(d.twiddle_bg_color == 0);
13139         assert(d.twiddle_fg_bold == 0);
13140         assert(d.datacount_fg_color == 0);
13141         assert(d.datacount_bg_color == 0);
13142         assert(d.datacount_fg_bold == 0);
13143         assert(d.throughput_label_fg_color == 0);
13144         assert(d.throughput_label_bg_color == 0);
13145         assert(d.throughput_label_fg_bold == 0);
13146         assert(d.throughput_fg_color == 0);
13147         assert(d.throughput_bg_color == 0);
13148         assert(d.throughput_fg_bold == 0);
13149         assert(d.time_label_fg_color == 0);
13150         assert(d.time_label_bg_color == 0);
13151         assert(d.time_label_fg_bold == 0);
13152         assert(d.percent_fg_color == 0);
13153         assert(d.percent_bg_color == 0);
13154         assert(d.percent_fg_bold == 0);
13155         assert(d.barbrace_fg_color == 0);
13156         assert(d.barbrace_bg_color == 0);
13157         assert(d.barbrace_fg_bold == 0);
13158         assert(d.bar_fg_color == 0);
13159         assert(d.bar_bg_color == 0);
13160         assert(d.bar_fg_bold == 0);
13161         assert(io.in == 0);
13162         assert(io.out == 1);
13163         assert(io.in_ready == 0);
13164         assert(io.out_ready == 0);
13165         assert(io.eof_in == 0);
13166         assert(io.eof_out == 0);
13167         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13168         /* assert(io.cbuf == 0x0); */
13169         assert(io.last_read == 0);
13170         assert(io.last_write == 0);
13171         assert(io.total_read == 0);
13172         assert(io.total_write == 0);
13173         assert(io.total_size == 0);
13174         assert(io.total_size_known == 0);
13175         assert(io.timeout == 250000);
13176 
13177         assert(test_parse_rc(out,1));
13178 
13179 #ifdef PRINT_DEBUG
13180         print();
13181 #endif
13182         assert(d.start_time == 0);
13183         assert(d.total_time == 0);
13184         assert(d.current_time == 0);
13185         assert(d.elapsed_time == 0);
13186         assert(d.percent_complete == 0);
13187         assert(d.display_interval == 1);
13188         assert(d.overtime_flag == 0);
13189         assert(d.k == 1024);
13190         assert(d.twiddle == '-');
13191         assert(d.manual_width == 0);
13192         assert(d.screen_width_minus_one == 0);
13193         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13194         assert(d.display_datacount == 1);
13195         assert(d.display_throughput == 1);
13196         assert(d.display_time == 1);
13197         assert(d.display_percent == 1);
13198         assert(d.display_bar == 1);
13199         assert(d.display_summary == 1);
13200         assert(d.display_ansi == 0);
13201         assert(d.twiddle_fg_color == 0);
13202         assert(d.twiddle_bg_color == 0);
13203         assert(d.twiddle_fg_bold == 0);
13204         assert(d.datacount_fg_color == 0);
13205         assert(d.datacount_bg_color == 0);
13206         assert(d.datacount_fg_bold == 0);
13207         assert(d.throughput_label_fg_color == 0);
13208         assert(d.throughput_label_bg_color == 0);
13209         assert(d.throughput_label_fg_bold == 0);
13210         assert(d.throughput_fg_color == 0);
13211         assert(d.throughput_bg_color == 0);
13212         assert(d.throughput_fg_bold == 0);
13213         assert(d.time_label_fg_color == 0);
13214         assert(d.time_label_bg_color == 0);
13215         assert(d.time_label_fg_bold == 0);
13216         assert(d.percent_fg_color == 0);
13217         assert(d.percent_bg_color == 0);
13218         assert(d.percent_fg_bold == 0);
13219         assert(d.barbrace_fg_color == 0);
13220         assert(d.barbrace_bg_color == 0);
13221         assert(d.barbrace_fg_bold == 0);
13222         assert(d.bar_fg_color == 0);
13223         assert(d.bar_bg_color == 0);
13224         assert(d.bar_fg_bold == 0);
13225         assert(io.in == 0);
13226         assert(io.out == 1);
13227         assert(io.in_ready == 0);
13228         assert(io.out_ready == 0);
13229         assert(io.eof_in == 0);
13230         assert(io.eof_out == 0);
13231         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13232         /* assert(io.cbuf == 0x0); */
13233         assert(io.last_read == 0);
13234         assert(io.last_write == 0);
13235         assert(io.total_read == 0);
13236         assert(io.total_write == 0);
13237         assert(io.total_size == 0);
13238         assert(io.total_size_known == 0);
13239         assert(io.timeout == 250000);
13240 
13241         assert(unlink("./test-rcfile.txt") == 0);
13242 }
13243 
13244 void test98(FILE *out)
13245 {
13246         FILE *tmp_rcfile = 0;
13247         
13248         clear_errno();
13249         ioInit();
13250         displayInit();
13251 
13252         tmp_rcfile = fopen("test-rcfile.txt", "w");
13253         assert(tmp_rcfile != 0);
13254         fprintf(tmp_rcfile, "buffer: ksjdhfkjh");
13255         fclose(tmp_rcfile);
13256 
13257 #ifdef PRINT_DEBUG
13258         print();
13259 #endif
13260         assert(d.start_time == 0);
13261         assert(d.total_time == 0);
13262         assert(d.current_time == 0);
13263         assert(d.elapsed_time == 0);
13264         assert(d.percent_complete == 0);
13265         assert(d.display_interval == 1);
13266         assert(d.overtime_flag == 0);
13267         assert(d.k == 1024);
13268         assert(d.twiddle == '-');
13269         assert(d.manual_width == 0);
13270         assert(d.screen_width_minus_one == 0);
13271         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13272         assert(d.display_datacount == 1);
13273         assert(d.display_throughput == 1);
13274         assert(d.display_time == 1);
13275         assert(d.display_percent == 1);
13276         assert(d.display_bar == 1);
13277         assert(d.display_summary == 1);
13278         assert(d.display_ansi == 0);
13279         assert(d.twiddle_fg_color == 0);
13280         assert(d.twiddle_bg_color == 0);
13281         assert(d.twiddle_fg_bold == 0);
13282         assert(d.datacount_fg_color == 0);
13283         assert(d.datacount_bg_color == 0);
13284         assert(d.datacount_fg_bold == 0);
13285         assert(d.throughput_label_fg_color == 0);
13286         assert(d.throughput_label_bg_color == 0);
13287         assert(d.throughput_label_fg_bold == 0);
13288         assert(d.throughput_fg_color == 0);
13289         assert(d.throughput_bg_color == 0);
13290         assert(d.throughput_fg_bold == 0);
13291         assert(d.time_label_fg_color == 0);
13292         assert(d.time_label_bg_color == 0);
13293         assert(d.time_label_fg_bold == 0);
13294         assert(d.percent_fg_color == 0);
13295         assert(d.percent_bg_color == 0);
13296         assert(d.percent_fg_bold == 0);
13297         assert(d.barbrace_fg_color == 0);
13298         assert(d.barbrace_bg_color == 0);
13299         assert(d.barbrace_fg_bold == 0);
13300         assert(d.bar_fg_color == 0);
13301         assert(d.bar_bg_color == 0);
13302         assert(d.bar_fg_bold == 0);
13303         assert(io.in == 0);
13304         assert(io.out == 1);
13305         assert(io.in_ready == 0);
13306         assert(io.out_ready == 0);
13307         assert(io.eof_in == 0);
13308         assert(io.eof_out == 0);
13309         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13310         /* assert(io.cbuf == 0x0); */
13311         assert(io.last_read == 0);
13312         assert(io.last_write == 0);
13313         assert(io.total_read == 0);
13314         assert(io.total_write == 0);
13315         assert(io.total_size == 0);
13316         assert(io.total_size_known == 0);
13317         assert(io.timeout == 250000);
13318 
13319         assert(test_parse_rc(out,1));
13320 
13321 #ifdef PRINT_DEBUG
13322         print();
13323 #endif
13324         assert(d.start_time == 0);
13325         assert(d.total_time == 0);
13326         assert(d.current_time == 0);
13327         assert(d.elapsed_time == 0);
13328         assert(d.percent_complete == 0);
13329         assert(d.display_interval == 1);
13330         assert(d.overtime_flag == 0);
13331         assert(d.k == 1024);
13332         assert(d.twiddle == '-');
13333         assert(d.manual_width == 0);
13334         assert(d.screen_width_minus_one == 0);
13335         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13336         assert(d.display_datacount == 1);
13337         assert(d.display_throughput == 1);
13338         assert(d.display_time == 1);
13339         assert(d.display_percent == 1);
13340         assert(d.display_bar == 1);
13341         assert(d.display_summary == 1);
13342         assert(d.display_ansi == 0);
13343         assert(d.twiddle_fg_color == 0);
13344         assert(d.twiddle_bg_color == 0);
13345         assert(d.twiddle_fg_bold == 0);
13346         assert(d.datacount_fg_color == 0);
13347         assert(d.datacount_bg_color == 0);
13348         assert(d.datacount_fg_bold == 0);
13349         assert(d.throughput_label_fg_color == 0);
13350         assert(d.throughput_label_bg_color == 0);
13351         assert(d.throughput_label_fg_bold == 0);
13352         assert(d.throughput_fg_color == 0);
13353         assert(d.throughput_bg_color == 0);
13354         assert(d.throughput_fg_bold == 0);
13355         assert(d.time_label_fg_color == 0);
13356         assert(d.time_label_bg_color == 0);
13357         assert(d.time_label_fg_bold == 0);
13358         assert(d.percent_fg_color == 0);
13359         assert(d.percent_bg_color == 0);
13360         assert(d.percent_fg_bold == 0);
13361         assert(d.barbrace_fg_color == 0);
13362         assert(d.barbrace_bg_color == 0);
13363         assert(d.barbrace_fg_bold == 0);
13364         assert(d.bar_fg_color == 0);
13365         assert(d.bar_bg_color == 0);
13366         assert(d.bar_fg_bold == 0);
13367         assert(io.in == 0);
13368         assert(io.out == 1);
13369         assert(io.in_ready == 0);
13370         assert(io.out_ready == 0);
13371         assert(io.eof_in == 0);
13372         assert(io.eof_out == 0);
13373         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13374         /* assert(io.cbuf == 0x0); */
13375         assert(io.last_read == 0);
13376         assert(io.last_write == 0);
13377         assert(io.total_read == 0);
13378         assert(io.total_write == 0);
13379         assert(io.total_size == 0);
13380         assert(io.total_size_known == 0);
13381         assert(io.timeout == 250000);
13382 
13383         assert(unlink("./test-rcfile.txt") == 0);
13384 }
13385 
13386 void test99(FILE *out)
13387 {
13388         FILE *tmp_rcfile = 0;
13389         
13390         clear_errno();
13391         ioInit();
13392         displayInit();
13393 
13394         tmp_rcfile = fopen("test-rcfile.txt", "w");
13395         assert(tmp_rcfile != 0);
13396         fprintf(tmp_rcfile, "buffer-size: ksjdhfkjh");
13397         fclose(tmp_rcfile);
13398 
13399 #ifdef PRINT_DEBUG
13400         print();
13401 #endif
13402         assert(d.start_time == 0);
13403         assert(d.total_time == 0);
13404         assert(d.current_time == 0);
13405         assert(d.elapsed_time == 0);
13406         assert(d.percent_complete == 0);
13407         assert(d.display_interval == 1);
13408         assert(d.overtime_flag == 0);
13409         assert(d.k == 1024);
13410         assert(d.twiddle == '-');
13411         assert(d.manual_width == 0);
13412         assert(d.screen_width_minus_one == 0);
13413         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13414         assert(d.display_datacount == 1);
13415         assert(d.display_throughput == 1);
13416         assert(d.display_time == 1);
13417         assert(d.display_percent == 1);
13418         assert(d.display_bar == 1);
13419         assert(d.display_summary == 1);
13420         assert(d.display_ansi == 0);
13421         assert(d.twiddle_fg_color == 0);
13422         assert(d.twiddle_bg_color == 0);
13423         assert(d.twiddle_fg_bold == 0);
13424         assert(d.datacount_fg_color == 0);
13425         assert(d.datacount_bg_color == 0);
13426         assert(d.datacount_fg_bold == 0);
13427         assert(d.throughput_label_fg_color == 0);
13428         assert(d.throughput_label_bg_color == 0);
13429         assert(d.throughput_label_fg_bold == 0);
13430         assert(d.throughput_fg_color == 0);
13431         assert(d.throughput_bg_color == 0);
13432         assert(d.throughput_fg_bold == 0);
13433         assert(d.time_label_fg_color == 0);
13434         assert(d.time_label_bg_color == 0);
13435         assert(d.time_label_fg_bold == 0);
13436         assert(d.percent_fg_color == 0);
13437         assert(d.percent_bg_color == 0);
13438         assert(d.percent_fg_bold == 0);
13439         assert(d.barbrace_fg_color == 0);
13440         assert(d.barbrace_bg_color == 0);
13441         assert(d.barbrace_fg_bold == 0);
13442         assert(d.bar_fg_color == 0);
13443         assert(d.bar_bg_color == 0);
13444         assert(d.bar_fg_bold == 0);
13445         assert(io.in == 0);
13446         assert(io.out == 1);
13447         assert(io.in_ready == 0);
13448         assert(io.out_ready == 0);
13449         assert(io.eof_in == 0);
13450         assert(io.eof_out == 0);
13451         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13452         /* assert(io.cbuf == 0x0); */
13453         assert(io.last_read == 0);
13454         assert(io.last_write == 0);
13455         assert(io.total_read == 0);
13456         assert(io.total_write == 0);
13457         assert(io.total_size == 0);
13458         assert(io.total_size_known == 0);
13459         assert(io.timeout == 250000);
13460 
13461         assert(test_parse_rc(out,1));
13462 
13463 #ifdef PRINT_DEBUG
13464         print();
13465 #endif
13466         assert(d.start_time == 0);
13467         assert(d.total_time == 0);
13468         assert(d.current_time == 0);
13469         assert(d.elapsed_time == 0);
13470         assert(d.percent_complete == 0);
13471         assert(d.display_interval == 1);
13472         assert(d.overtime_flag == 0);
13473         assert(d.k == 1024);
13474         assert(d.twiddle == '-');
13475         assert(d.manual_width == 0);
13476         assert(d.screen_width_minus_one == 0);
13477         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13478         assert(d.display_datacount == 1);
13479         assert(d.display_throughput == 1);
13480         assert(d.display_time == 1);
13481         assert(d.display_percent == 1);
13482         assert(d.display_bar == 1);
13483         assert(d.display_summary == 1);
13484         assert(d.display_ansi == 0);
13485         assert(d.twiddle_fg_color == 0);
13486         assert(d.twiddle_bg_color == 0);
13487         assert(d.twiddle_fg_bold == 0);
13488         assert(d.datacount_fg_color == 0);
13489         assert(d.datacount_bg_color == 0);
13490         assert(d.datacount_fg_bold == 0);
13491         assert(d.throughput_label_fg_color == 0);
13492         assert(d.throughput_label_bg_color == 0);
13493         assert(d.throughput_label_fg_bold == 0);
13494         assert(d.throughput_fg_color == 0);
13495         assert(d.throughput_bg_color == 0);
13496         assert(d.throughput_fg_bold == 0);
13497         assert(d.time_label_fg_color == 0);
13498         assert(d.time_label_bg_color == 0);
13499         assert(d.time_label_fg_bold == 0);
13500         assert(d.percent_fg_color == 0);
13501         assert(d.percent_bg_color == 0);
13502         assert(d.percent_fg_bold == 0);
13503         assert(d.barbrace_fg_color == 0);
13504         assert(d.barbrace_bg_color == 0);
13505         assert(d.barbrace_fg_bold == 0);
13506         assert(d.bar_fg_color == 0);
13507         assert(d.bar_bg_color == 0);
13508         assert(d.bar_fg_bold == 0);
13509         assert(io.in == 0);
13510         assert(io.out == 1);
13511         assert(io.in_ready == 0);
13512         assert(io.out_ready == 0);
13513         assert(io.eof_in == 0);
13514         assert(io.eof_out == 0);
13515         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13516         /* assert(io.cbuf == 0x0); */
13517         assert(io.last_read == 0);
13518         assert(io.last_write == 0);
13519         assert(io.total_read == 0);
13520         assert(io.total_write == 0);
13521         assert(io.total_size == 0);
13522         assert(io.total_size_known == 0);
13523         assert(io.timeout == 250000);
13524 
13525         assert(unlink("./test-rcfile.txt") == 0);
13526 }
13527 
13528 void test100(FILE *out)
13529 {
13530         FILE *tmp_rcfile = 0;
13531         
13532         clear_errno();
13533         ioInit();
13534         displayInit();
13535 
13536         tmp_rcfile = fopen("test-rcfile.txt", "w");
13537         assert(tmp_rcfile != 0);
13538         fprintf(tmp_rcfile, "buffer-size: ");
13539         fclose(tmp_rcfile);
13540 
13541 #ifdef PRINT_DEBUG
13542         print();
13543 #endif
13544         assert(d.start_time == 0);
13545         assert(d.total_time == 0);
13546         assert(d.current_time == 0);
13547         assert(d.elapsed_time == 0);
13548         assert(d.percent_complete == 0);
13549         assert(d.display_interval == 1);
13550         assert(d.overtime_flag == 0);
13551         assert(d.k == 1024);
13552         assert(d.twiddle == '-');
13553         assert(d.manual_width == 0);
13554         assert(d.screen_width_minus_one == 0);
13555         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13556         assert(d.display_datacount == 1);
13557         assert(d.display_throughput == 1);
13558         assert(d.display_time == 1);
13559         assert(d.display_percent == 1);
13560         assert(d.display_bar == 1);
13561         assert(d.display_summary == 1);
13562         assert(d.display_ansi == 0);
13563         assert(d.twiddle_fg_color == 0);
13564         assert(d.twiddle_bg_color == 0);
13565         assert(d.twiddle_fg_bold == 0);
13566         assert(d.datacount_fg_color == 0);
13567         assert(d.datacount_bg_color == 0);
13568         assert(d.datacount_fg_bold == 0);
13569         assert(d.throughput_label_fg_color == 0);
13570         assert(d.throughput_label_bg_color == 0);
13571         assert(d.throughput_label_fg_bold == 0);
13572         assert(d.throughput_fg_color == 0);
13573         assert(d.throughput_bg_color == 0);
13574         assert(d.throughput_fg_bold == 0);
13575         assert(d.time_label_fg_color == 0);
13576         assert(d.time_label_bg_color == 0);
13577         assert(d.time_label_fg_bold == 0);
13578         assert(d.percent_fg_color == 0);
13579         assert(d.percent_bg_color == 0);
13580         assert(d.percent_fg_bold == 0);
13581         assert(d.barbrace_fg_color == 0);
13582         assert(d.barbrace_bg_color == 0);
13583         assert(d.barbrace_fg_bold == 0);
13584         assert(d.bar_fg_color == 0);
13585         assert(d.bar_bg_color == 0);
13586         assert(d.bar_fg_bold == 0);
13587         assert(io.in == 0);
13588         assert(io.out == 1);
13589         assert(io.in_ready == 0);
13590         assert(io.out_ready == 0);
13591         assert(io.eof_in == 0);
13592         assert(io.eof_out == 0);
13593         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13594         /* assert(io.cbuf == 0x0); */
13595         assert(io.last_read == 0);
13596         assert(io.last_write == 0);
13597         assert(io.total_read == 0);
13598         assert(io.total_write == 0);
13599         assert(io.total_size == 0);
13600         assert(io.total_size_known == 0);
13601         assert(io.timeout == 250000);
13602 
13603         assert(test_parse_rc(out,1));
13604 
13605 #ifdef PRINT_DEBUG
13606         print();
13607 #endif
13608         assert(d.start_time == 0);
13609         assert(d.total_time == 0);
13610         assert(d.current_time == 0);
13611         assert(d.elapsed_time == 0);
13612         assert(d.percent_complete == 0);
13613         assert(d.display_interval == 1);
13614         assert(d.overtime_flag == 0);
13615         assert(d.k == 1024);
13616         assert(d.twiddle == '-');
13617         assert(d.manual_width == 0);
13618         assert(d.screen_width_minus_one == 0);
13619         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13620         assert(d.display_datacount == 1);
13621         assert(d.display_throughput == 1);
13622         assert(d.display_time == 1);
13623         assert(d.display_percent == 1);
13624         assert(d.display_bar == 1);
13625         assert(d.display_summary == 1);
13626         assert(d.display_ansi == 0);
13627         assert(d.twiddle_fg_color == 0);
13628         assert(d.twiddle_bg_color == 0);
13629         assert(d.twiddle_fg_bold == 0);
13630         assert(d.datacount_fg_color == 0);
13631         assert(d.datacount_bg_color == 0);
13632         assert(d.datacount_fg_bold == 0);
13633         assert(d.throughput_label_fg_color == 0);
13634         assert(d.throughput_label_bg_color == 0);
13635         assert(d.throughput_label_fg_bold == 0);
13636         assert(d.throughput_fg_color == 0);
13637         assert(d.throughput_bg_color == 0);
13638         assert(d.throughput_fg_bold == 0);
13639         assert(d.time_label_fg_color == 0);
13640         assert(d.time_label_bg_color == 0);
13641         assert(d.time_label_fg_bold == 0);
13642         assert(d.percent_fg_color == 0);
13643         assert(d.percent_bg_color == 0);
13644         assert(d.percent_fg_bold == 0);
13645         assert(d.barbrace_fg_color == 0);
13646         assert(d.barbrace_bg_color == 0);
13647         assert(d.barbrace_fg_bold == 0);
13648         assert(d.bar_fg_color == 0);
13649         assert(d.bar_bg_color == 0);
13650         assert(d.bar_fg_bold == 0);
13651         assert(io.in == 0);
13652         assert(io.out == 1);
13653         assert(io.in_ready == 0);
13654         assert(io.out_ready == 0);
13655         assert(io.eof_in == 0);
13656         assert(io.eof_out == 0);
13657         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13658         /* assert(io.cbuf == 0x0); */
13659         assert(io.last_read == 0);
13660         assert(io.last_write == 0);
13661         assert(io.total_read == 0);
13662         assert(io.total_write == 0);
13663         assert(io.total_size == 0);
13664         assert(io.total_size_known == 0);
13665         assert(io.timeout == 250000);
13666 
13667         assert(unlink("./test-rcfile.txt") == 0);
13668 }
13669 
13670 void test101(FILE *out)
13671 {
13672         FILE *tmp_rcfile = 0;
13673         
13674         tmp_rcfile = fopen("test-rcfile.txt", "w");
13675         assert(tmp_rcfile != 0);
13676         fprintf(tmp_rcfile, "buffer-size: m");
13677         fclose(tmp_rcfile);
13678 
13679         clear_errno();
13680         ioInit();
13681         displayInit();
13682 
13683 #ifdef PRINT_DEBUG
13684         print();
13685 #endif
13686         assert(d.start_time == 0);
13687         assert(d.total_time == 0);
13688         assert(d.current_time == 0);
13689         assert(d.elapsed_time == 0);
13690         assert(d.percent_complete == 0);
13691         assert(d.display_interval == 1);
13692         assert(d.overtime_flag == 0);
13693         assert(d.k == 1024);
13694         assert(d.twiddle == '-');
13695         assert(d.manual_width == 0);
13696         assert(d.screen_width_minus_one == 0);
13697         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13698         assert(d.display_datacount == 1);
13699         assert(d.display_throughput == 1);
13700         assert(d.display_time == 1);
13701         assert(d.display_percent == 1);
13702         assert(d.display_bar == 1);
13703         assert(d.display_summary == 1);
13704         assert(d.display_ansi == 0);
13705         assert(d.twiddle_fg_color == 0);
13706         assert(d.twiddle_bg_color == 0);
13707         assert(d.twiddle_fg_bold == 0);
13708         assert(d.datacount_fg_color == 0);
13709         assert(d.datacount_bg_color == 0);
13710         assert(d.datacount_fg_bold == 0);
13711         assert(d.throughput_label_fg_color == 0);
13712         assert(d.throughput_label_bg_color == 0);
13713         assert(d.throughput_label_fg_bold == 0);
13714         assert(d.throughput_fg_color == 0);
13715         assert(d.throughput_bg_color == 0);
13716         assert(d.throughput_fg_bold == 0);
13717         assert(d.time_label_fg_color == 0);
13718         assert(d.time_label_bg_color == 0);
13719         assert(d.time_label_fg_bold == 0);
13720         assert(d.percent_fg_color == 0);
13721         assert(d.percent_bg_color == 0);
13722         assert(d.percent_fg_bold == 0);
13723         assert(d.barbrace_fg_color == 0);
13724         assert(d.barbrace_bg_color == 0);
13725         assert(d.barbrace_fg_bold == 0);
13726         assert(d.bar_fg_color == 0);
13727         assert(d.bar_bg_color == 0);
13728         assert(d.bar_fg_bold == 0);
13729         assert(io.in == 0);
13730         assert(io.out == 1);
13731         assert(io.in_ready == 0);
13732         assert(io.out_ready == 0);
13733         assert(io.eof_in == 0);
13734         assert(io.eof_out == 0);
13735         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13736         /* assert(io.cbuf == 0x0); */
13737         assert(io.last_read == 0);
13738         assert(io.last_write == 0);
13739         assert(io.total_read == 0);
13740         assert(io.total_write == 0);
13741         assert(io.total_size == 0);
13742         assert(io.total_size_known == 0);
13743         assert(io.timeout == 250000);
13744 
13745         assert(test_parse_rc(out,1));
13746 
13747 #ifdef PRINT_DEBUG
13748         print();
13749 #endif
13750         assert(d.start_time == 0);
13751         assert(d.total_time == 0);
13752         assert(d.current_time == 0);
13753         assert(d.elapsed_time == 0);
13754         assert(d.percent_complete == 0);
13755         assert(d.display_interval == 1);
13756         assert(d.overtime_flag == 0);
13757         assert(d.k == 1024);
13758         assert(d.twiddle == '-');
13759         assert(d.manual_width == 0);
13760         assert(d.screen_width_minus_one == 0);
13761         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13762         assert(d.display_datacount == 1);
13763         assert(d.display_throughput == 1);
13764         assert(d.display_time == 1);
13765         assert(d.display_percent == 1);
13766         assert(d.display_bar == 1);
13767         assert(d.display_summary == 1);
13768         assert(d.display_ansi == 0);
13769         assert(d.twiddle_fg_color == 0);
13770         assert(d.twiddle_bg_color == 0);
13771         assert(d.twiddle_fg_bold == 0);
13772         assert(d.datacount_fg_color == 0);
13773         assert(d.datacount_bg_color == 0);
13774         assert(d.datacount_fg_bold == 0);
13775         assert(d.throughput_label_fg_color == 0);
13776         assert(d.throughput_label_bg_color == 0);
13777         assert(d.throughput_label_fg_bold == 0);
13778         assert(d.throughput_fg_color == 0);
13779         assert(d.throughput_bg_color == 0);
13780         assert(d.throughput_fg_bold == 0);
13781         assert(d.time_label_fg_color == 0);
13782         assert(d.time_label_bg_color == 0);
13783         assert(d.time_label_fg_bold == 0);
13784         assert(d.percent_fg_color == 0);
13785         assert(d.percent_bg_color == 0);
13786         assert(d.percent_fg_bold == 0);
13787         assert(d.barbrace_fg_color == 0);
13788         assert(d.barbrace_bg_color == 0);
13789         assert(d.barbrace_fg_bold == 0);
13790         assert(d.bar_fg_color == 0);
13791         assert(d.bar_bg_color == 0);
13792         assert(d.bar_fg_bold == 0);
13793         assert(io.in == 0);
13794         assert(io.out == 1);
13795         assert(io.in_ready == 0);
13796         assert(io.out_ready == 0);
13797         assert(io.eof_in == 0);
13798         assert(io.eof_out == 0);
13799         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13800         /* assert(io.cbuf == 0x0); */
13801         assert(io.last_read == 0);
13802         assert(io.last_write == 0);
13803         assert(io.total_read == 0);
13804         assert(io.total_write == 0);
13805         assert(io.total_size == 0);
13806         assert(io.total_size_known == 0);
13807         assert(io.timeout == 250000);
13808 
13809         assert(unlink("./test-rcfile.txt") == 0);
13810 }
13811 
13812 void test102(FILE *out)
13813 {
13814         FILE *tmp_rcfile = 0;
13815         
13816         tmp_rcfile = fopen("test-rcfile.txt", "w");
13817         assert(tmp_rcfile != 0);
13818         fprintf(tmp_rcfile, "buffer-size: .m");
13819         fclose(tmp_rcfile);
13820 
13821         clear_errno();
13822         ioInit();
13823         displayInit();
13824 
13825 #ifdef PRINT_DEBUG
13826         print();
13827 #endif
13828         assert(d.start_time == 0);
13829         assert(d.total_time == 0);
13830         assert(d.current_time == 0);
13831         assert(d.elapsed_time == 0);
13832         assert(d.percent_complete == 0);
13833         assert(d.display_interval == 1);
13834         assert(d.overtime_flag == 0);
13835         assert(d.k == 1024);
13836         assert(d.twiddle == '-');
13837         assert(d.manual_width == 0);
13838         assert(d.screen_width_minus_one == 0);
13839         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13840         assert(d.display_datacount == 1);
13841         assert(d.display_throughput == 1);
13842         assert(d.display_time == 1);
13843         assert(d.display_percent == 1);
13844         assert(d.display_bar == 1);
13845         assert(d.display_summary == 1);
13846         assert(d.display_ansi == 0);
13847         assert(d.twiddle_fg_color == 0);
13848         assert(d.twiddle_bg_color == 0);
13849         assert(d.twiddle_fg_bold == 0);
13850         assert(d.datacount_fg_color == 0);
13851         assert(d.datacount_bg_color == 0);
13852         assert(d.datacount_fg_bold == 0);
13853         assert(d.throughput_label_fg_color == 0);
13854         assert(d.throughput_label_bg_color == 0);
13855         assert(d.throughput_label_fg_bold == 0);
13856         assert(d.throughput_fg_color == 0);
13857         assert(d.throughput_bg_color == 0);
13858         assert(d.throughput_fg_bold == 0);
13859         assert(d.time_label_fg_color == 0);
13860         assert(d.time_label_bg_color == 0);
13861         assert(d.time_label_fg_bold == 0);
13862         assert(d.percent_fg_color == 0);
13863         assert(d.percent_bg_color == 0);
13864         assert(d.percent_fg_bold == 0);
13865         assert(d.barbrace_fg_color == 0);
13866         assert(d.barbrace_bg_color == 0);
13867         assert(d.barbrace_fg_bold == 0);
13868         assert(d.bar_fg_color == 0);
13869         assert(d.bar_bg_color == 0);
13870         assert(d.bar_fg_bold == 0);
13871         assert(io.in == 0);
13872         assert(io.out == 1);
13873         assert(io.in_ready == 0);
13874         assert(io.out_ready == 0);
13875         assert(io.eof_in == 0);
13876         assert(io.eof_out == 0);
13877         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13878         /* assert(io.cbuf == 0x0); */
13879         assert(io.last_read == 0);
13880         assert(io.last_write == 0);
13881         assert(io.total_read == 0);
13882         assert(io.total_write == 0);
13883         assert(io.total_size == 0);
13884         assert(io.total_size_known == 0);
13885         assert(io.timeout == 250000);
13886 
13887         assert(test_parse_rc(out,1));
13888 
13889 #ifdef PRINT_DEBUG
13890         print();
13891 #endif
13892         assert(d.start_time == 0);
13893         assert(d.total_time == 0);
13894         assert(d.current_time == 0);
13895         assert(d.elapsed_time == 0);
13896         assert(d.percent_complete == 0);
13897         assert(d.display_interval == 1);
13898         assert(d.overtime_flag == 0);
13899         assert(d.k == 1024);
13900         assert(d.twiddle == '-');
13901         assert(d.manual_width == 0);
13902         assert(d.screen_width_minus_one == 0);
13903         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13904         assert(d.display_datacount == 1);
13905         assert(d.display_throughput == 1);
13906         assert(d.display_time == 1);
13907         assert(d.display_percent == 1);
13908         assert(d.display_bar == 1);
13909         assert(d.display_summary == 1);
13910         assert(d.display_ansi == 0);
13911         assert(d.twiddle_fg_color == 0);
13912         assert(d.twiddle_bg_color == 0);
13913         assert(d.twiddle_fg_bold == 0);
13914         assert(d.datacount_fg_color == 0);
13915         assert(d.datacount_bg_color == 0);
13916         assert(d.datacount_fg_bold == 0);
13917         assert(d.throughput_label_fg_color == 0);
13918         assert(d.throughput_label_bg_color == 0);
13919         assert(d.throughput_label_fg_bold == 0);
13920         assert(d.throughput_fg_color == 0);
13921         assert(d.throughput_bg_color == 0);
13922         assert(d.throughput_fg_bold == 0);
13923         assert(d.time_label_fg_color == 0);
13924         assert(d.time_label_bg_color == 0);
13925         assert(d.time_label_fg_bold == 0);
13926         assert(d.percent_fg_color == 0);
13927         assert(d.percent_bg_color == 0);
13928         assert(d.percent_fg_bold == 0);
13929         assert(d.barbrace_fg_color == 0);
13930         assert(d.barbrace_bg_color == 0);
13931         assert(d.barbrace_fg_bold == 0);
13932         assert(d.bar_fg_color == 0);
13933         assert(d.bar_bg_color == 0);
13934         assert(d.bar_fg_bold == 0);
13935         assert(io.in == 0);
13936         assert(io.out == 1);
13937         assert(io.in_ready == 0);
13938         assert(io.out_ready == 0);
13939         assert(io.eof_in == 0);
13940         assert(io.eof_out == 0);
13941         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
13942         /* assert(io.cbuf == 0x0); */
13943         assert(io.last_read == 0);
13944         assert(io.last_write == 0);
13945         assert(io.total_read == 0);
13946         assert(io.total_write == 0);
13947         assert(io.total_size == 0);
13948         assert(io.total_size_known == 0);
13949         assert(io.timeout == 250000);
13950 
13951         assert(unlink("./test-rcfile.txt") == 0);
13952 }
13953 
13954 void test103(FILE *out)
13955 {
13956         FILE *tmp_rcfile = 0;
13957         
13958         tmp_rcfile = fopen("test-rcfile.txt", "w");
13959         assert(tmp_rcfile != 0);
13960         fprintf(tmp_rcfile, "buffer-size: 1m1");
13961         fclose(tmp_rcfile);
13962 
13963         clear_errno();
13964         ioInit();
13965         displayInit();
13966 
13967 #ifdef PRINT_DEBUG
13968         print();
13969 #endif
13970         assert(d.start_time == 0);
13971         assert(d.total_time == 0);
13972         assert(d.current_time == 0);
13973         assert(d.elapsed_time == 0);
13974         assert(d.percent_complete == 0);
13975         assert(d.display_interval == 1);
13976         assert(d.overtime_flag == 0);
13977         assert(d.k == 1024);
13978         assert(d.twiddle == '-');
13979         assert(d.manual_width == 0);
13980         assert(d.screen_width_minus_one == 0);
13981         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
13982         assert(d.display_datacount == 1);
13983         assert(d.display_throughput == 1);
13984         assert(d.display_time == 1);
13985         assert(d.display_percent == 1);
13986         assert(d.display_bar == 1);
13987         assert(d.display_summary == 1);
13988         assert(d.display_ansi == 0);
13989         assert(d.twiddle_fg_color == 0);
13990         assert(d.twiddle_bg_color == 0);
13991         assert(d.twiddle_fg_bold == 0);
13992         assert(d.datacount_fg_color == 0);
13993         assert(d.datacount_bg_color == 0);
13994         assert(d.datacount_fg_bold == 0);
13995         assert(d.throughput_label_fg_color == 0);
13996         assert(d.throughput_label_bg_color == 0);
13997         assert(d.throughput_label_fg_bold == 0);
13998         assert(d.throughput_fg_color == 0);
13999         assert(d.throughput_bg_color == 0);
14000         assert(d.throughput_fg_bold == 0);
14001         assert(d.time_label_fg_color == 0);
14002         assert(d.time_label_bg_color == 0);
14003         assert(d.time_label_fg_bold == 0);
14004         assert(d.percent_fg_color == 0);
14005         assert(d.percent_bg_color == 0);
14006         assert(d.percent_fg_bold == 0);
14007         assert(d.barbrace_fg_color == 0);
14008         assert(d.barbrace_bg_color == 0);
14009         assert(d.barbrace_fg_bold == 0);
14010         assert(d.bar_fg_color == 0);
14011         assert(d.bar_bg_color == 0);
14012         assert(d.bar_fg_bold == 0);
14013         assert(io.in == 0);
14014         assert(io.out == 1);
14015         assert(io.in_ready == 0);
14016         assert(io.out_ready == 0);
14017         assert(io.eof_in == 0);
14018         assert(io.eof_out == 0);
14019         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
14020         /* assert(io.cbuf == 0x0); */
14021         assert(io.last_read == 0);
14022         assert(io.last_write == 0);
14023         assert(io.total_read == 0);
14024         assert(io.total_write == 0);
14025         assert(io.total_size == 0);
14026         assert(io.total_size_known == 0);
14027         assert(io.timeout == 250000);
14028 
14029         assert(test_parse_rc(out,1));
14030 
14031 #ifdef PRINT_DEBUG
14032         print();
14033 #endif
14034         assert(d.start_time == 0);
14035         assert(d.total_time == 0);
14036         assert(d.current_time == 0);
14037         assert(d.elapsed_time == 0);
14038         assert(d.percent_complete == 0);
14039         assert(d.display_interval == 1);
14040         assert(d.overtime_flag == 0);
14041         assert(d.k == 1024);
14042         assert(d.twiddle == '-');
14043         assert(d.manual_width == 0);
14044         assert(d.screen_width_minus_one == 0);
14045         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14046         assert(d.display_datacount == 1);
14047         assert(d.display_throughput == 1);
14048         assert(d.display_time == 1);
14049         assert(d.display_percent == 1);
14050         assert(d.display_bar == 1);
14051         assert(d.display_summary == 1);
14052         assert(d.display_ansi == 0);
14053         assert(d.twiddle_fg_color == 0);
14054         assert(d.twiddle_bg_color == 0);
14055         assert(d.twiddle_fg_bold == 0);
14056         assert(d.datacount_fg_color == 0);
14057         assert(d.datacount_bg_color == 0);
14058         assert(d.datacount_fg_bold == 0);
14059         assert(d.throughput_label_fg_color == 0);
14060         assert(d.throughput_label_bg_color == 0);
14061         assert(d.throughput_label_fg_bold == 0);
14062         assert(d.throughput_fg_color == 0);
14063         assert(d.throughput_bg_color == 0);
14064         assert(d.throughput_fg_bold == 0);
14065         assert(d.time_label_fg_color == 0);
14066         assert(d.time_label_bg_color == 0);
14067         assert(d.time_label_fg_bold == 0);
14068         assert(d.percent_fg_color == 0);
14069         assert(d.percent_bg_color == 0);
14070         assert(d.percent_fg_bold == 0);
14071         assert(d.barbrace_fg_color == 0);
14072         assert(d.barbrace_bg_color == 0);
14073         assert(d.barbrace_fg_bold == 0);
14074         assert(d.bar_fg_color == 0);
14075         assert(d.bar_bg_color == 0);
14076         assert(d.bar_fg_bold == 0);
14077         assert(io.in == 0);
14078         assert(io.out == 1);
14079         assert(io.in_ready == 0);
14080         assert(io.out_ready == 0);
14081         assert(io.eof_in == 0);
14082         assert(io.eof_out == 0);
14083         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
14084         /* assert(io.cbuf == 0x0); */
14085         assert(io.last_read == 0);
14086         assert(io.last_write == 0);
14087         assert(io.total_read == 0);
14088         assert(io.total_write == 0);
14089         assert(io.total_size == 0);
14090         assert(io.total_size_known == 0);
14091         assert(io.timeout == 250000);
14092 
14093         assert(unlink("./test-rcfile.txt") == 0);
14094 }
14095 
14096 void test104(FILE *out)
14097 {
14098         FILE *tmp_rcfile = 0;
14099         
14100         tmp_rcfile = fopen("test-rcfile.txt", "w");
14101         assert(tmp_rcfile != 0);
14102         fprintf(tmp_rcfile, "buffer-size: .0m");
14103         fclose(tmp_rcfile);
14104 
14105         clear_errno();
14106         ioInit();
14107         displayInit();
14108 
14109 #ifdef PRINT_DEBUG
14110         print();
14111 #endif
14112         assert(d.start_time == 0);
14113         assert(d.total_time == 0);
14114         assert(d.current_time == 0);
14115         assert(d.elapsed_time == 0);
14116         assert(d.percent_complete == 0);
14117         assert(d.display_interval == 1);
14118         assert(d.overtime_flag == 0);
14119         assert(d.k == 1024);
14120         assert(d.twiddle == '-');
14121         assert(d.manual_width == 0);
14122         assert(d.screen_width_minus_one == 0);
14123         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14124         assert(d.display_datacount == 1);
14125         assert(d.display_throughput == 1);
14126         assert(d.display_time == 1);
14127         assert(d.display_percent == 1);
14128         assert(d.display_bar == 1);
14129         assert(d.display_summary == 1);
14130         assert(d.display_ansi == 0);
14131         assert(d.twiddle_fg_color == 0);
14132         assert(d.twiddle_bg_color == 0);
14133         assert(d.twiddle_fg_bold == 0);
14134         assert(d.datacount_fg_color == 0);
14135         assert(d.datacount_bg_color == 0);
14136         assert(d.datacount_fg_bold == 0);
14137         assert(d.throughput_label_fg_color == 0);
14138         assert(d.throughput_label_bg_color == 0);
14139         assert(d.throughput_label_fg_bold == 0);
14140         assert(d.throughput_fg_color == 0);
14141         assert(d.throughput_bg_color == 0);
14142         assert(d.throughput_fg_bold == 0);
14143         assert(d.time_label_fg_color == 0);
14144         assert(d.time_label_bg_color == 0);
14145         assert(d.time_label_fg_bold == 0);
14146         assert(d.percent_fg_color == 0);
14147         assert(d.percent_bg_color == 0);
14148         assert(d.percent_fg_bold == 0);
14149         assert(d.barbrace_fg_color == 0);
14150         assert(d.barbrace_bg_color == 0);
14151         assert(d.barbrace_fg_bold == 0);
14152         assert(d.bar_fg_color == 0);
14153         assert(d.bar_bg_color == 0);
14154         assert(d.bar_fg_bold == 0);
14155         assert(io.in == 0);
14156         assert(io.out == 1);
14157         assert(io.in_ready == 0);
14158         assert(io.out_ready == 0);
14159         assert(io.eof_in == 0);
14160         assert(io.eof_out == 0);
14161         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
14162         /* assert(io.cbuf == 0x0); */
14163         assert(io.last_read == 0);
14164         assert(io.last_write == 0);
14165         assert(io.total_read == 0);
14166         assert(io.total_write == 0);
14167         assert(io.total_size == 0);
14168         assert(io.total_size_known == 0);
14169         assert(io.timeout == 250000);
14170 
14171         assert(test_parse_rc(out,1));
14172 
14173 #ifdef PRINT_DEBUG
14174         print();
14175 #endif
14176         assert(d.start_time == 0);
14177         assert(d.total_time == 0);
14178         assert(d.current_time == 0);
14179         assert(d.elapsed_time == 0);
14180         assert(d.percent_complete == 0);
14181         assert(d.display_interval == 1);
14182         assert(d.overtime_flag == 0);
14183         assert(d.k == 1024);
14184         assert(d.twiddle == '-');
14185         assert(d.manual_width == 0);
14186         assert(d.screen_width_minus_one == 0);
14187         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14188         assert(d.display_datacount == 1);
14189         assert(d.display_throughput == 1);
14190         assert(d.display_time == 1);
14191         assert(d.display_percent == 1);
14192         assert(d.display_bar == 1);
14193         assert(d.display_summary == 1);
14194         assert(d.display_ansi == 0);
14195         assert(d.twiddle_fg_color == 0);
14196         assert(d.twiddle_bg_color == 0);
14197         assert(d.twiddle_fg_bold == 0);
14198         assert(d.datacount_fg_color == 0);
14199         assert(d.datacount_bg_color == 0);
14200         assert(d.datacount_fg_bold == 0);
14201         assert(d.throughput_label_fg_color == 0);
14202         assert(d.throughput_label_bg_color == 0);
14203         assert(d.throughput_label_fg_bold == 0);
14204         assert(d.throughput_fg_color == 0);
14205         assert(d.throughput_bg_color == 0);
14206         assert(d.throughput_fg_bold == 0);
14207         assert(d.time_label_fg_color == 0);
14208         assert(d.time_label_bg_color == 0);
14209         assert(d.time_label_fg_bold == 0);
14210         assert(d.percent_fg_color == 0);
14211         assert(d.percent_bg_color == 0);
14212         assert(d.percent_fg_bold == 0);
14213         assert(d.barbrace_fg_color == 0);
14214         assert(d.barbrace_bg_color == 0);
14215         assert(d.barbrace_fg_bold == 0);
14216         assert(d.bar_fg_color == 0);
14217         assert(d.bar_bg_color == 0);
14218         assert(d.bar_fg_bold == 0);
14219         assert(io.in == 0);
14220         assert(io.out == 1);
14221         assert(io.in_ready == 0);
14222         assert(io.out_ready == 0);
14223         assert(io.eof_in == 0);
14224         assert(io.eof_out == 0);
14225         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
14226         /* assert(io.cbuf == 0x0); */
14227         assert(io.last_read == 0);
14228         assert(io.last_write == 0);
14229         assert(io.total_read == 0);
14230         assert(io.total_write == 0);
14231         assert(io.total_size == 0);
14232         assert(io.total_size_known == 0);
14233         assert(io.timeout == 250000);
14234 
14235         assert(unlink("./test-rcfile.txt") == 0);
14236 }
14237 
14238 void test105(FILE *out)
14239 {
14240         FILE *tmp_rcfile = 0;
14241         
14242         tmp_rcfile = fopen("test-rcfile.txt", "w");
14243         assert(tmp_rcfile != 0);
14244         fprintf(tmp_rcfile, "buffer-size: .1m");
14245         fclose(tmp_rcfile);
14246 
14247         clear_errno();
14248         ioInit();
14249         displayInit();
14250 
14251 #ifdef PRINT_DEBUG
14252         print();
14253 #endif
14254         assert(d.start_time == 0);
14255         assert(d.total_time == 0);
14256         assert(d.current_time == 0);
14257         assert(d.elapsed_time == 0);
14258         assert(d.percent_complete == 0);
14259         assert(d.display_interval == 1);
14260         assert(d.overtime_flag == 0);
14261         assert(d.k == 1024);
14262         assert(d.twiddle == '-');
14263         assert(d.manual_width == 0);
14264         assert(d.screen_width_minus_one == 0);
14265         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14266         assert(d.display_datacount == 1);
14267         assert(d.display_throughput == 1);
14268         assert(d.display_time == 1);
14269         assert(d.display_percent == 1);
14270         assert(d.display_bar == 1);
14271         assert(d.display_summary == 1);
14272         assert(d.display_ansi == 0);
14273         assert(d.twiddle_fg_color == 0);
14274         assert(d.twiddle_bg_color == 0);
14275         assert(d.twiddle_fg_bold == 0);
14276         assert(d.datacount_fg_color == 0);
14277         assert(d.datacount_bg_color == 0);
14278         assert(d.datacount_fg_bold == 0);
14279         assert(d.throughput_label_fg_color == 0);
14280         assert(d.throughput_label_bg_color == 0);
14281         assert(d.throughput_label_fg_bold == 0);
14282         assert(d.throughput_fg_color == 0);
14283         assert(d.throughput_bg_color == 0);
14284         assert(d.throughput_fg_bold == 0);
14285         assert(d.time_label_fg_color == 0);
14286         assert(d.time_label_bg_color == 0);
14287         assert(d.time_label_fg_bold == 0);
14288         assert(d.percent_fg_color == 0);
14289         assert(d.percent_bg_color == 0);
14290         assert(d.percent_fg_bold == 0);
14291         assert(d.barbrace_fg_color == 0);
14292         assert(d.barbrace_bg_color == 0);
14293         assert(d.barbrace_fg_bold == 0);
14294         assert(d.bar_fg_color == 0);
14295         assert(d.bar_bg_color == 0);
14296         assert(d.bar_fg_bold == 0);
14297         assert(io.in == 0);
14298         assert(io.out == 1);
14299         assert(io.in_ready == 0);
14300         assert(io.out_ready == 0);
14301         assert(io.eof_in == 0);
14302         assert(io.eof_out == 0);
14303         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
14304         /* assert(io.cbuf == 0x0); */
14305         assert(io.last_read == 0);
14306         assert(io.last_write == 0);
14307         assert(io.total_read == 0);
14308         assert(io.total_write == 0);
14309         assert(io.total_size == 0);
14310         assert(io.total_size_known == 0);
14311         assert(io.timeout == 250000);
14312 
14313         assert(test_parse_rc(out,0));
14314 
14315 #ifdef PRINT_DEBUG
14316         print();
14317 #endif
14318         assert(d.start_time == 0);
14319         assert(d.total_time == 0);
14320         assert(d.current_time == 0);
14321         assert(d.elapsed_time == 0);
14322         assert(d.percent_complete == 0);
14323         assert(d.display_interval == 1);
14324         assert(d.overtime_flag == 0);
14325         assert(d.k == 1024);
14326         assert(d.twiddle == '-');
14327         assert(d.manual_width == 0);
14328         assert(d.screen_width_minus_one == 0);
14329         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14330         assert(d.display_datacount == 1);
14331         assert(d.display_throughput == 1);
14332         assert(d.display_time == 1);
14333         assert(d.display_percent == 1);
14334         assert(d.display_bar == 1);
14335         assert(d.display_summary == 1);
14336         assert(d.display_ansi == 0);
14337         assert(d.twiddle_fg_color == 0);
14338         assert(d.twiddle_bg_color == 0);
14339         assert(d.twiddle_fg_bold == 0);
14340         assert(d.datacount_fg_color == 0);
14341         assert(d.datacount_bg_color == 0);
14342         assert(d.datacount_fg_bold == 0);
14343         assert(d.throughput_label_fg_color == 0);
14344         assert(d.throughput_label_bg_color == 0);
14345         assert(d.throughput_label_fg_bold == 0);
14346         assert(d.throughput_fg_color == 0);
14347         assert(d.throughput_bg_color == 0);
14348         assert(d.throughput_fg_bold == 0);
14349         assert(d.time_label_fg_color == 0);
14350         assert(d.time_label_bg_color == 0);
14351         assert(d.time_label_fg_bold == 0);
14352         assert(d.percent_fg_color == 0);
14353         assert(d.percent_bg_color == 0);
14354         assert(d.percent_fg_bold == 0);
14355         assert(d.barbrace_fg_color == 0);
14356         assert(d.barbrace_bg_color == 0);
14357         assert(d.barbrace_fg_bold == 0);
14358         assert(d.bar_fg_color == 0);
14359         assert(d.bar_bg_color == 0);
14360         assert(d.bar_fg_bold == 0);
14361         assert(io.in == 0);
14362         assert(io.out == 1);
14363         assert(io.in_ready == 0);
14364         assert(io.out_ready == 0);
14365         assert(io.eof_in == 0);
14366         assert(io.eof_out == 0);
14367         assert(io.buffer_size == 104858);
14368         /* assert(io.cbuf == 0x0); */
14369         assert(io.last_read == 0);
14370         assert(io.last_write == 0);
14371         assert(io.total_read == 0);
14372         assert(io.total_write == 0);
14373         assert(io.total_size == 0);
14374         assert(io.total_size_known == 0);
14375         assert(io.timeout == 250000);
14376 
14377         assert(unlink("./test-rcfile.txt") == 0);
14378 }
14379 
14380 void test106(FILE *out)
14381 {
14382         FILE *tmp_rcfile = 0;
14383         
14384         tmp_rcfile = fopen("test-rcfile.txt", "w");
14385         assert(tmp_rcfile != 0);
14386         fprintf(tmp_rcfile, "buffer-size: .10m");
14387         fclose(tmp_rcfile);
14388 
14389         clear_errno();
14390         ioInit();
14391         displayInit();
14392 
14393 #ifdef PRINT_DEBUG
14394         print();
14395 #endif
14396         assert(d.start_time == 0);
14397         assert(d.total_time == 0);
14398         assert(d.current_time == 0);
14399         assert(d.elapsed_time == 0);
14400         assert(d.percent_complete == 0);
14401         assert(d.display_interval == 1);
14402         assert(d.overtime_flag == 0);
14403         assert(d.k == 1024);
14404         assert(d.twiddle == '-');
14405         assert(d.manual_width == 0);
14406         assert(d.screen_width_minus_one == 0);
14407         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14408         assert(d.display_datacount == 1);
14409         assert(d.display_throughput == 1);
14410         assert(d.display_time == 1);
14411         assert(d.display_percent == 1);
14412         assert(d.display_bar == 1);
14413         assert(d.display_summary == 1);
14414         assert(d.display_ansi == 0);
14415         assert(d.twiddle_fg_color == 0);
14416         assert(d.twiddle_bg_color == 0);
14417         assert(d.twiddle_fg_bold == 0);
14418         assert(d.datacount_fg_color == 0);
14419         assert(d.datacount_bg_color == 0);
14420         assert(d.datacount_fg_bold == 0);
14421         assert(d.throughput_label_fg_color == 0);
14422         assert(d.throughput_label_bg_color == 0);
14423         assert(d.throughput_label_fg_bold == 0);
14424         assert(d.throughput_fg_color == 0);
14425         assert(d.throughput_bg_color == 0);
14426         assert(d.throughput_fg_bold == 0);
14427         assert(d.time_label_fg_color == 0);
14428         assert(d.time_label_bg_color == 0);
14429         assert(d.time_label_fg_bold == 0);
14430         assert(d.percent_fg_color == 0);
14431         assert(d.percent_bg_color == 0);
14432         assert(d.percent_fg_bold == 0);
14433         assert(d.barbrace_fg_color == 0);
14434         assert(d.barbrace_bg_color == 0);
14435         assert(d.barbrace_fg_bold == 0);
14436         assert(d.bar_fg_color == 0);
14437         assert(d.bar_bg_color == 0);
14438         assert(d.bar_fg_bold == 0);
14439         assert(io.in == 0);
14440         assert(io.out == 1);
14441         assert(io.in_ready == 0);
14442         assert(io.out_ready == 0);
14443         assert(io.eof_in == 0);
14444         assert(io.eof_out == 0);
14445         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
14446         /* assert(io.cbuf == 0x0); */
14447         assert(io.last_read == 0);
14448         assert(io.last_write == 0);
14449         assert(io.total_read == 0);
14450         assert(io.total_write == 0);
14451         assert(io.total_size == 0);
14452         assert(io.total_size_known == 0);
14453         assert(io.timeout == 250000);
14454 
14455         assert(test_parse_rc(out,0));
14456 
14457 #ifdef PRINT_DEBUG
14458         print();
14459 #endif
14460         assert(d.start_time == 0);
14461         assert(d.total_time == 0);
14462         assert(d.current_time == 0);
14463         assert(d.elapsed_time == 0);
14464         assert(d.percent_complete == 0);
14465         assert(d.display_interval == 1);
14466         assert(d.overtime_flag == 0);
14467         assert(d.k == 1024);
14468         assert(d.twiddle == '-');
14469         assert(d.manual_width == 0);
14470         assert(d.screen_width_minus_one == 0);
14471         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14472         assert(d.display_datacount == 1);
14473         assert(d.display_throughput == 1);
14474         assert(d.display_time == 1);
14475         assert(d.display_percent == 1);
14476         assert(d.display_bar == 1);
14477         assert(d.display_summary == 1);
14478         assert(d.display_ansi == 0);
14479         assert(d.twiddle_fg_color == 0);
14480         assert(d.twiddle_bg_color == 0);
14481         assert(d.twiddle_fg_bold == 0);
14482         assert(d.datacount_fg_color == 0);
14483         assert(d.datacount_bg_color == 0);
14484         assert(d.datacount_fg_bold == 0);
14485         assert(d.throughput_label_fg_color == 0);
14486         assert(d.throughput_label_bg_color == 0);
14487         assert(d.throughput_label_fg_bold == 0);
14488         assert(d.throughput_fg_color == 0);
14489         assert(d.throughput_bg_color == 0);
14490         assert(d.throughput_fg_bold == 0);
14491         assert(d.time_label_fg_color == 0);
14492         assert(d.time_label_bg_color == 0);
14493         assert(d.time_label_fg_bold == 0);
14494         assert(d.percent_fg_color == 0);
14495         assert(d.percent_bg_color == 0);
14496         assert(d.percent_fg_bold == 0);
14497         assert(d.barbrace_fg_color == 0);
14498         assert(d.barbrace_bg_color == 0);
14499         assert(d.barbrace_fg_bold == 0);
14500         assert(d.bar_fg_color == 0);
14501         assert(d.bar_bg_color == 0);
14502         assert(d.bar_fg_bold == 0);
14503         assert(io.in == 0);
14504         assert(io.out == 1);
14505         assert(io.in_ready == 0);
14506         assert(io.out_ready == 0);
14507         assert(io.eof_in == 0);
14508         assert(io.eof_out == 0);
14509         assert(io.buffer_size == 104858);
14510         /* assert(io.cbuf == 0x0); */
14511         assert(io.last_read == 0);
14512         assert(io.last_write == 0);
14513         assert(io.total_read == 0);
14514         assert(io.total_write == 0);
14515         assert(io.total_size == 0);
14516         assert(io.total_size_known == 0);
14517         assert(io.timeout == 250000);
14518 
14519         assert(unlink("./test-rcfile.txt") == 0);
14520 }
14521 
14522 void test107(FILE *out)
14523 {
14524         FILE *tmp_rcfile = 0;
14525         
14526         tmp_rcfile = fopen("test-rcfile.txt", "w");
14527         assert(tmp_rcfile != 0);
14528         fprintf(tmp_rcfile, "buffer-size: 1024.38m");
14529         fclose(tmp_rcfile);
14530 
14531         clear_errno();
14532         ioInit();
14533         displayInit();
14534 
14535 #ifdef PRINT_DEBUG
14536         print();
14537 #endif
14538         assert(d.start_time == 0);
14539         assert(d.total_time == 0);
14540         assert(d.current_time == 0);
14541         assert(d.elapsed_time == 0);
14542         assert(d.percent_complete == 0);
14543         assert(d.display_interval == 1);
14544         assert(d.overtime_flag == 0);
14545         assert(d.k == 1024);
14546         assert(d.twiddle == '-');
14547         assert(d.manual_width == 0);
14548         assert(d.screen_width_minus_one == 0);
14549         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14550         assert(d.display_datacount == 1);
14551         assert(d.display_throughput == 1);
14552         assert(d.display_time == 1);
14553         assert(d.display_percent == 1);
14554         assert(d.display_bar == 1);
14555         assert(d.display_summary == 1);
14556         assert(d.display_ansi == 0);
14557         assert(d.twiddle_fg_color == 0);
14558         assert(d.twiddle_bg_color == 0);
14559         assert(d.twiddle_fg_bold == 0);
14560         assert(d.datacount_fg_color == 0);
14561         assert(d.datacount_bg_color == 0);
14562         assert(d.datacount_fg_bold == 0);
14563         assert(d.throughput_label_fg_color == 0);
14564         assert(d.throughput_label_bg_color == 0);
14565         assert(d.throughput_label_fg_bold == 0);
14566         assert(d.throughput_fg_color == 0);
14567         assert(d.throughput_bg_color == 0);
14568         assert(d.throughput_fg_bold == 0);
14569         assert(d.time_label_fg_color == 0);
14570         assert(d.time_label_bg_color == 0);
14571         assert(d.time_label_fg_bold == 0);
14572         assert(d.percent_fg_color == 0);
14573         assert(d.percent_bg_color == 0);
14574         assert(d.percent_fg_bold == 0);
14575         assert(d.barbrace_fg_color == 0);
14576         assert(d.barbrace_bg_color == 0);
14577         assert(d.barbrace_fg_bold == 0);
14578         assert(d.bar_fg_color == 0);
14579         assert(d.bar_bg_color == 0);
14580         assert(d.bar_fg_bold == 0);
14581         assert(io.in == 0);
14582         assert(io.out == 1);
14583         assert(io.in_ready == 0);
14584         assert(io.out_ready == 0);
14585         assert(io.eof_in == 0);
14586         assert(io.eof_out == 0);
14587         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
14588         /* assert(io.cbuf == 0x0); */
14589         assert(io.last_read == 0);
14590         assert(io.last_write == 0);
14591         assert(io.total_read == 0);
14592         assert(io.total_write == 0);
14593         assert(io.total_size == 0);
14594         assert(io.total_size_known == 0);
14595         assert(io.timeout == 250000);
14596 
14597         assert(test_parse_rc(out,0));
14598 
14599 #ifdef PRINT_DEBUG
14600         print();
14601 #endif
14602         assert(d.start_time == 0);
14603         assert(d.total_time == 0);
14604         assert(d.current_time == 0);
14605         assert(d.elapsed_time == 0);
14606         assert(d.percent_complete == 0);
14607         assert(d.display_interval == 1);
14608         assert(d.overtime_flag == 0);
14609         assert(d.k == 1024);
14610         assert(d.twiddle == '-');
14611         assert(d.manual_width == 0);
14612         assert(d.screen_width_minus_one == 0);
14613         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14614         assert(d.display_datacount == 1);
14615         assert(d.display_throughput == 1);
14616         assert(d.display_time == 1);
14617         assert(d.display_percent == 1);
14618         assert(d.display_bar == 1);
14619         assert(d.display_summary == 1);
14620         assert(d.display_ansi == 0);
14621         assert(d.twiddle_fg_color == 0);
14622         assert(d.twiddle_bg_color == 0);
14623         assert(d.twiddle_fg_bold == 0);
14624         assert(d.datacount_fg_color == 0);
14625         assert(d.datacount_bg_color == 0);
14626         assert(d.datacount_fg_bold == 0);
14627         assert(d.throughput_label_fg_color == 0);
14628         assert(d.throughput_label_bg_color == 0);
14629         assert(d.throughput_label_fg_bold == 0);
14630         assert(d.throughput_fg_color == 0);
14631         assert(d.throughput_bg_color == 0);
14632         assert(d.throughput_fg_bold == 0);
14633         assert(d.time_label_fg_color == 0);
14634         assert(d.time_label_bg_color == 0);
14635         assert(d.time_label_fg_bold == 0);
14636         assert(d.percent_fg_color == 0);
14637         assert(d.percent_bg_color == 0);
14638         assert(d.percent_fg_bold == 0);
14639         assert(d.barbrace_fg_color == 0);
14640         assert(d.barbrace_bg_color == 0);
14641         assert(d.barbrace_fg_bold == 0);
14642         assert(d.bar_fg_color == 0);
14643         assert(d.bar_bg_color == 0);
14644         assert(d.bar_fg_bold == 0);
14645         assert(io.in == 0);
14646         assert(io.out == 1);
14647         assert(io.in_ready == 0);
14648         assert(io.out_ready == 0);
14649         assert(io.eof_in == 0);
14650         assert(io.eof_out == 0);
14651         assert(io.buffer_size == 1074140283);
14652         /* assert(io.cbuf == 0x0); */
14653         assert(io.last_read == 0);
14654         assert(io.last_write == 0);
14655         assert(io.total_read == 0);
14656         assert(io.total_write == 0);
14657         assert(io.total_size == 0);
14658         assert(io.total_size_known == 0);
14659         assert(io.timeout == 250000);
14660 
14661         assert(unlink("./test-rcfile.txt") == 0);
14662 }
14663 
14664 void test108(FILE *out)
14665 {
14666         FILE *tmp_rcfile = 0;
14667         
14668         tmp_rcfile = fopen("test-rcfile.txt", "w");
14669         assert(tmp_rcfile != 0);
14670         fprintf(tmp_rcfile, "buffer-size: 1024.380m");
14671         fclose(tmp_rcfile);
14672 
14673         clear_errno();
14674         ioInit();
14675         displayInit();
14676 
14677 #ifdef PRINT_DEBUG
14678         print();
14679 #endif
14680         assert(d.start_time == 0);
14681         assert(d.total_time == 0);
14682         assert(d.current_time == 0);
14683         assert(d.elapsed_time == 0);
14684         assert(d.percent_complete == 0);
14685         assert(d.display_interval == 1);
14686         assert(d.overtime_flag == 0);
14687         assert(d.k == 1024);
14688         assert(d.twiddle == '-');
14689         assert(d.manual_width == 0);
14690         assert(d.screen_width_minus_one == 0);
14691         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14692         assert(d.display_datacount == 1);
14693         assert(d.display_throughput == 1);
14694         assert(d.display_time == 1);
14695         assert(d.display_percent == 1);
14696         assert(d.display_bar == 1);
14697         assert(d.display_summary == 1);
14698         assert(d.display_ansi == 0);
14699         assert(d.twiddle_fg_color == 0);
14700         assert(d.twiddle_bg_color == 0);
14701         assert(d.twiddle_fg_bold == 0);
14702         assert(d.datacount_fg_color == 0);
14703         assert(d.datacount_bg_color == 0);
14704         assert(d.datacount_fg_bold == 0);
14705         assert(d.throughput_label_fg_color == 0);
14706         assert(d.throughput_label_bg_color == 0);
14707         assert(d.throughput_label_fg_bold == 0);
14708         assert(d.throughput_fg_color == 0);
14709         assert(d.throughput_bg_color == 0);
14710         assert(d.throughput_fg_bold == 0);
14711         assert(d.time_label_fg_color == 0);
14712         assert(d.time_label_bg_color == 0);
14713         assert(d.time_label_fg_bold == 0);
14714         assert(d.percent_fg_color == 0);
14715         assert(d.percent_bg_color == 0);
14716         assert(d.percent_fg_bold == 0);
14717         assert(d.barbrace_fg_color == 0);
14718         assert(d.barbrace_bg_color == 0);
14719         assert(d.barbrace_fg_bold == 0);
14720         assert(d.bar_fg_color == 0);
14721         assert(d.bar_bg_color == 0);
14722         assert(d.bar_fg_bold == 0);
14723         assert(io.in == 0);
14724         assert(io.out == 1);
14725         assert(io.in_ready == 0);
14726         assert(io.out_ready == 0);
14727         assert(io.eof_in == 0);
14728         assert(io.eof_out == 0);
14729         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
14730         /* assert(io.cbuf == 0x0); */
14731         assert(io.last_read == 0);
14732         assert(io.last_write == 0);
14733         assert(io.total_read == 0);
14734         assert(io.total_write == 0);
14735         assert(io.total_size == 0);
14736         assert(io.total_size_known == 0);
14737         assert(io.timeout == 250000);
14738 
14739         assert(test_parse_rc(out,0));
14740 
14741 #ifdef PRINT_DEBUG
14742         print();
14743 #endif
14744         assert(d.start_time == 0);
14745         assert(d.total_time == 0);
14746         assert(d.current_time == 0);
14747         assert(d.elapsed_time == 0);
14748         assert(d.percent_complete == 0);
14749         assert(d.display_interval == 1);
14750         assert(d.overtime_flag == 0);
14751         assert(d.k == 1024);
14752         assert(d.twiddle == '-');
14753         assert(d.manual_width == 0);
14754         assert(d.screen_width_minus_one == 0);
14755         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14756         assert(d.display_datacount == 1);
14757         assert(d.display_throughput == 1);
14758         assert(d.display_time == 1);
14759         assert(d.display_percent == 1);
14760         assert(d.display_bar == 1);
14761         assert(d.display_summary == 1);
14762         assert(d.display_ansi == 0);
14763         assert(d.twiddle_fg_color == 0);
14764         assert(d.twiddle_bg_color == 0);
14765         assert(d.twiddle_fg_bold == 0);
14766         assert(d.datacount_fg_color == 0);
14767         assert(d.datacount_bg_color == 0);
14768         assert(d.datacount_fg_bold == 0);
14769         assert(d.throughput_label_fg_color == 0);
14770         assert(d.throughput_label_bg_color == 0);
14771         assert(d.throughput_label_fg_bold == 0);
14772         assert(d.throughput_fg_color == 0);
14773         assert(d.throughput_bg_color == 0);
14774         assert(d.throughput_fg_bold == 0);
14775         assert(d.time_label_fg_color == 0);
14776         assert(d.time_label_bg_color == 0);
14777         assert(d.time_label_fg_bold == 0);
14778         assert(d.percent_fg_color == 0);
14779         assert(d.percent_bg_color == 0);
14780         assert(d.percent_fg_bold == 0);
14781         assert(d.barbrace_fg_color == 0);
14782         assert(d.barbrace_bg_color == 0);
14783         assert(d.barbrace_fg_bold == 0);
14784         assert(d.bar_fg_color == 0);
14785         assert(d.bar_bg_color == 0);
14786         assert(d.bar_fg_bold == 0);
14787         assert(io.in == 0);
14788         assert(io.out == 1);
14789         assert(io.in_ready == 0);
14790         assert(io.out_ready == 0);
14791         assert(io.eof_in == 0);
14792         assert(io.eof_out == 0);
14793         assert(io.buffer_size == 1074140283);
14794         /* assert(io.cbuf == 0x0); */
14795         assert(io.last_read == 0);
14796         assert(io.last_write == 0);
14797         assert(io.total_read == 0);
14798         assert(io.total_write == 0);
14799         assert(io.total_size == 0);
14800         assert(io.total_size_known == 0);
14801         assert(io.timeout == 250000);
14802 
14803         assert(unlink("./test-rcfile.txt") == 0);
14804 }
14805 
14806 void test109(FILE *out)
14807 {
14808         FILE *tmp_rcfile = 0;
14809         
14810         tmp_rcfile = fopen("test-rcfile.txt", "w");
14811         assert(tmp_rcfile != 0);
14812         fprintf(tmp_rcfile, "buffer-size: 1024.38002m");
14813         fclose(tmp_rcfile);
14814 
14815         clear_errno();
14816         ioInit();
14817         displayInit();
14818 
14819 #ifdef PRINT_DEBUG
14820         print();
14821 #endif
14822         assert(d.start_time == 0);
14823         assert(d.total_time == 0);
14824         assert(d.current_time == 0);
14825         assert(d.elapsed_time == 0);
14826         assert(d.percent_complete == 0);
14827         assert(d.display_interval == 1);
14828         assert(d.overtime_flag == 0);
14829         assert(d.k == 1024);
14830         assert(d.twiddle == '-');
14831         assert(d.manual_width == 0);
14832         assert(d.screen_width_minus_one == 0);
14833         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14834         assert(d.display_datacount == 1);
14835         assert(d.display_throughput == 1);
14836         assert(d.display_time == 1);
14837         assert(d.display_percent == 1);
14838         assert(d.display_bar == 1);
14839         assert(d.display_summary == 1);
14840         assert(d.display_ansi == 0);
14841         assert(d.twiddle_fg_color == 0);
14842         assert(d.twiddle_bg_color == 0);
14843         assert(d.twiddle_fg_bold == 0);
14844         assert(d.datacount_fg_color == 0);
14845         assert(d.datacount_bg_color == 0);
14846         assert(d.datacount_fg_bold == 0);
14847         assert(d.throughput_label_fg_color == 0);
14848         assert(d.throughput_label_bg_color == 0);
14849         assert(d.throughput_label_fg_bold == 0);
14850         assert(d.throughput_fg_color == 0);
14851         assert(d.throughput_bg_color == 0);
14852         assert(d.throughput_fg_bold == 0);
14853         assert(d.time_label_fg_color == 0);
14854         assert(d.time_label_bg_color == 0);
14855         assert(d.time_label_fg_bold == 0);
14856         assert(d.percent_fg_color == 0);
14857         assert(d.percent_bg_color == 0);
14858         assert(d.percent_fg_bold == 0);
14859         assert(d.barbrace_fg_color == 0);
14860         assert(d.barbrace_bg_color == 0);
14861         assert(d.barbrace_fg_bold == 0);
14862         assert(d.bar_fg_color == 0);
14863         assert(d.bar_bg_color == 0);
14864         assert(d.bar_fg_bold == 0);
14865         assert(io.in == 0);
14866         assert(io.out == 1);
14867         assert(io.in_ready == 0);
14868         assert(io.out_ready == 0);
14869         assert(io.eof_in == 0);
14870         assert(io.eof_out == 0);
14871         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
14872         /* assert(io.cbuf == 0x0); */
14873         assert(io.last_read == 0);
14874         assert(io.last_write == 0);
14875         assert(io.total_read == 0);
14876         assert(io.total_write == 0);
14877         assert(io.total_size == 0);
14878         assert(io.total_size_known == 0);
14879         assert(io.timeout == 250000);
14880 
14881         assert(test_parse_rc(out,0));
14882 
14883 #ifdef PRINT_DEBUG
14884         print();
14885 #endif
14886         assert(d.start_time == 0);
14887         assert(d.total_time == 0);
14888         assert(d.current_time == 0);
14889         assert(d.elapsed_time == 0);
14890         assert(d.percent_complete == 0);
14891         assert(d.display_interval == 1);
14892         assert(d.overtime_flag == 0);
14893         assert(d.k == 1024);
14894         assert(d.twiddle == '-');
14895         assert(d.manual_width == 0);
14896         assert(d.screen_width_minus_one == 0);
14897         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14898         assert(d.display_datacount == 1);
14899         assert(d.display_throughput == 1);
14900         assert(d.display_time == 1);
14901         assert(d.display_percent == 1);
14902         assert(d.display_bar == 1);
14903         assert(d.display_summary == 1);
14904         assert(d.display_ansi == 0);
14905         assert(d.twiddle_fg_color == 0);
14906         assert(d.twiddle_bg_color == 0);
14907         assert(d.twiddle_fg_bold == 0);
14908         assert(d.datacount_fg_color == 0);
14909         assert(d.datacount_bg_color == 0);
14910         assert(d.datacount_fg_bold == 0);
14911         assert(d.throughput_label_fg_color == 0);
14912         assert(d.throughput_label_bg_color == 0);
14913         assert(d.throughput_label_fg_bold == 0);
14914         assert(d.throughput_fg_color == 0);
14915         assert(d.throughput_bg_color == 0);
14916         assert(d.throughput_fg_bold == 0);
14917         assert(d.time_label_fg_color == 0);
14918         assert(d.time_label_bg_color == 0);
14919         assert(d.time_label_fg_bold == 0);
14920         assert(d.percent_fg_color == 0);
14921         assert(d.percent_bg_color == 0);
14922         assert(d.percent_fg_bold == 0);
14923         assert(d.barbrace_fg_color == 0);
14924         assert(d.barbrace_bg_color == 0);
14925         assert(d.barbrace_fg_bold == 0);
14926         assert(d.bar_fg_color == 0);
14927         assert(d.bar_bg_color == 0);
14928         assert(d.bar_fg_bold == 0);
14929         assert(io.in == 0);
14930         assert(io.out == 1);
14931         assert(io.in_ready == 0);
14932         assert(io.out_ready == 0);
14933         assert(io.eof_in == 0);
14934         assert(io.eof_out == 0);
14935         assert(io.buffer_size == 1074140304);
14936         /* assert(io.cbuf == 0x0); */
14937         assert(io.last_read == 0);
14938         assert(io.last_write == 0);
14939         assert(io.total_read == 0);
14940         assert(io.total_write == 0);
14941         assert(io.total_size == 0);
14942         assert(io.total_size_known == 0);
14943         assert(io.timeout == 250000);
14944 
14945         assert(unlink("./test-rcfile.txt") == 0);
14946 }
14947 
14948 void test110(FILE *out)
14949 {
14950 #if SIZEOF_SIZE_T == 8
14951         uint64 e;
14952 #endif
14953         FILE *tmp_rcfile = 0;
14954         
14955         tmp_rcfile = fopen("test-rcfile.txt", "w");
14956         assert(tmp_rcfile != 0);
14957         fprintf(tmp_rcfile, "buffer-size: 18446744073709551615");
14958         fclose(tmp_rcfile);
14959 
14960         clear_errno();
14961         ioInit();
14962         displayInit();
14963 
14964 #ifdef PRINT_DEBUG
14965         print();
14966 #endif
14967         assert(d.start_time == 0);
14968         assert(d.total_time == 0);
14969         assert(d.current_time == 0);
14970         assert(d.elapsed_time == 0);
14971         assert(d.percent_complete == 0);
14972         assert(d.display_interval == 1);
14973         assert(d.overtime_flag == 0);
14974         assert(d.k == 1024);
14975         assert(d.twiddle == '-');
14976         assert(d.manual_width == 0);
14977         assert(d.screen_width_minus_one == 0);
14978         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
14979         assert(d.display_datacount == 1);
14980         assert(d.display_throughput == 1);
14981         assert(d.display_time == 1);
14982         assert(d.display_percent == 1);
14983         assert(d.display_bar == 1);
14984         assert(d.display_summary == 1);
14985         assert(d.display_ansi == 0);
14986         assert(d.twiddle_fg_color == 0);
14987         assert(d.twiddle_bg_color == 0);
14988         assert(d.twiddle_fg_bold == 0);
14989         assert(d.datacount_fg_color == 0);
14990         assert(d.datacount_bg_color == 0);
14991         assert(d.datacount_fg_bold == 0);
14992         assert(d.throughput_label_fg_color == 0);
14993         assert(d.throughput_label_bg_color == 0);
14994         assert(d.throughput_label_fg_bold == 0);
14995         assert(d.throughput_fg_color == 0);
14996         assert(d.throughput_bg_color == 0);
14997         assert(d.throughput_fg_bold == 0);
14998         assert(d.time_label_fg_color == 0);
14999         assert(d.time_label_bg_color == 0);
15000         assert(d.time_label_fg_bold == 0);
15001         assert(d.percent_fg_color == 0);
15002         assert(d.percent_bg_color == 0);
15003         assert(d.percent_fg_bold == 0);
15004         assert(d.barbrace_fg_color == 0);
15005         assert(d.barbrace_bg_color == 0);
15006         assert(d.barbrace_fg_bold == 0);
15007         assert(d.bar_fg_color == 0);
15008         assert(d.bar_bg_color == 0);
15009         assert(d.bar_fg_bold == 0);
15010         assert(io.in == 0);
15011         assert(io.out == 1);
15012         assert(io.in_ready == 0);
15013         assert(io.out_ready == 0);
15014         assert(io.eof_in == 0);
15015         assert(io.eof_out == 0);
15016         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15017         /* assert(io.cbuf == 0x0); */
15018         assert(io.last_read == 0);
15019         assert(io.last_write == 0);
15020         assert(io.total_read == 0);
15021         assert(io.total_write == 0);
15022         assert(io.total_size == 0);
15023         assert(io.total_size_known == 0);
15024         assert(io.timeout == 250000);
15025 
15026 #if SIZEOF_SIZE_T == 8
15027         assert(test_parse_rc(out,0));
15028 #else
15029         assert(test_parse_rc(out,1));
15030 #endif
15031 
15032 #ifdef PRINT_DEBUG
15033         print();
15034 #endif
15035         assert(d.start_time == 0);
15036         assert(d.total_time == 0);
15037         assert(d.current_time == 0);
15038         assert(d.elapsed_time == 0);
15039         assert(d.percent_complete == 0);
15040         assert(d.display_interval == 1);
15041         assert(d.overtime_flag == 0);
15042         assert(d.k == 1024);
15043         assert(d.twiddle == '-');
15044         assert(d.manual_width == 0);
15045         assert(d.screen_width_minus_one == 0);
15046         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15047         assert(d.display_datacount == 1);
15048         assert(d.display_throughput == 1);
15049         assert(d.display_time == 1);
15050         assert(d.display_percent == 1);
15051         assert(d.display_bar == 1);
15052         assert(d.display_summary == 1);
15053         assert(d.display_ansi == 0);
15054         assert(d.twiddle_fg_color == 0);
15055         assert(d.twiddle_bg_color == 0);
15056         assert(d.twiddle_fg_bold == 0);
15057         assert(d.datacount_fg_color == 0);
15058         assert(d.datacount_bg_color == 0);
15059         assert(d.datacount_fg_bold == 0);
15060         assert(d.throughput_label_fg_color == 0);
15061         assert(d.throughput_label_bg_color == 0);
15062         assert(d.throughput_label_fg_bold == 0);
15063         assert(d.throughput_fg_color == 0);
15064         assert(d.throughput_bg_color == 0);
15065         assert(d.throughput_fg_bold == 0);
15066         assert(d.time_label_fg_color == 0);
15067         assert(d.time_label_bg_color == 0);
15068         assert(d.time_label_fg_bold == 0);
15069         assert(d.percent_fg_color == 0);
15070         assert(d.percent_bg_color == 0);
15071         assert(d.percent_fg_bold == 0);
15072         assert(d.barbrace_fg_color == 0);
15073         assert(d.barbrace_bg_color == 0);
15074         assert(d.barbrace_fg_bold == 0);
15075         assert(d.bar_fg_color == 0);
15076         assert(d.bar_bg_color == 0);
15077         assert(d.bar_fg_bold == 0);
15078         assert(io.in == 0);
15079         assert(io.out == 1);
15080         assert(io.in_ready == 0);
15081         assert(io.out_ready == 0);
15082         assert(io.eof_in == 0);
15083         assert(io.eof_out == 0);
15084 #if SIZEOF_SIZE_T == 8
15085         e = 18;
15086         e *= 1000;
15087         e += 446;
15088         e *= 1000;
15089         e += 744;
15090         e *= 1000;
15091         e += 73;
15092         e *= 1000;
15093         e += 709;
15094         e *= 1000;
15095         e += 551;
15096         e *= 1000;
15097         e += 615;
15098         assert(io.buffer_size == e);
15099 #else
15100         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15101 #endif
15102         /* assert(io.cbuf == 0x0); */
15103         assert(io.last_read == 0);
15104         assert(io.last_write == 0);
15105         assert(io.total_read == 0);
15106         assert(io.total_write == 0);
15107         assert(io.total_size == 0);
15108         assert(io.total_size_known == 0);
15109         assert(io.timeout == 250000);
15110 
15111         assert(unlink("./test-rcfile.txt") == 0);
15112 }
15113 
15114 void test111(FILE *out)
15115 {
15116         uint64 e;
15117         FILE *tmp_rcfile = 0;
15118         
15119         tmp_rcfile = fopen("test-rcfile.txt", "w");
15120         assert(tmp_rcfile != 0);
15121         fprintf(tmp_rcfile, "buffer-size: 4294967295");
15122         fclose(tmp_rcfile);
15123 
15124         clear_errno();
15125         ioInit();
15126         displayInit();
15127 
15128 #ifdef PRINT_DEBUG
15129         print();
15130 #endif
15131         assert(d.start_time == 0);
15132         assert(d.total_time == 0);
15133         assert(d.current_time == 0);
15134         assert(d.elapsed_time == 0);
15135         assert(d.percent_complete == 0);
15136         assert(d.display_interval == 1);
15137         assert(d.overtime_flag == 0);
15138         assert(d.k == 1024);
15139         assert(d.twiddle == '-');
15140         assert(d.manual_width == 0);
15141         assert(d.screen_width_minus_one == 0);
15142         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15143         assert(d.display_datacount == 1);
15144         assert(d.display_throughput == 1);
15145         assert(d.display_time == 1);
15146         assert(d.display_percent == 1);
15147         assert(d.display_bar == 1);
15148         assert(d.display_summary == 1);
15149         assert(d.display_ansi == 0);
15150         assert(d.twiddle_fg_color == 0);
15151         assert(d.twiddle_bg_color == 0);
15152         assert(d.twiddle_fg_bold == 0);
15153         assert(d.datacount_fg_color == 0);
15154         assert(d.datacount_bg_color == 0);
15155         assert(d.datacount_fg_bold == 0);
15156         assert(d.throughput_label_fg_color == 0);
15157         assert(d.throughput_label_bg_color == 0);
15158         assert(d.throughput_label_fg_bold == 0);
15159         assert(d.throughput_fg_color == 0);
15160         assert(d.throughput_bg_color == 0);
15161         assert(d.throughput_fg_bold == 0);
15162         assert(d.time_label_fg_color == 0);
15163         assert(d.time_label_bg_color == 0);
15164         assert(d.time_label_fg_bold == 0);
15165         assert(d.percent_fg_color == 0);
15166         assert(d.percent_bg_color == 0);
15167         assert(d.percent_fg_bold == 0);
15168         assert(d.barbrace_fg_color == 0);
15169         assert(d.barbrace_bg_color == 0);
15170         assert(d.barbrace_fg_bold == 0);
15171         assert(d.bar_fg_color == 0);
15172         assert(d.bar_bg_color == 0);
15173         assert(d.bar_fg_bold == 0);
15174         assert(io.in == 0);
15175         assert(io.out == 1);
15176         assert(io.in_ready == 0);
15177         assert(io.out_ready == 0);
15178         assert(io.eof_in == 0);
15179         assert(io.eof_out == 0);
15180         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15181         /* assert(io.cbuf == 0x0); */
15182         assert(io.last_read == 0);
15183         assert(io.last_write == 0);
15184         assert(io.total_read == 0);
15185         assert(io.total_write == 0);
15186         assert(io.total_size == 0);
15187         assert(io.total_size_known == 0);
15188         assert(io.timeout == 250000);
15189 
15190         assert(test_parse_rc(out,0));
15191 
15192 #ifdef PRINT_DEBUG
15193         print();
15194 #endif
15195         assert(d.start_time == 0);
15196         assert(d.total_time == 0);
15197         assert(d.current_time == 0);
15198         assert(d.elapsed_time == 0);
15199         assert(d.percent_complete == 0);
15200         assert(d.display_interval == 1);
15201         assert(d.overtime_flag == 0);
15202         assert(d.k == 1024);
15203         assert(d.twiddle == '-');
15204         assert(d.manual_width == 0);
15205         assert(d.screen_width_minus_one == 0);
15206         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15207         assert(d.display_datacount == 1);
15208         assert(d.display_throughput == 1);
15209         assert(d.display_time == 1);
15210         assert(d.display_percent == 1);
15211         assert(d.display_bar == 1);
15212         assert(d.display_summary == 1);
15213         assert(d.display_ansi == 0);
15214         assert(d.twiddle_fg_color == 0);
15215         assert(d.twiddle_bg_color == 0);
15216         assert(d.twiddle_fg_bold == 0);
15217         assert(d.datacount_fg_color == 0);
15218         assert(d.datacount_bg_color == 0);
15219         assert(d.datacount_fg_bold == 0);
15220         assert(d.throughput_label_fg_color == 0);
15221         assert(d.throughput_label_bg_color == 0);
15222         assert(d.throughput_label_fg_bold == 0);
15223         assert(d.throughput_fg_color == 0);
15224         assert(d.throughput_bg_color == 0);
15225         assert(d.throughput_fg_bold == 0);
15226         assert(d.time_label_fg_color == 0);
15227         assert(d.time_label_bg_color == 0);
15228         assert(d.time_label_fg_bold == 0);
15229         assert(d.percent_fg_color == 0);
15230         assert(d.percent_bg_color == 0);
15231         assert(d.percent_fg_bold == 0);
15232         assert(d.barbrace_fg_color == 0);
15233         assert(d.barbrace_bg_color == 0);
15234         assert(d.barbrace_fg_bold == 0);
15235         assert(d.bar_fg_color == 0);
15236         assert(d.bar_bg_color == 0);
15237         assert(d.bar_fg_bold == 0);
15238         assert(io.in == 0);
15239         assert(io.out == 1);
15240         assert(io.in_ready == 0);
15241         assert(io.out_ready == 0);
15242         assert(io.eof_in == 0);
15243         assert(io.eof_out == 0);
15244         e = 4;
15245         e *= 1000;
15246         e += 294;
15247         e *= 1000;
15248         e += 967;
15249         e *= 1000;
15250         e += 295;
15251         assert(io.buffer_size == e);
15252         /* assert(io.cbuf == 0x0); */
15253         assert(io.last_read == 0);
15254         assert(io.last_write == 0);
15255         assert(io.total_read == 0);
15256         assert(io.total_write == 0);
15257         assert(io.total_size == 0);
15258         assert(io.total_size_known == 0);
15259         assert(io.timeout == 250000);
15260 
15261         assert(unlink("./test-rcfile.txt") == 0);
15262 }
15263 
15264 void test112(FILE *out)
15265 {
15266         FILE *tmp_rcfile = 0;
15267         
15268         tmp_rcfile = fopen("test-rcfile.txt", "w");
15269         assert(tmp_rcfile != 0);
15270         fprintf(tmp_rcfile, "buffer-size: 3.019933546896392720878322259136212624584717607973421926910299003322259136212624g");
15271         fclose(tmp_rcfile);
15272 
15273         clear_errno();
15274         ioInit();
15275         displayInit();
15276 
15277 #ifdef PRINT_DEBUG
15278         print();
15279 #endif
15280         assert(d.start_time == 0);
15281         assert(d.total_time == 0);
15282         assert(d.current_time == 0);
15283         assert(d.elapsed_time == 0);
15284         assert(d.percent_complete == 0);
15285         assert(d.display_interval == 1);
15286         assert(d.overtime_flag == 0);
15287         assert(d.k == 1024);
15288         assert(d.twiddle == '-');
15289         assert(d.manual_width == 0);
15290         assert(d.screen_width_minus_one == 0);
15291         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15292         assert(d.display_datacount == 1);
15293         assert(d.display_throughput == 1);
15294         assert(d.display_time == 1);
15295         assert(d.display_percent == 1);
15296         assert(d.display_bar == 1);
15297         assert(d.display_summary == 1);
15298         assert(d.display_ansi == 0);
15299         assert(d.twiddle_fg_color == 0);
15300         assert(d.twiddle_bg_color == 0);
15301         assert(d.twiddle_fg_bold == 0);
15302         assert(d.datacount_fg_color == 0);
15303         assert(d.datacount_bg_color == 0);
15304         assert(d.datacount_fg_bold == 0);
15305         assert(d.throughput_label_fg_color == 0);
15306         assert(d.throughput_label_bg_color == 0);
15307         assert(d.throughput_label_fg_bold == 0);
15308         assert(d.throughput_fg_color == 0);
15309         assert(d.throughput_bg_color == 0);
15310         assert(d.throughput_fg_bold == 0);
15311         assert(d.time_label_fg_color == 0);
15312         assert(d.time_label_bg_color == 0);
15313         assert(d.time_label_fg_bold == 0);
15314         assert(d.percent_fg_color == 0);
15315         assert(d.percent_bg_color == 0);
15316         assert(d.percent_fg_bold == 0);
15317         assert(d.barbrace_fg_color == 0);
15318         assert(d.barbrace_bg_color == 0);
15319         assert(d.barbrace_fg_bold == 0);
15320         assert(d.bar_fg_color == 0);
15321         assert(d.bar_bg_color == 0);
15322         assert(d.bar_fg_bold == 0);
15323         assert(io.in == 0);
15324         assert(io.out == 1);
15325         assert(io.in_ready == 0);
15326         assert(io.out_ready == 0);
15327         assert(io.eof_in == 0);
15328         assert(io.eof_out == 0);
15329         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15330         /* assert(io.cbuf == 0x0); */
15331         assert(io.last_read == 0);
15332         assert(io.last_write == 0);
15333         assert(io.total_read == 0);
15334         assert(io.total_write == 0);
15335         assert(io.total_size == 0);
15336         assert(io.total_size_known == 0);
15337         assert(io.timeout == 250000);
15338 
15339         assert(test_parse_rc(out,1));
15340 
15341 #ifdef PRINT_DEBUG
15342         print();
15343 #endif
15344         assert(d.start_time == 0);
15345         assert(d.total_time == 0);
15346         assert(d.current_time == 0);
15347         assert(d.elapsed_time == 0);
15348         assert(d.percent_complete == 0);
15349         assert(d.display_interval == 1);
15350         assert(d.overtime_flag == 0);
15351         assert(d.k == 1024);
15352         assert(d.twiddle == '-');
15353         assert(d.manual_width == 0);
15354         assert(d.screen_width_minus_one == 0);
15355         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15356         assert(d.display_datacount == 1);
15357         assert(d.display_throughput == 1);
15358         assert(d.display_time == 1);
15359         assert(d.display_percent == 1);
15360         assert(d.display_bar == 1);
15361         assert(d.display_summary == 1);
15362         assert(d.display_ansi == 0);
15363         assert(d.twiddle_fg_color == 0);
15364         assert(d.twiddle_bg_color == 0);
15365         assert(d.twiddle_fg_bold == 0);
15366         assert(d.datacount_fg_color == 0);
15367         assert(d.datacount_bg_color == 0);
15368         assert(d.datacount_fg_bold == 0);
15369         assert(d.throughput_label_fg_color == 0);
15370         assert(d.throughput_label_bg_color == 0);
15371         assert(d.throughput_label_fg_bold == 0);
15372         assert(d.throughput_fg_color == 0);
15373         assert(d.throughput_bg_color == 0);
15374         assert(d.throughput_fg_bold == 0);
15375         assert(d.time_label_fg_color == 0);
15376         assert(d.time_label_bg_color == 0);
15377         assert(d.time_label_fg_bold == 0);
15378         assert(d.percent_fg_color == 0);
15379         assert(d.percent_bg_color == 0);
15380         assert(d.percent_fg_bold == 0);
15381         assert(d.barbrace_fg_color == 0);
15382         assert(d.barbrace_bg_color == 0);
15383         assert(d.barbrace_fg_bold == 0);
15384         assert(d.bar_fg_color == 0);
15385         assert(d.bar_bg_color == 0);
15386         assert(d.bar_fg_bold == 0);
15387         assert(io.in == 0);
15388         assert(io.out == 1);
15389         assert(io.in_ready == 0);
15390         assert(io.out_ready == 0);
15391         assert(io.eof_in == 0);
15392         assert(io.eof_out == 0);
15393         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15394         /* assert(io.cbuf == 0x0); */
15395         assert(io.last_read == 0);
15396         assert(io.last_write == 0);
15397         assert(io.total_read == 0);
15398         assert(io.total_write == 0);
15399         assert(io.total_size == 0);
15400         assert(io.total_size_known == 0);
15401         assert(io.timeout == 250000);
15402 
15403         assert(unlink("./test-rcfile.txt") == 0);
15404 }
15405 
15406 void test113(FILE *out)
15407 {
15408         uint64 e;
15409         FILE *tmp_rcfile = 0;
15410         
15411         tmp_rcfile = fopen("test-rcfile.txt", "w");
15412         assert(tmp_rcfile != 0);
15413         fprintf(tmp_rcfile, "buffer-size: 3.0199335468963927208783222591362126245847176079734219269102990033222591362126g");
15414         fclose(tmp_rcfile);
15415 
15416         clear_errno();
15417         ioInit();
15418         displayInit();
15419 
15420 #ifdef PRINT_DEBUG
15421         print();
15422 #endif
15423         assert(d.start_time == 0);
15424         assert(d.total_time == 0);
15425         assert(d.current_time == 0);
15426         assert(d.elapsed_time == 0);
15427         assert(d.percent_complete == 0);
15428         assert(d.display_interval == 1);
15429         assert(d.overtime_flag == 0);
15430         assert(d.k == 1024);
15431         assert(d.twiddle == '-');
15432         assert(d.manual_width == 0);
15433         assert(d.screen_width_minus_one == 0);
15434         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15435         assert(d.display_datacount == 1);
15436         assert(d.display_throughput == 1);
15437         assert(d.display_time == 1);
15438         assert(d.display_percent == 1);
15439         assert(d.display_bar == 1);
15440         assert(d.display_summary == 1);
15441         assert(d.display_ansi == 0);
15442         assert(d.twiddle_fg_color == 0);
15443         assert(d.twiddle_bg_color == 0);
15444         assert(d.twiddle_fg_bold == 0);
15445         assert(d.datacount_fg_color == 0);
15446         assert(d.datacount_bg_color == 0);
15447         assert(d.datacount_fg_bold == 0);
15448         assert(d.throughput_label_fg_color == 0);
15449         assert(d.throughput_label_bg_color == 0);
15450         assert(d.throughput_label_fg_bold == 0);
15451         assert(d.throughput_fg_color == 0);
15452         assert(d.throughput_bg_color == 0);
15453         assert(d.throughput_fg_bold == 0);
15454         assert(d.time_label_fg_color == 0);
15455         assert(d.time_label_bg_color == 0);
15456         assert(d.time_label_fg_bold == 0);
15457         assert(d.percent_fg_color == 0);
15458         assert(d.percent_bg_color == 0);
15459         assert(d.percent_fg_bold == 0);
15460         assert(d.barbrace_fg_color == 0);
15461         assert(d.barbrace_bg_color == 0);
15462         assert(d.barbrace_fg_bold == 0);
15463         assert(d.bar_fg_color == 0);
15464         assert(d.bar_bg_color == 0);
15465         assert(d.bar_fg_bold == 0);
15466         assert(io.in == 0);
15467         assert(io.out == 1);
15468         assert(io.in_ready == 0);
15469         assert(io.out_ready == 0);
15470         assert(io.eof_in == 0);
15471         assert(io.eof_out == 0);
15472         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15473         /* assert(io.cbuf == 0x0); */
15474         assert(io.last_read == 0);
15475         assert(io.last_write == 0);
15476         assert(io.total_read == 0);
15477         assert(io.total_write == 0);
15478         assert(io.total_size == 0);
15479         assert(io.total_size_known == 0);
15480         assert(io.timeout == 250000);
15481 
15482         assert(test_parse_rc(out,0));
15483 
15484 #ifdef PRINT_DEBUG
15485         print();
15486 #endif
15487         assert(d.start_time == 0);
15488         assert(d.total_time == 0);
15489         assert(d.current_time == 0);
15490         assert(d.elapsed_time == 0);
15491         assert(d.percent_complete == 0);
15492         assert(d.display_interval == 1);
15493         assert(d.overtime_flag == 0);
15494         assert(d.k == 1024);
15495         assert(d.twiddle == '-');
15496         assert(d.manual_width == 0);
15497         assert(d.screen_width_minus_one == 0);
15498         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15499         assert(d.display_datacount == 1);
15500         assert(d.display_throughput == 1);
15501         assert(d.display_time == 1);
15502         assert(d.display_percent == 1);
15503         assert(d.display_bar == 1);
15504         assert(d.display_summary == 1);
15505         assert(d.display_ansi == 0);
15506         assert(d.twiddle_fg_color == 0);
15507         assert(d.twiddle_bg_color == 0);
15508         assert(d.twiddle_fg_bold == 0);
15509         assert(d.datacount_fg_color == 0);
15510         assert(d.datacount_bg_color == 0);
15511         assert(d.datacount_fg_bold == 0);
15512         assert(d.throughput_label_fg_color == 0);
15513         assert(d.throughput_label_bg_color == 0);
15514         assert(d.throughput_label_fg_bold == 0);
15515         assert(d.throughput_fg_color == 0);
15516         assert(d.throughput_bg_color == 0);
15517         assert(d.throughput_fg_bold == 0);
15518         assert(d.time_label_fg_color == 0);
15519         assert(d.time_label_bg_color == 0);
15520         assert(d.time_label_fg_bold == 0);
15521         assert(d.percent_fg_color == 0);
15522         assert(d.percent_bg_color == 0);
15523         assert(d.percent_fg_bold == 0);
15524         assert(d.barbrace_fg_color == 0);
15525         assert(d.barbrace_bg_color == 0);
15526         assert(d.barbrace_fg_bold == 0);
15527         assert(d.bar_fg_color == 0);
15528         assert(d.bar_bg_color == 0);
15529         assert(d.bar_fg_bold == 0);
15530         assert(io.in == 0);
15531         assert(io.out == 1);
15532         assert(io.in_ready == 0);
15533         assert(io.out_ready == 0);
15534         assert(io.eof_in == 0);
15535         assert(io.eof_out == 0);
15536         e = 3;
15537         e *= 1000;
15538         e += 242;
15539         e *= 1000;
15540         e += 628;
15541         e *= 1000;
15542         e += 954;
15543         assert(io.buffer_size == e);
15544         /* assert(io.cbuf == 0x0); */
15545         assert(io.last_read == 0);
15546         assert(io.last_write == 0);
15547         assert(io.total_read == 0);
15548         assert(io.total_write == 0);
15549         assert(io.total_size == 0);
15550         assert(io.total_size_known == 0);
15551         assert(io.timeout == 250000);
15552 
15553         assert(unlink("./test-rcfile.txt") == 0);
15554 }
15555 
15556 void test114(FILE *out)
15557 {
15558         FILE *tmp_rcfile = 0;
15559         
15560         tmp_rcfile = fopen("test-rcfile.txt", "w");
15561         assert(tmp_rcfile != 0);
15562         fprintf(tmp_rcfile, "interval: 5");
15563         fclose(tmp_rcfile);
15564 
15565         clear_errno();
15566         ioInit();
15567         displayInit();
15568 
15569 #ifdef PRINT_DEBUG
15570         print();
15571 #endif
15572         assert(d.start_time == 0);
15573         assert(d.total_time == 0);
15574         assert(d.current_time == 0);
15575         assert(d.elapsed_time == 0);
15576         assert(d.percent_complete == 0);
15577         assert(d.display_interval == 1);
15578         assert(d.overtime_flag == 0);
15579         assert(d.k == 1024);
15580         assert(d.twiddle == '-');
15581         assert(d.manual_width == 0);
15582         assert(d.screen_width_minus_one == 0);
15583         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15584         assert(d.display_datacount == 1);
15585         assert(d.display_throughput == 1);
15586         assert(d.display_time == 1);
15587         assert(d.display_percent == 1);
15588         assert(d.display_bar == 1);
15589         assert(d.display_summary == 1);
15590         assert(d.display_ansi == 0);
15591         assert(d.twiddle_fg_color == 0);
15592         assert(d.twiddle_bg_color == 0);
15593         assert(d.twiddle_fg_bold == 0);
15594         assert(d.datacount_fg_color == 0);
15595         assert(d.datacount_bg_color == 0);
15596         assert(d.datacount_fg_bold == 0);
15597         assert(d.throughput_label_fg_color == 0);
15598         assert(d.throughput_label_bg_color == 0);
15599         assert(d.throughput_label_fg_bold == 0);
15600         assert(d.throughput_fg_color == 0);
15601         assert(d.throughput_bg_color == 0);
15602         assert(d.throughput_fg_bold == 0);
15603         assert(d.time_label_fg_color == 0);
15604         assert(d.time_label_bg_color == 0);
15605         assert(d.time_label_fg_bold == 0);
15606         assert(d.percent_fg_color == 0);
15607         assert(d.percent_bg_color == 0);
15608         assert(d.percent_fg_bold == 0);
15609         assert(d.barbrace_fg_color == 0);
15610         assert(d.barbrace_bg_color == 0);
15611         assert(d.barbrace_fg_bold == 0);
15612         assert(d.bar_fg_color == 0);
15613         assert(d.bar_bg_color == 0);
15614         assert(d.bar_fg_bold == 0);
15615         assert(io.in == 0);
15616         assert(io.out == 1);
15617         assert(io.in_ready == 0);
15618         assert(io.out_ready == 0);
15619         assert(io.eof_in == 0);
15620         assert(io.eof_out == 0);
15621         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15622         /* assert(io.cbuf == 0x0); */
15623         assert(io.last_read == 0);
15624         assert(io.last_write == 0);
15625         assert(io.total_read == 0);
15626         assert(io.total_write == 0);
15627         assert(io.total_size == 0);
15628         assert(io.total_size_known == 0);
15629         assert(io.timeout == 250000);
15630 
15631         assert(test_parse_rc(out,0));
15632 
15633 #ifdef PRINT_DEBUG
15634         print();
15635 #endif
15636         assert(d.start_time == 0);
15637         assert(d.total_time == 0);
15638         assert(d.current_time == 0);
15639         assert(d.elapsed_time == 0);
15640         assert(d.percent_complete == 0);
15641         assert(d.display_interval == 5);
15642         assert(d.overtime_flag == 0);
15643         assert(d.k == 1024);
15644         assert(d.twiddle == '-');
15645         assert(d.manual_width == 0);
15646         assert(d.screen_width_minus_one == 0);
15647         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15648         assert(d.display_datacount == 1);
15649         assert(d.display_throughput == 1);
15650         assert(d.display_time == 1);
15651         assert(d.display_percent == 1);
15652         assert(d.display_bar == 1);
15653         assert(d.display_summary == 1);
15654         assert(d.display_ansi == 0);
15655         assert(d.twiddle_fg_color == 0);
15656         assert(d.twiddle_bg_color == 0);
15657         assert(d.twiddle_fg_bold == 0);
15658         assert(d.datacount_fg_color == 0);
15659         assert(d.datacount_bg_color == 0);
15660         assert(d.datacount_fg_bold == 0);
15661         assert(d.throughput_label_fg_color == 0);
15662         assert(d.throughput_label_bg_color == 0);
15663         assert(d.throughput_label_fg_bold == 0);
15664         assert(d.throughput_fg_color == 0);
15665         assert(d.throughput_bg_color == 0);
15666         assert(d.throughput_fg_bold == 0);
15667         assert(d.time_label_fg_color == 0);
15668         assert(d.time_label_bg_color == 0);
15669         assert(d.time_label_fg_bold == 0);
15670         assert(d.percent_fg_color == 0);
15671         assert(d.percent_bg_color == 0);
15672         assert(d.percent_fg_bold == 0);
15673         assert(d.barbrace_fg_color == 0);
15674         assert(d.barbrace_bg_color == 0);
15675         assert(d.barbrace_fg_bold == 0);
15676         assert(d.bar_fg_color == 0);
15677         assert(d.bar_bg_color == 0);
15678         assert(d.bar_fg_bold == 0);
15679         assert(io.in == 0);
15680         assert(io.out == 1);
15681         assert(io.in_ready == 0);
15682         assert(io.out_ready == 0);
15683         assert(io.eof_in == 0);
15684         assert(io.eof_out == 0);
15685         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15686         /* assert(io.cbuf == 0x0); */
15687         assert(io.last_read == 0);
15688         assert(io.last_write == 0);
15689         assert(io.total_read == 0);
15690         assert(io.total_write == 0);
15691         assert(io.total_size == 0);
15692         assert(io.total_size_known == 0);
15693         assert(io.timeout == 250000);
15694 
15695         assert(unlink("./test-rcfile.txt") == 0);
15696 }
15697 
15698 void test115(FILE *out)
15699 {
15700         FILE *tmp_rcfile = 0;
15701         
15702         tmp_rcfile = fopen("test-rcfile.txt", "w");
15703         assert(tmp_rcfile != 0);
15704         fprintf(tmp_rcfile, "interval: /dev/null");
15705         fclose(tmp_rcfile);
15706 
15707         clear_errno();
15708         ioInit();
15709         displayInit();
15710 
15711 #ifdef PRINT_DEBUG
15712         print();
15713 #endif
15714         assert(d.start_time == 0);
15715         assert(d.total_time == 0);
15716         assert(d.current_time == 0);
15717         assert(d.elapsed_time == 0);
15718         assert(d.percent_complete == 0);
15719         assert(d.display_interval == 1);
15720         assert(d.overtime_flag == 0);
15721         assert(d.k == 1024);
15722         assert(d.twiddle == '-');
15723         assert(d.manual_width == 0);
15724         assert(d.screen_width_minus_one == 0);
15725         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15726         assert(d.display_datacount == 1);
15727         assert(d.display_throughput == 1);
15728         assert(d.display_time == 1);
15729         assert(d.display_percent == 1);
15730         assert(d.display_bar == 1);
15731         assert(d.display_summary == 1);
15732         assert(d.display_ansi == 0);
15733         assert(d.twiddle_fg_color == 0);
15734         assert(d.twiddle_bg_color == 0);
15735         assert(d.twiddle_fg_bold == 0);
15736         assert(d.datacount_fg_color == 0);
15737         assert(d.datacount_bg_color == 0);
15738         assert(d.datacount_fg_bold == 0);
15739         assert(d.throughput_label_fg_color == 0);
15740         assert(d.throughput_label_bg_color == 0);
15741         assert(d.throughput_label_fg_bold == 0);
15742         assert(d.throughput_fg_color == 0);
15743         assert(d.throughput_bg_color == 0);
15744         assert(d.throughput_fg_bold == 0);
15745         assert(d.time_label_fg_color == 0);
15746         assert(d.time_label_bg_color == 0);
15747         assert(d.time_label_fg_bold == 0);
15748         assert(d.percent_fg_color == 0);
15749         assert(d.percent_bg_color == 0);
15750         assert(d.percent_fg_bold == 0);
15751         assert(d.barbrace_fg_color == 0);
15752         assert(d.barbrace_bg_color == 0);
15753         assert(d.barbrace_fg_bold == 0);
15754         assert(d.bar_fg_color == 0);
15755         assert(d.bar_bg_color == 0);
15756         assert(d.bar_fg_bold == 0);
15757         assert(io.in == 0);
15758         assert(io.out == 1);
15759         assert(io.in_ready == 0);
15760         assert(io.out_ready == 0);
15761         assert(io.eof_in == 0);
15762         assert(io.eof_out == 0);
15763         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15764         /* assert(io.cbuf == 0x0); */
15765         assert(io.last_read == 0);
15766         assert(io.last_write == 0);
15767         assert(io.total_read == 0);
15768         assert(io.total_write == 0);
15769         assert(io.total_size == 0);
15770         assert(io.total_size_known == 0);
15771         assert(io.timeout == 250000);
15772 
15773         assert(test_parse_rc(out,1));
15774 
15775 #ifdef PRINT_DEBUG
15776         print();
15777 #endif
15778         assert(d.start_time == 0);
15779         assert(d.total_time == 0);
15780         assert(d.current_time == 0);
15781         assert(d.elapsed_time == 0);
15782         assert(d.percent_complete == 0);
15783         assert(d.display_interval == 1);
15784         assert(d.overtime_flag == 0);
15785         assert(d.k == 1024);
15786         assert(d.twiddle == '-');
15787         assert(d.manual_width == 0);
15788         assert(d.screen_width_minus_one == 0);
15789         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15790         assert(d.display_datacount == 1);
15791         assert(d.display_throughput == 1);
15792         assert(d.display_time == 1);
15793         assert(d.display_percent == 1);
15794         assert(d.display_bar == 1);
15795         assert(d.display_summary == 1);
15796         assert(d.display_ansi == 0);
15797         assert(d.twiddle_fg_color == 0);
15798         assert(d.twiddle_bg_color == 0);
15799         assert(d.twiddle_fg_bold == 0);
15800         assert(d.datacount_fg_color == 0);
15801         assert(d.datacount_bg_color == 0);
15802         assert(d.datacount_fg_bold == 0);
15803         assert(d.throughput_label_fg_color == 0);
15804         assert(d.throughput_label_bg_color == 0);
15805         assert(d.throughput_label_fg_bold == 0);
15806         assert(d.throughput_fg_color == 0);
15807         assert(d.throughput_bg_color == 0);
15808         assert(d.throughput_fg_bold == 0);
15809         assert(d.time_label_fg_color == 0);
15810         assert(d.time_label_bg_color == 0);
15811         assert(d.time_label_fg_bold == 0);
15812         assert(d.percent_fg_color == 0);
15813         assert(d.percent_bg_color == 0);
15814         assert(d.percent_fg_bold == 0);
15815         assert(d.barbrace_fg_color == 0);
15816         assert(d.barbrace_bg_color == 0);
15817         assert(d.barbrace_fg_bold == 0);
15818         assert(d.bar_fg_color == 0);
15819         assert(d.bar_bg_color == 0);
15820         assert(d.bar_fg_bold == 0);
15821         assert(io.in == 0);
15822         assert(io.out == 1);
15823         assert(io.in_ready == 0);
15824         assert(io.out_ready == 0);
15825         assert(io.eof_in == 0);
15826         assert(io.eof_out == 0);
15827         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15828         /* assert(io.cbuf == 0x0); */
15829         assert(io.last_read == 0);
15830         assert(io.last_write == 0);
15831         assert(io.total_read == 0);
15832         assert(io.total_write == 0);
15833         assert(io.total_size == 0);
15834         assert(io.total_size_known == 0);
15835         assert(io.timeout == 250000);
15836 
15837         assert(unlink("./test-rcfile.txt") == 0);
15838 }
15839 
15840 void test116(FILE *out)
15841 {
15842         FILE *tmp_rcfile = 0;
15843         
15844         tmp_rcfile = fopen("test-rcfile.txt", "w");
15845         assert(tmp_rcfile != 0);
15846         fprintf(tmp_rcfile, "interval: 1024.38002m");
15847         fclose(tmp_rcfile);
15848 
15849         clear_errno();
15850         ioInit();
15851         displayInit();
15852 
15853 #ifdef PRINT_DEBUG
15854         print();
15855 #endif
15856         assert(d.start_time == 0);
15857         assert(d.total_time == 0);
15858         assert(d.current_time == 0);
15859         assert(d.elapsed_time == 0);
15860         assert(d.percent_complete == 0);
15861         assert(d.display_interval == 1);
15862         assert(d.overtime_flag == 0);
15863         assert(d.k == 1024);
15864         assert(d.twiddle == '-');
15865         assert(d.manual_width == 0);
15866         assert(d.screen_width_minus_one == 0);
15867         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15868         assert(d.display_datacount == 1);
15869         assert(d.display_throughput == 1);
15870         assert(d.display_time == 1);
15871         assert(d.display_percent == 1);
15872         assert(d.display_bar == 1);
15873         assert(d.display_summary == 1);
15874         assert(d.display_ansi == 0);
15875         assert(d.twiddle_fg_color == 0);
15876         assert(d.twiddle_bg_color == 0);
15877         assert(d.twiddle_fg_bold == 0);
15878         assert(d.datacount_fg_color == 0);
15879         assert(d.datacount_bg_color == 0);
15880         assert(d.datacount_fg_bold == 0);
15881         assert(d.throughput_label_fg_color == 0);
15882         assert(d.throughput_label_bg_color == 0);
15883         assert(d.throughput_label_fg_bold == 0);
15884         assert(d.throughput_fg_color == 0);
15885         assert(d.throughput_bg_color == 0);
15886         assert(d.throughput_fg_bold == 0);
15887         assert(d.time_label_fg_color == 0);
15888         assert(d.time_label_bg_color == 0);
15889         assert(d.time_label_fg_bold == 0);
15890         assert(d.percent_fg_color == 0);
15891         assert(d.percent_bg_color == 0);
15892         assert(d.percent_fg_bold == 0);
15893         assert(d.barbrace_fg_color == 0);
15894         assert(d.barbrace_bg_color == 0);
15895         assert(d.barbrace_fg_bold == 0);
15896         assert(d.bar_fg_color == 0);
15897         assert(d.bar_bg_color == 0);
15898         assert(d.bar_fg_bold == 0);
15899         assert(io.in == 0);
15900         assert(io.out == 1);
15901         assert(io.in_ready == 0);
15902         assert(io.out_ready == 0);
15903         assert(io.eof_in == 0);
15904         assert(io.eof_out == 0);
15905         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15906         /* assert(io.cbuf == 0x0); */
15907         assert(io.last_read == 0);
15908         assert(io.last_write == 0);
15909         assert(io.total_read == 0);
15910         assert(io.total_write == 0);
15911         assert(io.total_size == 0);
15912         assert(io.total_size_known == 0);
15913         assert(io.timeout == 250000);
15914 
15915         assert(test_parse_rc(out,1));
15916 
15917 #ifdef PRINT_DEBUG
15918         print();
15919 #endif
15920         assert(d.start_time == 0);
15921         assert(d.total_time == 0);
15922         assert(d.current_time == 0);
15923         assert(d.elapsed_time == 0);
15924         assert(d.percent_complete == 0);
15925         assert(d.display_interval == 1);
15926         assert(d.overtime_flag == 0);
15927         assert(d.k == 1024);
15928         assert(d.twiddle == '-');
15929         assert(d.manual_width == 0);
15930         assert(d.screen_width_minus_one == 0);
15931         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
15932         assert(d.display_datacount == 1);
15933         assert(d.display_throughput == 1);
15934         assert(d.display_time == 1);
15935         assert(d.display_percent == 1);
15936         assert(d.display_bar == 1);
15937         assert(d.display_summary == 1);
15938         assert(d.display_ansi == 0);
15939         assert(d.twiddle_fg_color == 0);
15940         assert(d.twiddle_bg_color == 0);
15941         assert(d.twiddle_fg_bold == 0);
15942         assert(d.datacount_fg_color == 0);
15943         assert(d.datacount_bg_color == 0);
15944         assert(d.datacount_fg_bold == 0);
15945         assert(d.throughput_label_fg_color == 0);
15946         assert(d.throughput_label_bg_color == 0);
15947         assert(d.throughput_label_fg_bold == 0);
15948         assert(d.throughput_fg_color == 0);
15949         assert(d.throughput_bg_color == 0);
15950         assert(d.throughput_fg_bold == 0);
15951         assert(d.time_label_fg_color == 0);
15952         assert(d.time_label_bg_color == 0);
15953         assert(d.time_label_fg_bold == 0);
15954         assert(d.percent_fg_color == 0);
15955         assert(d.percent_bg_color == 0);
15956         assert(d.percent_fg_bold == 0);
15957         assert(d.barbrace_fg_color == 0);
15958         assert(d.barbrace_bg_color == 0);
15959         assert(d.barbrace_fg_bold == 0);
15960         assert(d.bar_fg_color == 0);
15961         assert(d.bar_bg_color == 0);
15962         assert(d.bar_fg_bold == 0);
15963         assert(io.in == 0);
15964         assert(io.out == 1);
15965         assert(io.in_ready == 0);
15966         assert(io.out_ready == 0);
15967         assert(io.eof_in == 0);
15968         assert(io.eof_out == 0);
15969         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
15970         /* assert(io.cbuf == 0x0); */
15971         assert(io.last_read == 0);
15972         assert(io.last_write == 0);
15973         assert(io.total_read == 0);
15974         assert(io.total_write == 0);
15975         assert(io.total_size == 0);
15976         assert(io.total_size_known == 0);
15977         assert(io.timeout == 250000);
15978 
15979         assert(unlink("./test-rcfile.txt") == 0);
15980 }
15981 
15982 void test117(FILE *out)
15983 {
15984         FILE *tmp_rcfile = 0;
15985         
15986         tmp_rcfile = fopen("test-rcfile.txt", "w");
15987         assert(tmp_rcfile != 0);
15988         fprintf(tmp_rcfile, "interval: 1024.38002");
15989         fclose(tmp_rcfile);
15990 
15991         clear_errno();
15992         ioInit();
15993         displayInit();
15994 
15995 #ifdef PRINT_DEBUG
15996         print();
15997 #endif
15998         assert(d.start_time == 0);
15999         assert(d.total_time == 0);
16000         assert(d.current_time == 0);
16001         assert(d.elapsed_time == 0);
16002         assert(d.percent_complete == 0);
16003         assert(d.display_interval == 1);
16004         assert(d.overtime_flag == 0);
16005         assert(d.k == 1024);
16006         assert(d.twiddle == '-');
16007         assert(d.manual_width == 0);
16008         assert(d.screen_width_minus_one == 0);
16009         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16010         assert(d.display_datacount == 1);
16011         assert(d.display_throughput == 1);
16012         assert(d.display_time == 1);
16013         assert(d.display_percent == 1);
16014         assert(d.display_bar == 1);
16015         assert(d.display_summary == 1);
16016         assert(d.display_ansi == 0);
16017         assert(d.twiddle_fg_color == 0);
16018         assert(d.twiddle_bg_color == 0);
16019         assert(d.twiddle_fg_bold == 0);
16020         assert(d.datacount_fg_color == 0);
16021         assert(d.datacount_bg_color == 0);
16022         assert(d.datacount_fg_bold == 0);
16023         assert(d.throughput_label_fg_color == 0);
16024         assert(d.throughput_label_bg_color == 0);
16025         assert(d.throughput_label_fg_bold == 0);
16026         assert(d.throughput_fg_color == 0);
16027         assert(d.throughput_bg_color == 0);
16028         assert(d.throughput_fg_bold == 0);
16029         assert(d.time_label_fg_color == 0);
16030         assert(d.time_label_bg_color == 0);
16031         assert(d.time_label_fg_bold == 0);
16032         assert(d.percent_fg_color == 0);
16033         assert(d.percent_bg_color == 0);
16034         assert(d.percent_fg_bold == 0);
16035         assert(d.barbrace_fg_color == 0);
16036         assert(d.barbrace_bg_color == 0);
16037         assert(d.barbrace_fg_bold == 0);
16038         assert(d.bar_fg_color == 0);
16039         assert(d.bar_bg_color == 0);
16040         assert(d.bar_fg_bold == 0);
16041         assert(io.in == 0);
16042         assert(io.out == 1);
16043         assert(io.in_ready == 0);
16044         assert(io.out_ready == 0);
16045         assert(io.eof_in == 0);
16046         assert(io.eof_out == 0);
16047         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16048         /* assert(io.cbuf == 0x0); */
16049         assert(io.last_read == 0);
16050         assert(io.last_write == 0);
16051         assert(io.total_read == 0);
16052         assert(io.total_write == 0);
16053         assert(io.total_size == 0);
16054         assert(io.total_size_known == 0);
16055         assert(io.timeout == 250000);
16056 
16057         assert(test_parse_rc(out,1));
16058 
16059 #ifdef PRINT_DEBUG
16060         print();
16061 #endif
16062         assert(d.start_time == 0);
16063         assert(d.total_time == 0);
16064         assert(d.current_time == 0);
16065         assert(d.elapsed_time == 0);
16066         assert(d.percent_complete == 0);
16067         assert(d.display_interval == 1);
16068         assert(d.overtime_flag == 0);
16069         assert(d.k == 1024);
16070         assert(d.twiddle == '-');
16071         assert(d.manual_width == 0);
16072         assert(d.screen_width_minus_one == 0);
16073         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16074         assert(d.display_datacount == 1);
16075         assert(d.display_throughput == 1);
16076         assert(d.display_time == 1);
16077         assert(d.display_percent == 1);
16078         assert(d.display_bar == 1);
16079         assert(d.display_summary == 1);
16080         assert(d.display_ansi == 0);
16081         assert(d.twiddle_fg_color == 0);
16082         assert(d.twiddle_bg_color == 0);
16083         assert(d.twiddle_fg_bold == 0);
16084         assert(d.datacount_fg_color == 0);
16085         assert(d.datacount_bg_color == 0);
16086         assert(d.datacount_fg_bold == 0);
16087         assert(d.throughput_label_fg_color == 0);
16088         assert(d.throughput_label_bg_color == 0);
16089         assert(d.throughput_label_fg_bold == 0);
16090         assert(d.throughput_fg_color == 0);
16091         assert(d.throughput_bg_color == 0);
16092         assert(d.throughput_fg_bold == 0);
16093         assert(d.time_label_fg_color == 0);
16094         assert(d.time_label_bg_color == 0);
16095         assert(d.time_label_fg_bold == 0);
16096         assert(d.percent_fg_color == 0);
16097         assert(d.percent_bg_color == 0);
16098         assert(d.percent_fg_bold == 0);
16099         assert(d.barbrace_fg_color == 0);
16100         assert(d.barbrace_bg_color == 0);
16101         assert(d.barbrace_fg_bold == 0);
16102         assert(d.bar_fg_color == 0);
16103         assert(d.bar_bg_color == 0);
16104         assert(d.bar_fg_bold == 0);
16105         assert(io.in == 0);
16106         assert(io.out == 1);
16107         assert(io.in_ready == 0);
16108         assert(io.out_ready == 0);
16109         assert(io.eof_in == 0);
16110         assert(io.eof_out == 0);
16111         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16112         /* assert(io.cbuf == 0x0); */
16113         assert(io.last_read == 0);
16114         assert(io.last_write == 0);
16115         assert(io.total_read == 0);
16116         assert(io.total_write == 0);
16117         assert(io.total_size == 0);
16118         assert(io.total_size_known == 0);
16119         assert(io.timeout == 250000);
16120 
16121         assert(unlink("./test-rcfile.txt") == 0);
16122 }
16123 
16124 void test118(FILE *out)
16125 {
16126         FILE *tmp_rcfile = 0;
16127         
16128         tmp_rcfile = fopen("test-rcfile.txt", "w");
16129         assert(tmp_rcfile != 0);
16130         fprintf(tmp_rcfile, "timeout: 5");
16131         fclose(tmp_rcfile);
16132 
16133         clear_errno();
16134         ioInit();
16135         displayInit();
16136 
16137 #ifdef PRINT_DEBUG
16138         print();
16139 #endif
16140         assert(d.start_time == 0);
16141         assert(d.total_time == 0);
16142         assert(d.current_time == 0);
16143         assert(d.elapsed_time == 0);
16144         assert(d.percent_complete == 0);
16145         assert(d.display_interval == 1);
16146         assert(d.overtime_flag == 0);
16147         assert(d.k == 1024);
16148         assert(d.twiddle == '-');
16149         assert(d.manual_width == 0);
16150         assert(d.screen_width_minus_one == 0);
16151         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16152         assert(d.display_datacount == 1);
16153         assert(d.display_throughput == 1);
16154         assert(d.display_time == 1);
16155         assert(d.display_percent == 1);
16156         assert(d.display_bar == 1);
16157         assert(d.display_summary == 1);
16158         assert(d.display_ansi == 0);
16159         assert(d.twiddle_fg_color == 0);
16160         assert(d.twiddle_bg_color == 0);
16161         assert(d.twiddle_fg_bold == 0);
16162         assert(d.datacount_fg_color == 0);
16163         assert(d.datacount_bg_color == 0);
16164         assert(d.datacount_fg_bold == 0);
16165         assert(d.throughput_label_fg_color == 0);
16166         assert(d.throughput_label_bg_color == 0);
16167         assert(d.throughput_label_fg_bold == 0);
16168         assert(d.throughput_fg_color == 0);
16169         assert(d.throughput_bg_color == 0);
16170         assert(d.throughput_fg_bold == 0);
16171         assert(d.time_label_fg_color == 0);
16172         assert(d.time_label_bg_color == 0);
16173         assert(d.time_label_fg_bold == 0);
16174         assert(d.percent_fg_color == 0);
16175         assert(d.percent_bg_color == 0);
16176         assert(d.percent_fg_bold == 0);
16177         assert(d.barbrace_fg_color == 0);
16178         assert(d.barbrace_bg_color == 0);
16179         assert(d.barbrace_fg_bold == 0);
16180         assert(d.bar_fg_color == 0);
16181         assert(d.bar_bg_color == 0);
16182         assert(d.bar_fg_bold == 0);
16183         assert(io.in == 0);
16184         assert(io.out == 1);
16185         assert(io.in_ready == 0);
16186         assert(io.out_ready == 0);
16187         assert(io.eof_in == 0);
16188         assert(io.eof_out == 0);
16189         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16190         /* assert(io.cbuf == 0x0); */
16191         assert(io.last_read == 0);
16192         assert(io.last_write == 0);
16193         assert(io.total_read == 0);
16194         assert(io.total_write == 0);
16195         assert(io.total_size == 0);
16196         assert(io.total_size_known == 0);
16197         assert(io.timeout == 250000);
16198 
16199         assert(test_parse_rc(out,0));
16200 
16201 #ifdef PRINT_DEBUG
16202         print();
16203 #endif
16204         assert(d.start_time == 0);
16205         assert(d.total_time == 0);
16206         assert(d.current_time == 0);
16207         assert(d.elapsed_time == 0);
16208         assert(d.percent_complete == 0);
16209         assert(d.display_interval == 1);
16210         assert(d.overtime_flag == 0);
16211         assert(d.k == 1024);
16212         assert(d.twiddle == '-');
16213         assert(d.manual_width == 0);
16214         assert(d.screen_width_minus_one == 0);
16215         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16216         assert(d.display_datacount == 1);
16217         assert(d.display_throughput == 1);
16218         assert(d.display_time == 1);
16219         assert(d.display_percent == 1);
16220         assert(d.display_bar == 1);
16221         assert(d.display_summary == 1);
16222         assert(d.display_ansi == 0);
16223         assert(d.twiddle_fg_color == 0);
16224         assert(d.twiddle_bg_color == 0);
16225         assert(d.twiddle_fg_bold == 0);
16226         assert(d.datacount_fg_color == 0);
16227         assert(d.datacount_bg_color == 0);
16228         assert(d.datacount_fg_bold == 0);
16229         assert(d.throughput_label_fg_color == 0);
16230         assert(d.throughput_label_bg_color == 0);
16231         assert(d.throughput_label_fg_bold == 0);
16232         assert(d.throughput_fg_color == 0);
16233         assert(d.throughput_bg_color == 0);
16234         assert(d.throughput_fg_bold == 0);
16235         assert(d.time_label_fg_color == 0);
16236         assert(d.time_label_bg_color == 0);
16237         assert(d.time_label_fg_bold == 0);
16238         assert(d.percent_fg_color == 0);
16239         assert(d.percent_bg_color == 0);
16240         assert(d.percent_fg_bold == 0);
16241         assert(d.barbrace_fg_color == 0);
16242         assert(d.barbrace_bg_color == 0);
16243         assert(d.barbrace_fg_bold == 0);
16244         assert(d.bar_fg_color == 0);
16245         assert(d.bar_bg_color == 0);
16246         assert(d.bar_fg_bold == 0);
16247         assert(io.in == 0);
16248         assert(io.out == 1);
16249         assert(io.in_ready == 0);
16250         assert(io.out_ready == 0);
16251         assert(io.eof_in == 0);
16252         assert(io.eof_out == 0);
16253         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16254         /* assert(io.cbuf == 0x0); */
16255         assert(io.last_read == 0);
16256         assert(io.last_write == 0);
16257         assert(io.total_read == 0);
16258         assert(io.total_write == 0);
16259         assert(io.total_size == 0);
16260         assert(io.total_size_known == 0);
16261         assert(io.timeout == 5);
16262 
16263         assert(unlink("./test-rcfile.txt") == 0);
16264 }
16265 
16266 void test119(FILE *out)
16267 {
16268         FILE *tmp_rcfile = 0;
16269         
16270         tmp_rcfile = fopen("test-rcfile.txt", "w");
16271         assert(tmp_rcfile != 0);
16272         fprintf(tmp_rcfile, "timeout: /dev/null");
16273         fclose(tmp_rcfile);
16274 
16275         clear_errno();
16276         ioInit();
16277         displayInit();
16278 
16279 #ifdef PRINT_DEBUG
16280         print();
16281 #endif
16282         assert(d.start_time == 0);
16283         assert(d.total_time == 0);
16284         assert(d.current_time == 0);
16285         assert(d.elapsed_time == 0);
16286         assert(d.percent_complete == 0);
16287         assert(d.display_interval == 1);
16288         assert(d.overtime_flag == 0);
16289         assert(d.k == 1024);
16290         assert(d.twiddle == '-');
16291         assert(d.manual_width == 0);
16292         assert(d.screen_width_minus_one == 0);
16293         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16294         assert(d.display_datacount == 1);
16295         assert(d.display_throughput == 1);
16296         assert(d.display_time == 1);
16297         assert(d.display_percent == 1);
16298         assert(d.display_bar == 1);
16299         assert(d.display_summary == 1);
16300         assert(d.display_ansi == 0);
16301         assert(d.twiddle_fg_color == 0);
16302         assert(d.twiddle_bg_color == 0);
16303         assert(d.twiddle_fg_bold == 0);
16304         assert(d.datacount_fg_color == 0);
16305         assert(d.datacount_bg_color == 0);
16306         assert(d.datacount_fg_bold == 0);
16307         assert(d.throughput_label_fg_color == 0);
16308         assert(d.throughput_label_bg_color == 0);
16309         assert(d.throughput_label_fg_bold == 0);
16310         assert(d.throughput_fg_color == 0);
16311         assert(d.throughput_bg_color == 0);
16312         assert(d.throughput_fg_bold == 0);
16313         assert(d.time_label_fg_color == 0);
16314         assert(d.time_label_bg_color == 0);
16315         assert(d.time_label_fg_bold == 0);
16316         assert(d.percent_fg_color == 0);
16317         assert(d.percent_bg_color == 0);
16318         assert(d.percent_fg_bold == 0);
16319         assert(d.barbrace_fg_color == 0);
16320         assert(d.barbrace_bg_color == 0);
16321         assert(d.barbrace_fg_bold == 0);
16322         assert(d.bar_fg_color == 0);
16323         assert(d.bar_bg_color == 0);
16324         assert(d.bar_fg_bold == 0);
16325         assert(io.in == 0);
16326         assert(io.out == 1);
16327         assert(io.in_ready == 0);
16328         assert(io.out_ready == 0);
16329         assert(io.eof_in == 0);
16330         assert(io.eof_out == 0);
16331         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16332         /* assert(io.cbuf == 0x0); */
16333         assert(io.last_read == 0);
16334         assert(io.last_write == 0);
16335         assert(io.total_read == 0);
16336         assert(io.total_write == 0);
16337         assert(io.total_size == 0);
16338         assert(io.total_size_known == 0);
16339         assert(io.timeout == 250000);
16340 
16341         assert(test_parse_rc(out,1));
16342 
16343 #ifdef PRINT_DEBUG
16344         print();
16345 #endif
16346         assert(d.start_time == 0);
16347         assert(d.total_time == 0);
16348         assert(d.current_time == 0);
16349         assert(d.elapsed_time == 0);
16350         assert(d.percent_complete == 0);
16351         assert(d.display_interval == 1);
16352         assert(d.overtime_flag == 0);
16353         assert(d.k == 1024);
16354         assert(d.twiddle == '-');
16355         assert(d.manual_width == 0);
16356         assert(d.screen_width_minus_one == 0);
16357         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16358         assert(d.display_datacount == 1);
16359         assert(d.display_throughput == 1);
16360         assert(d.display_time == 1);
16361         assert(d.display_percent == 1);
16362         assert(d.display_bar == 1);
16363         assert(d.display_summary == 1);
16364         assert(d.display_ansi == 0);
16365         assert(d.twiddle_fg_color == 0);
16366         assert(d.twiddle_bg_color == 0);
16367         assert(d.twiddle_fg_bold == 0);
16368         assert(d.datacount_fg_color == 0);
16369         assert(d.datacount_bg_color == 0);
16370         assert(d.datacount_fg_bold == 0);
16371         assert(d.throughput_label_fg_color == 0);
16372         assert(d.throughput_label_bg_color == 0);
16373         assert(d.throughput_label_fg_bold == 0);
16374         assert(d.throughput_fg_color == 0);
16375         assert(d.throughput_bg_color == 0);
16376         assert(d.throughput_fg_bold == 0);
16377         assert(d.time_label_fg_color == 0);
16378         assert(d.time_label_bg_color == 0);
16379         assert(d.time_label_fg_bold == 0);
16380         assert(d.percent_fg_color == 0);
16381         assert(d.percent_bg_color == 0);
16382         assert(d.percent_fg_bold == 0);
16383         assert(d.barbrace_fg_color == 0);
16384         assert(d.barbrace_bg_color == 0);
16385         assert(d.barbrace_fg_bold == 0);
16386         assert(d.bar_fg_color == 0);
16387         assert(d.bar_bg_color == 0);
16388         assert(d.bar_fg_bold == 0);
16389         assert(io.in == 0);
16390         assert(io.out == 1);
16391         assert(io.in_ready == 0);
16392         assert(io.out_ready == 0);
16393         assert(io.eof_in == 0);
16394         assert(io.eof_out == 0);
16395         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16396         /* assert(io.cbuf == 0x0); */
16397         assert(io.last_read == 0);
16398         assert(io.last_write == 0);
16399         assert(io.total_read == 0);
16400         assert(io.total_write == 0);
16401         assert(io.total_size == 0);
16402         assert(io.total_size_known == 0);
16403         assert(io.timeout == 250000);
16404 
16405         assert(unlink("./test-rcfile.txt") == 0);
16406 }
16407 
16408 void test120(FILE *out)
16409 {
16410         FILE *tmp_rcfile = 0;
16411         
16412         tmp_rcfile = fopen("test-rcfile.txt", "w");
16413         assert(tmp_rcfile != 0);
16414         fprintf(tmp_rcfile, "timeout: 1024.38002m");
16415         fclose(tmp_rcfile);
16416 
16417         clear_errno();
16418         ioInit();
16419         displayInit();
16420 
16421 #ifdef PRINT_DEBUG
16422         print();
16423 #endif
16424         assert(d.start_time == 0);
16425         assert(d.total_time == 0);
16426         assert(d.current_time == 0);
16427         assert(d.elapsed_time == 0);
16428         assert(d.percent_complete == 0);
16429         assert(d.display_interval == 1);
16430         assert(d.overtime_flag == 0);
16431         assert(d.k == 1024);
16432         assert(d.twiddle == '-');
16433         assert(d.manual_width == 0);
16434         assert(d.screen_width_minus_one == 0);
16435         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16436         assert(d.display_datacount == 1);
16437         assert(d.display_throughput == 1);
16438         assert(d.display_time == 1);
16439         assert(d.display_percent == 1);
16440         assert(d.display_bar == 1);
16441         assert(d.display_summary == 1);
16442         assert(d.display_ansi == 0);
16443         assert(d.twiddle_fg_color == 0);
16444         assert(d.twiddle_bg_color == 0);
16445         assert(d.twiddle_fg_bold == 0);
16446         assert(d.datacount_fg_color == 0);
16447         assert(d.datacount_bg_color == 0);
16448         assert(d.datacount_fg_bold == 0);
16449         assert(d.throughput_label_fg_color == 0);
16450         assert(d.throughput_label_bg_color == 0);
16451         assert(d.throughput_label_fg_bold == 0);
16452         assert(d.throughput_fg_color == 0);
16453         assert(d.throughput_bg_color == 0);
16454         assert(d.throughput_fg_bold == 0);
16455         assert(d.time_label_fg_color == 0);
16456         assert(d.time_label_bg_color == 0);
16457         assert(d.time_label_fg_bold == 0);
16458         assert(d.percent_fg_color == 0);
16459         assert(d.percent_bg_color == 0);
16460         assert(d.percent_fg_bold == 0);
16461         assert(d.barbrace_fg_color == 0);
16462         assert(d.barbrace_bg_color == 0);
16463         assert(d.barbrace_fg_bold == 0);
16464         assert(d.bar_fg_color == 0);
16465         assert(d.bar_bg_color == 0);
16466         assert(d.bar_fg_bold == 0);
16467         assert(io.in == 0);
16468         assert(io.out == 1);
16469         assert(io.in_ready == 0);
16470         assert(io.out_ready == 0);
16471         assert(io.eof_in == 0);
16472         assert(io.eof_out == 0);
16473         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16474         /* assert(io.cbuf == 0x0); */
16475         assert(io.last_read == 0);
16476         assert(io.last_write == 0);
16477         assert(io.total_read == 0);
16478         assert(io.total_write == 0);
16479         assert(io.total_size == 0);
16480         assert(io.total_size_known == 0);
16481         assert(io.timeout == 250000);
16482 
16483         assert(test_parse_rc(out,1));
16484 
16485 #ifdef PRINT_DEBUG
16486         print();
16487 #endif
16488         assert(d.start_time == 0);
16489         assert(d.total_time == 0);
16490         assert(d.current_time == 0);
16491         assert(d.elapsed_time == 0);
16492         assert(d.percent_complete == 0);
16493         assert(d.display_interval == 1);
16494         assert(d.overtime_flag == 0);
16495         assert(d.k == 1024);
16496         assert(d.twiddle == '-');
16497         assert(d.manual_width == 0);
16498         assert(d.screen_width_minus_one == 0);
16499         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16500         assert(d.display_datacount == 1);
16501         assert(d.display_throughput == 1);
16502         assert(d.display_time == 1);
16503         assert(d.display_percent == 1);
16504         assert(d.display_bar == 1);
16505         assert(d.display_summary == 1);
16506         assert(d.display_ansi == 0);
16507         assert(d.twiddle_fg_color == 0);
16508         assert(d.twiddle_bg_color == 0);
16509         assert(d.twiddle_fg_bold == 0);
16510         assert(d.datacount_fg_color == 0);
16511         assert(d.datacount_bg_color == 0);
16512         assert(d.datacount_fg_bold == 0);
16513         assert(d.throughput_label_fg_color == 0);
16514         assert(d.throughput_label_bg_color == 0);
16515         assert(d.throughput_label_fg_bold == 0);
16516         assert(d.throughput_fg_color == 0);
16517         assert(d.throughput_bg_color == 0);
16518         assert(d.throughput_fg_bold == 0);
16519         assert(d.time_label_fg_color == 0);
16520         assert(d.time_label_bg_color == 0);
16521         assert(d.time_label_fg_bold == 0);
16522         assert(d.percent_fg_color == 0);
16523         assert(d.percent_bg_color == 0);
16524         assert(d.percent_fg_bold == 0);
16525         assert(d.barbrace_fg_color == 0);
16526         assert(d.barbrace_bg_color == 0);
16527         assert(d.barbrace_fg_bold == 0);
16528         assert(d.bar_fg_color == 0);
16529         assert(d.bar_bg_color == 0);
16530         assert(d.bar_fg_bold == 0);
16531         assert(io.in == 0);
16532         assert(io.out == 1);
16533         assert(io.in_ready == 0);
16534         assert(io.out_ready == 0);
16535         assert(io.eof_in == 0);
16536         assert(io.eof_out == 0);
16537         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16538         /* assert(io.cbuf == 0x0); */
16539         assert(io.last_read == 0);
16540         assert(io.last_write == 0);
16541         assert(io.total_read == 0);
16542         assert(io.total_write == 0);
16543         assert(io.total_size == 0);
16544         assert(io.total_size_known == 0);
16545         assert(io.timeout == 250000);
16546 
16547         assert(unlink("./test-rcfile.txt") == 0);
16548 }
16549 
16550 void test121(FILE *out)
16551 {
16552         FILE *tmp_rcfile = 0;
16553         
16554         tmp_rcfile = fopen("test-rcfile.txt", "w");
16555         assert(tmp_rcfile != 0);
16556         fprintf(tmp_rcfile, "timeout: 1024.38002");
16557         fclose(tmp_rcfile);
16558 
16559         clear_errno();
16560         ioInit();
16561         displayInit();
16562 
16563 #ifdef PRINT_DEBUG
16564         print();
16565 #endif
16566         assert(d.start_time == 0);
16567         assert(d.total_time == 0);
16568         assert(d.current_time == 0);
16569         assert(d.elapsed_time == 0);
16570         assert(d.percent_complete == 0);
16571         assert(d.display_interval == 1);
16572         assert(d.overtime_flag == 0);
16573         assert(d.k == 1024);
16574         assert(d.twiddle == '-');
16575         assert(d.manual_width == 0);
16576         assert(d.screen_width_minus_one == 0);
16577         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16578         assert(d.display_datacount == 1);
16579         assert(d.display_throughput == 1);
16580         assert(d.display_time == 1);
16581         assert(d.display_percent == 1);
16582         assert(d.display_bar == 1);
16583         assert(d.display_summary == 1);
16584         assert(d.display_ansi == 0);
16585         assert(d.twiddle_fg_color == 0);
16586         assert(d.twiddle_bg_color == 0);
16587         assert(d.twiddle_fg_bold == 0);
16588         assert(d.datacount_fg_color == 0);
16589         assert(d.datacount_bg_color == 0);
16590         assert(d.datacount_fg_bold == 0);
16591         assert(d.throughput_label_fg_color == 0);
16592         assert(d.throughput_label_bg_color == 0);
16593         assert(d.throughput_label_fg_bold == 0);
16594         assert(d.throughput_fg_color == 0);
16595         assert(d.throughput_bg_color == 0);
16596         assert(d.throughput_fg_bold == 0);
16597         assert(d.time_label_fg_color == 0);
16598         assert(d.time_label_bg_color == 0);
16599         assert(d.time_label_fg_bold == 0);
16600         assert(d.percent_fg_color == 0);
16601         assert(d.percent_bg_color == 0);
16602         assert(d.percent_fg_bold == 0);
16603         assert(d.barbrace_fg_color == 0);
16604         assert(d.barbrace_bg_color == 0);
16605         assert(d.barbrace_fg_bold == 0);
16606         assert(d.bar_fg_color == 0);
16607         assert(d.bar_bg_color == 0);
16608         assert(d.bar_fg_bold == 0);
16609         assert(io.in == 0);
16610         assert(io.out == 1);
16611         assert(io.in_ready == 0);
16612         assert(io.out_ready == 0);
16613         assert(io.eof_in == 0);
16614         assert(io.eof_out == 0);
16615         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16616         /* assert(io.cbuf == 0x0); */
16617         assert(io.last_read == 0);
16618         assert(io.last_write == 0);
16619         assert(io.total_read == 0);
16620         assert(io.total_write == 0);
16621         assert(io.total_size == 0);
16622         assert(io.total_size_known == 0);
16623         assert(io.timeout == 250000);
16624 
16625         assert(test_parse_rc(out,1));
16626 
16627 #ifdef PRINT_DEBUG
16628         print();
16629 #endif
16630         assert(d.start_time == 0);
16631         assert(d.total_time == 0);
16632         assert(d.current_time == 0);
16633         assert(d.elapsed_time == 0);
16634         assert(d.percent_complete == 0);
16635         assert(d.display_interval == 1);
16636         assert(d.overtime_flag == 0);
16637         assert(d.k == 1024);
16638         assert(d.twiddle == '-');
16639         assert(d.manual_width == 0);
16640         assert(d.screen_width_minus_one == 0);
16641         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16642         assert(d.display_datacount == 1);
16643         assert(d.display_throughput == 1);
16644         assert(d.display_time == 1);
16645         assert(d.display_percent == 1);
16646         assert(d.display_bar == 1);
16647         assert(d.display_summary == 1);
16648         assert(d.display_ansi == 0);
16649         assert(d.twiddle_fg_color == 0);
16650         assert(d.twiddle_bg_color == 0);
16651         assert(d.twiddle_fg_bold == 0);
16652         assert(d.datacount_fg_color == 0);
16653         assert(d.datacount_bg_color == 0);
16654         assert(d.datacount_fg_bold == 0);
16655         assert(d.throughput_label_fg_color == 0);
16656         assert(d.throughput_label_bg_color == 0);
16657         assert(d.throughput_label_fg_bold == 0);
16658         assert(d.throughput_fg_color == 0);
16659         assert(d.throughput_bg_color == 0);
16660         assert(d.throughput_fg_bold == 0);
16661         assert(d.time_label_fg_color == 0);
16662         assert(d.time_label_bg_color == 0);
16663         assert(d.time_label_fg_bold == 0);
16664         assert(d.percent_fg_color == 0);
16665         assert(d.percent_bg_color == 0);
16666         assert(d.percent_fg_bold == 0);
16667         assert(d.barbrace_fg_color == 0);
16668         assert(d.barbrace_bg_color == 0);
16669         assert(d.barbrace_fg_bold == 0);
16670         assert(d.bar_fg_color == 0);
16671         assert(d.bar_bg_color == 0);
16672         assert(d.bar_fg_bold == 0);
16673         assert(io.in == 0);
16674         assert(io.out == 1);
16675         assert(io.in_ready == 0);
16676         assert(io.out_ready == 0);
16677         assert(io.eof_in == 0);
16678         assert(io.eof_out == 0);
16679         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16680         /* assert(io.cbuf == 0x0); */
16681         assert(io.last_read == 0);
16682         assert(io.last_write == 0);
16683         assert(io.total_read == 0);
16684         assert(io.total_write == 0);
16685         assert(io.total_size == 0);
16686         assert(io.total_size_known == 0);
16687         assert(io.timeout == 250000);
16688 
16689         assert(unlink("./test-rcfile.txt") == 0);
16690 }
16691 
16692 void test122(FILE *out)
16693 {
16694         FILE *tmp_rcfile = 0;
16695         
16696         tmp_rcfile = fopen("test-rcfile.txt", "w");
16697         assert(tmp_rcfile != 0);
16698         fprintf(tmp_rcfile, "kilobyte: 10");
16699         fclose(tmp_rcfile);
16700 
16701         clear_errno();
16702         ioInit();
16703         displayInit();
16704 
16705 #ifdef PRINT_DEBUG
16706         print();
16707 #endif
16708         assert(d.start_time == 0);
16709         assert(d.total_time == 0);
16710         assert(d.current_time == 0);
16711         assert(d.elapsed_time == 0);
16712         assert(d.percent_complete == 0);
16713         assert(d.display_interval == 1);
16714         assert(d.overtime_flag == 0);
16715         assert(d.k == 1024);
16716         assert(d.twiddle == '-');
16717         assert(d.manual_width == 0);
16718         assert(d.screen_width_minus_one == 0);
16719         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16720         assert(d.display_datacount == 1);
16721         assert(d.display_throughput == 1);
16722         assert(d.display_time == 1);
16723         assert(d.display_percent == 1);
16724         assert(d.display_bar == 1);
16725         assert(d.display_summary == 1);
16726         assert(d.display_ansi == 0);
16727         assert(d.twiddle_fg_color == 0);
16728         assert(d.twiddle_bg_color == 0);
16729         assert(d.twiddle_fg_bold == 0);
16730         assert(d.datacount_fg_color == 0);
16731         assert(d.datacount_bg_color == 0);
16732         assert(d.datacount_fg_bold == 0);
16733         assert(d.throughput_label_fg_color == 0);
16734         assert(d.throughput_label_bg_color == 0);
16735         assert(d.throughput_label_fg_bold == 0);
16736         assert(d.throughput_fg_color == 0);
16737         assert(d.throughput_bg_color == 0);
16738         assert(d.throughput_fg_bold == 0);
16739         assert(d.time_label_fg_color == 0);
16740         assert(d.time_label_bg_color == 0);
16741         assert(d.time_label_fg_bold == 0);
16742         assert(d.percent_fg_color == 0);
16743         assert(d.percent_bg_color == 0);
16744         assert(d.percent_fg_bold == 0);
16745         assert(d.barbrace_fg_color == 0);
16746         assert(d.barbrace_bg_color == 0);
16747         assert(d.barbrace_fg_bold == 0);
16748         assert(d.bar_fg_color == 0);
16749         assert(d.bar_bg_color == 0);
16750         assert(d.bar_fg_bold == 0);
16751         assert(io.in == 0);
16752         assert(io.out == 1);
16753         assert(io.in_ready == 0);
16754         assert(io.out_ready == 0);
16755         assert(io.eof_in == 0);
16756         assert(io.eof_out == 0);
16757         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16758         /* assert(io.cbuf == 0x0); */
16759         assert(io.last_read == 0);
16760         assert(io.last_write == 0);
16761         assert(io.total_read == 0);
16762         assert(io.total_write == 0);
16763         assert(io.total_size == 0);
16764         assert(io.total_size_known == 0);
16765         assert(io.timeout == 250000);
16766 
16767         assert(test_parse_rc(out,1));
16768 
16769 #ifdef PRINT_DEBUG
16770         print();
16771 #endif
16772         assert(d.start_time == 0);
16773         assert(d.total_time == 0);
16774         assert(d.current_time == 0);
16775         assert(d.elapsed_time == 0);
16776         assert(d.percent_complete == 0);
16777         assert(d.display_interval == 1);
16778         assert(d.overtime_flag == 0);
16779         assert(d.k == 1024);
16780         assert(d.twiddle == '-');
16781         assert(d.manual_width == 0);
16782         assert(d.screen_width_minus_one == 0);
16783         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16784         assert(d.display_datacount == 1);
16785         assert(d.display_throughput == 1);
16786         assert(d.display_time == 1);
16787         assert(d.display_percent == 1);
16788         assert(d.display_bar == 1);
16789         assert(d.display_summary == 1);
16790         assert(d.display_ansi == 0);
16791         assert(d.twiddle_fg_color == 0);
16792         assert(d.twiddle_bg_color == 0);
16793         assert(d.twiddle_fg_bold == 0);
16794         assert(d.datacount_fg_color == 0);
16795         assert(d.datacount_bg_color == 0);
16796         assert(d.datacount_fg_bold == 0);
16797         assert(d.throughput_label_fg_color == 0);
16798         assert(d.throughput_label_bg_color == 0);
16799         assert(d.throughput_label_fg_bold == 0);
16800         assert(d.throughput_fg_color == 0);
16801         assert(d.throughput_bg_color == 0);
16802         assert(d.throughput_fg_bold == 0);
16803         assert(d.time_label_fg_color == 0);
16804         assert(d.time_label_bg_color == 0);
16805         assert(d.time_label_fg_bold == 0);
16806         assert(d.percent_fg_color == 0);
16807         assert(d.percent_bg_color == 0);
16808         assert(d.percent_fg_bold == 0);
16809         assert(d.barbrace_fg_color == 0);
16810         assert(d.barbrace_bg_color == 0);
16811         assert(d.barbrace_fg_bold == 0);
16812         assert(d.bar_fg_color == 0);
16813         assert(d.bar_bg_color == 0);
16814         assert(d.bar_fg_bold == 0);
16815         assert(io.in == 0);
16816         assert(io.out == 1);
16817         assert(io.in_ready == 0);
16818         assert(io.out_ready == 0);
16819         assert(io.eof_in == 0);
16820         assert(io.eof_out == 0);
16821         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16822         /* assert(io.cbuf == 0x0); */
16823         assert(io.last_read == 0);
16824         assert(io.last_write == 0);
16825         assert(io.total_read == 0);
16826         assert(io.total_write == 0);
16827         assert(io.total_size == 0);
16828         assert(io.total_size_known == 0);
16829         assert(io.timeout == 250000);
16830 
16831         assert(unlink("./test-rcfile.txt") == 0);
16832 }
16833 
16834 void test123(FILE *out)
16835 {
16836         FILE *tmp_rcfile = 0;
16837         
16838         tmp_rcfile = fopen("test-rcfile.txt", "w");
16839         assert(tmp_rcfile != 0);
16840         fprintf(tmp_rcfile, "kilobyte: 1000");
16841         fclose(tmp_rcfile);
16842 
16843         clear_errno();
16844         ioInit();
16845         displayInit();
16846 
16847 #ifdef PRINT_DEBUG
16848         print();
16849 #endif
16850         assert(d.start_time == 0);
16851         assert(d.total_time == 0);
16852         assert(d.current_time == 0);
16853         assert(d.elapsed_time == 0);
16854         assert(d.percent_complete == 0);
16855         assert(d.display_interval == 1);
16856         assert(d.overtime_flag == 0);
16857         assert(d.k == 1024);
16858         assert(d.twiddle == '-');
16859         assert(d.manual_width == 0);
16860         assert(d.screen_width_minus_one == 0);
16861         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16862         assert(d.display_datacount == 1);
16863         assert(d.display_throughput == 1);
16864         assert(d.display_time == 1);
16865         assert(d.display_percent == 1);
16866         assert(d.display_bar == 1);
16867         assert(d.display_summary == 1);
16868         assert(d.display_ansi == 0);
16869         assert(d.twiddle_fg_color == 0);
16870         assert(d.twiddle_bg_color == 0);
16871         assert(d.twiddle_fg_bold == 0);
16872         assert(d.datacount_fg_color == 0);
16873         assert(d.datacount_bg_color == 0);
16874         assert(d.datacount_fg_bold == 0);
16875         assert(d.throughput_label_fg_color == 0);
16876         assert(d.throughput_label_bg_color == 0);
16877         assert(d.throughput_label_fg_bold == 0);
16878         assert(d.throughput_fg_color == 0);
16879         assert(d.throughput_bg_color == 0);
16880         assert(d.throughput_fg_bold == 0);
16881         assert(d.time_label_fg_color == 0);
16882         assert(d.time_label_bg_color == 0);
16883         assert(d.time_label_fg_bold == 0);
16884         assert(d.percent_fg_color == 0);
16885         assert(d.percent_bg_color == 0);
16886         assert(d.percent_fg_bold == 0);
16887         assert(d.barbrace_fg_color == 0);
16888         assert(d.barbrace_bg_color == 0);
16889         assert(d.barbrace_fg_bold == 0);
16890         assert(d.bar_fg_color == 0);
16891         assert(d.bar_bg_color == 0);
16892         assert(d.bar_fg_bold == 0);
16893         assert(io.in == 0);
16894         assert(io.out == 1);
16895         assert(io.in_ready == 0);
16896         assert(io.out_ready == 0);
16897         assert(io.eof_in == 0);
16898         assert(io.eof_out == 0);
16899         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16900         /* assert(io.cbuf == 0x0); */
16901         assert(io.last_read == 0);
16902         assert(io.last_write == 0);
16903         assert(io.total_read == 0);
16904         assert(io.total_write == 0);
16905         assert(io.total_size == 0);
16906         assert(io.total_size_known == 0);
16907         assert(io.timeout == 250000);
16908 
16909         assert(test_parse_rc(out,0));
16910 
16911 #ifdef PRINT_DEBUG
16912         print();
16913 #endif
16914         assert(d.start_time == 0);
16915         assert(d.total_time == 0);
16916         assert(d.current_time == 0);
16917         assert(d.elapsed_time == 0);
16918         assert(d.percent_complete == 0);
16919         assert(d.display_interval == 1);
16920         assert(d.overtime_flag == 0);
16921         assert(d.k == 1000);
16922         assert(d.twiddle == '-');
16923         assert(d.manual_width == 0);
16924         assert(d.screen_width_minus_one == 0);
16925         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
16926         assert(d.display_datacount == 1);
16927         assert(d.display_throughput == 1);
16928         assert(d.display_time == 1);
16929         assert(d.display_percent == 1);
16930         assert(d.display_bar == 1);
16931         assert(d.display_summary == 1);
16932         assert(d.display_ansi == 0);
16933         assert(d.twiddle_fg_color == 0);
16934         assert(d.twiddle_bg_color == 0);
16935         assert(d.twiddle_fg_bold == 0);
16936         assert(d.datacount_fg_color == 0);
16937         assert(d.datacount_bg_color == 0);
16938         assert(d.datacount_fg_bold == 0);
16939         assert(d.throughput_label_fg_color == 0);
16940         assert(d.throughput_label_bg_color == 0);
16941         assert(d.throughput_label_fg_bold == 0);
16942         assert(d.throughput_fg_color == 0);
16943         assert(d.throughput_bg_color == 0);
16944         assert(d.throughput_fg_bold == 0);
16945         assert(d.time_label_fg_color == 0);
16946         assert(d.time_label_bg_color == 0);
16947         assert(d.time_label_fg_bold == 0);
16948         assert(d.percent_fg_color == 0);
16949         assert(d.percent_bg_color == 0);
16950         assert(d.percent_fg_bold == 0);
16951         assert(d.barbrace_fg_color == 0);
16952         assert(d.barbrace_bg_color == 0);
16953         assert(d.barbrace_fg_bold == 0);
16954         assert(d.bar_fg_color == 0);
16955         assert(d.bar_bg_color == 0);
16956         assert(d.bar_fg_bold == 0);
16957         assert(io.in == 0);
16958         assert(io.out == 1);
16959         assert(io.in_ready == 0);
16960         assert(io.out_ready == 0);
16961         assert(io.eof_in == 0);
16962         assert(io.eof_out == 0);
16963         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
16964         /* assert(io.cbuf == 0x0); */
16965         assert(io.last_read == 0);
16966         assert(io.last_write == 0);
16967         assert(io.total_read == 0);
16968         assert(io.total_write == 0);
16969         assert(io.total_size == 0);
16970         assert(io.total_size_known == 0);
16971         assert(io.timeout == 250000);
16972 
16973         assert(unlink("./test-rcfile.txt") == 0);
16974 }
16975 
16976 void test124(FILE *out)
16977 {
16978         FILE *tmp_rcfile = 0;
16979         
16980         tmp_rcfile = fopen("test-rcfile.txt", "w");
16981         assert(tmp_rcfile != 0);
16982         fprintf(tmp_rcfile, "kilobyte: 1024");
16983         fclose(tmp_rcfile);
16984 
16985         clear_errno();
16986         ioInit();
16987         displayInit();
16988 
16989 #ifdef PRINT_DEBUG
16990         print();
16991 #endif
16992         assert(d.start_time == 0);
16993         assert(d.total_time == 0);
16994         assert(d.current_time == 0);
16995         assert(d.elapsed_time == 0);
16996         assert(d.percent_complete == 0);
16997         assert(d.display_interval == 1);
16998         assert(d.overtime_flag == 0);
16999         assert(d.k == 1024);
17000         assert(d.twiddle == '-');
17001         assert(d.manual_width == 0);
17002         assert(d.screen_width_minus_one == 0);
17003         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
17004         assert(d.display_datacount == 1);
17005         assert(d.display_throughput == 1);
17006         assert(d.display_time == 1);
17007         assert(d.display_percent == 1);
17008         assert(d.display_bar == 1);
17009         assert(d.display_summary == 1);
17010         assert(d.display_ansi == 0);
17011         assert(d.twiddle_fg_color == 0);
17012         assert(d.twiddle_bg_color == 0);
17013         assert(d.twiddle_fg_bold == 0);
17014         assert(d.datacount_fg_color == 0);
17015         assert(d.datacount_bg_color == 0);
17016         assert(d.datacount_fg_bold == 0);
17017         assert(d.throughput_label_fg_color == 0);
17018         assert(d.throughput_label_bg_color == 0);
17019         assert(d.throughput_label_fg_bold == 0);
17020         assert(d.throughput_fg_color == 0);
17021         assert(d.throughput_bg_color == 0);
17022         assert(d.throughput_fg_bold == 0);
17023         assert(d.time_label_fg_color == 0);
17024         assert(d.time_label_bg_color == 0);
17025         assert(d.time_label_fg_bold == 0);
17026         assert(d.percent_fg_color == 0);
17027         assert(d.percent_bg_color == 0);
17028         assert(d.percent_fg_bold == 0);
17029         assert(d.barbrace_fg_color == 0);
17030         assert(d.barbrace_bg_color == 0);
17031         assert(d.barbrace_fg_bold == 0);
17032         assert(d.bar_fg_color == 0);
17033         assert(d.bar_bg_color == 0);
17034         assert(d.bar_fg_bold == 0);
17035         assert(io.in == 0);
17036         assert(io.out == 1);
17037         assert(io.in_ready == 0);
17038         assert(io.out_ready == 0);
17039         assert(io.eof_in == 0);
17040         assert(io.eof_out == 0);
17041         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17042         /* assert(io.cbuf == 0x0); */
17043         assert(io.last_read == 0);
17044         assert(io.last_write == 0);
17045         assert(io.total_read == 0);
17046         assert(io.total_write == 0);
17047         assert(io.total_size == 0);
17048         assert(io.total_size_known == 0);
17049         assert(io.timeout == 250000);
17050 
17051         d.k = 1000;
17052         assert(test_parse_rc(out,0));
17053 
17054 #ifdef PRINT_DEBUG
17055         print();
17056 #endif
17057         assert(d.start_time == 0);
17058         assert(d.total_time == 0);
17059         assert(d.current_time == 0);
17060         assert(d.elapsed_time == 0);
17061         assert(d.percent_complete == 0);
17062         assert(d.display_interval == 1);
17063         assert(d.overtime_flag == 0);
17064         assert(d.k == 1024);
17065         assert(d.twiddle == '-');
17066         assert(d.manual_width == 0);
17067         assert(d.screen_width_minus_one == 0);
17068         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
17069         assert(d.display_datacount == 1);
17070         assert(d.display_throughput == 1);
17071         assert(d.display_time == 1);
17072         assert(d.display_percent == 1);
17073         assert(d.display_bar == 1);
17074         assert(d.display_summary == 1);
17075         assert(d.display_ansi == 0);
17076         assert(d.twiddle_fg_color == 0);
17077         assert(d.twiddle_bg_color == 0);
17078         assert(d.twiddle_fg_bold == 0);
17079         assert(d.datacount_fg_color == 0);
17080         assert(d.datacount_bg_color == 0);
17081         assert(d.datacount_fg_bold == 0);
17082         assert(d.throughput_label_fg_color == 0);
17083         assert(d.throughput_label_bg_color == 0);
17084         assert(d.throughput_label_fg_bold == 0);
17085         assert(d.throughput_fg_color == 0);
17086         assert(d.throughput_bg_color == 0);
17087         assert(d.throughput_fg_bold == 0);
17088         assert(d.time_label_fg_color == 0);
17089         assert(d.time_label_bg_color == 0);
17090         assert(d.time_label_fg_bold == 0);
17091         assert(d.percent_fg_color == 0);
17092         assert(d.percent_bg_color == 0);
17093         assert(d.percent_fg_bold == 0);
17094         assert(d.barbrace_fg_color == 0);
17095         assert(d.barbrace_bg_color == 0);
17096         assert(d.barbrace_fg_bold == 0);
17097         assert(d.bar_fg_color == 0);
17098         assert(d.bar_bg_color == 0);
17099         assert(d.bar_fg_bold == 0);
17100         assert(io.in == 0);
17101         assert(io.out == 1);
17102         assert(io.in_ready == 0);
17103         assert(io.out_ready == 0);
17104         assert(io.eof_in == 0);
17105         assert(io.eof_out == 0);
17106         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17107         /* assert(io.cbuf == 0x0); */
17108         assert(io.last_read == 0);
17109         assert(io.last_write == 0);
17110         assert(io.total_read == 0);
17111         assert(io.total_write == 0);
17112         assert(io.total_size == 0);
17113         assert(io.total_size_known == 0);
17114         assert(io.timeout == 250000);
17115 
17116         assert(unlink("./test-rcfile.txt") == 0);
17117 }
17118 
17119 void test125(FILE *out)
17120 {
17121         FILE *tmp_rcfile = 0;
17122         
17123         tmp_rcfile = fopen("test-rcfile.txt", "w");
17124         assert(tmp_rcfile != 0);
17125         fprintf(tmp_rcfile, "screen-width: 0");
17126         fclose(tmp_rcfile);
17127 
17128         clear_errno();
17129         ioInit();
17130         displayInit();
17131 
17132 #ifdef PRINT_DEBUG
17133         print();
17134 #endif
17135         assert(d.start_time == 0);
17136         assert(d.total_time == 0);
17137         assert(d.current_time == 0);
17138         assert(d.elapsed_time == 0);
17139         assert(d.percent_complete == 0);
17140         assert(d.display_interval == 1);
17141         assert(d.overtime_flag == 0);
17142         assert(d.k == 1024);
17143         assert(d.twiddle == '-');
17144         assert(d.manual_width == 0);
17145         assert(d.screen_width_minus_one == 0);
17146         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
17147         assert(d.display_datacount == 1);
17148         assert(d.display_throughput == 1);
17149         assert(d.display_time == 1);
17150         assert(d.display_percent == 1);
17151         assert(d.display_bar == 1);
17152         assert(d.display_summary == 1);
17153         assert(d.display_ansi == 0);
17154         assert(d.twiddle_fg_color == 0);
17155         assert(d.twiddle_bg_color == 0);
17156         assert(d.twiddle_fg_bold == 0);
17157         assert(d.datacount_fg_color == 0);
17158         assert(d.datacount_bg_color == 0);
17159         assert(d.datacount_fg_bold == 0);
17160         assert(d.throughput_label_fg_color == 0);
17161         assert(d.throughput_label_bg_color == 0);
17162         assert(d.throughput_label_fg_bold == 0);
17163         assert(d.throughput_fg_color == 0);
17164         assert(d.throughput_bg_color == 0);
17165         assert(d.throughput_fg_bold == 0);
17166         assert(d.time_label_fg_color == 0);
17167         assert(d.time_label_bg_color == 0);
17168         assert(d.time_label_fg_bold == 0);
17169         assert(d.percent_fg_color == 0);
17170         assert(d.percent_bg_color == 0);
17171         assert(d.percent_fg_bold == 0);
17172         assert(d.barbrace_fg_color == 0);
17173         assert(d.barbrace_bg_color == 0);
17174         assert(d.barbrace_fg_bold == 0);
17175         assert(d.bar_fg_color == 0);
17176         assert(d.bar_bg_color == 0);
17177         assert(d.bar_fg_bold == 0);
17178         assert(io.in == 0);
17179         assert(io.out == 1);
17180         assert(io.in_ready == 0);
17181         assert(io.out_ready == 0);
17182         assert(io.eof_in == 0);
17183         assert(io.eof_out == 0);
17184         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17185         /* assert(io.cbuf == 0x0); */
17186         assert(io.last_read == 0);
17187         assert(io.last_write == 0);
17188         assert(io.total_read == 0);
17189         assert(io.total_write == 0);
17190         assert(io.total_size == 0);
17191         assert(io.total_size_known == 0);
17192         assert(io.timeout == 250000);
17193 
17194         assert(test_parse_rc(out,1));
17195 
17196 #ifdef PRINT_DEBUG
17197         print();
17198 #endif
17199         assert(d.start_time == 0);
17200         assert(d.total_time == 0);
17201         assert(d.current_time == 0);
17202         assert(d.elapsed_time == 0);
17203         assert(d.percent_complete == 0);
17204         assert(d.display_interval == 1);
17205         assert(d.overtime_flag == 0);
17206         assert(d.k == 1024);
17207         assert(d.twiddle == '-');
17208         assert(d.manual_width == 0);
17209         assert(d.screen_width_minus_one == 0);
17210         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
17211         assert(d.display_datacount == 1);
17212         assert(d.display_throughput == 1);
17213         assert(d.display_time == 1);
17214         assert(d.display_percent == 1);
17215         assert(d.display_bar == 1);
17216         assert(d.display_summary == 1);
17217         assert(d.display_ansi == 0);
17218         assert(d.twiddle_fg_color == 0);
17219         assert(d.twiddle_bg_color == 0);
17220         assert(d.twiddle_fg_bold == 0);
17221         assert(d.datacount_fg_color == 0);
17222         assert(d.datacount_bg_color == 0);
17223         assert(d.datacount_fg_bold == 0);
17224         assert(d.throughput_label_fg_color == 0);
17225         assert(d.throughput_label_bg_color == 0);
17226         assert(d.throughput_label_fg_bold == 0);
17227         assert(d.throughput_fg_color == 0);
17228         assert(d.throughput_bg_color == 0);
17229         assert(d.throughput_fg_bold == 0);
17230         assert(d.time_label_fg_color == 0);
17231         assert(d.time_label_bg_color == 0);
17232         assert(d.time_label_fg_bold == 0);
17233         assert(d.percent_fg_color == 0);
17234         assert(d.percent_bg_color == 0);
17235         assert(d.percent_fg_bold == 0);
17236         assert(d.barbrace_fg_color == 0);
17237         assert(d.barbrace_bg_color == 0);
17238         assert(d.barbrace_fg_bold == 0);
17239         assert(d.bar_fg_color == 0);
17240         assert(d.bar_bg_color == 0);
17241         assert(d.bar_fg_bold == 0);
17242         assert(io.in == 0);
17243         assert(io.out == 1);
17244         assert(io.in_ready == 0);
17245         assert(io.out_ready == 0);
17246         assert(io.eof_in == 0);
17247         assert(io.eof_out == 0);
17248         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17249         /* assert(io.cbuf == 0x0); */
17250         assert(io.last_read == 0);
17251         assert(io.last_write == 0);
17252         assert(io.total_read == 0);
17253         assert(io.total_write == 0);
17254         assert(io.total_size == 0);
17255         assert(io.total_size_known == 0);
17256         assert(io.timeout == 250000);
17257 
17258         assert(unlink("./test-rcfile.txt") == 0);
17259 }
17260 
17261 void test126(FILE *out)
17262 {
17263         FILE *tmp_rcfile = 0;
17264         
17265         tmp_rcfile = fopen("test-rcfile.txt", "w");
17266         assert(tmp_rcfile != 0);
17267         fprintf(tmp_rcfile, "screen-width: 1");
17268         fclose(tmp_rcfile);
17269 
17270         clear_errno();
17271         ioInit();
17272         displayInit();
17273 
17274 #ifdef PRINT_DEBUG
17275         print();
17276 #endif
17277         assert(d.start_time == 0);
17278         assert(d.total_time == 0);
17279         assert(d.current_time == 0);
17280         assert(d.elapsed_time == 0);
17281         assert(d.percent_complete == 0);
17282         assert(d.display_interval == 1);
17283         assert(d.overtime_flag == 0);
17284         assert(d.k == 1024);
17285         assert(d.twiddle == '-');
17286         assert(d.manual_width == 0);
17287         assert(d.screen_width_minus_one == 0);
17288         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
17289         assert(d.display_datacount == 1);
17290         assert(d.display_throughput == 1);
17291         assert(d.display_time == 1);
17292         assert(d.display_percent == 1);
17293         assert(d.display_bar == 1);
17294         assert(d.display_summary == 1);
17295         assert(d.display_ansi == 0);
17296         assert(d.twiddle_fg_color == 0);
17297         assert(d.twiddle_bg_color == 0);
17298         assert(d.twiddle_fg_bold == 0);
17299         assert(d.datacount_fg_color == 0);
17300         assert(d.datacount_bg_color == 0);
17301         assert(d.datacount_fg_bold == 0);
17302         assert(d.throughput_label_fg_color == 0);
17303         assert(d.throughput_label_bg_color == 0);
17304         assert(d.throughput_label_fg_bold == 0);
17305         assert(d.throughput_fg_color == 0);
17306         assert(d.throughput_bg_color == 0);
17307         assert(d.throughput_fg_bold == 0);
17308         assert(d.time_label_fg_color == 0);
17309         assert(d.time_label_bg_color == 0);
17310         assert(d.time_label_fg_bold == 0);
17311         assert(d.percent_fg_color == 0);
17312         assert(d.percent_bg_color == 0);
17313         assert(d.percent_fg_bold == 0);
17314         assert(d.barbrace_fg_color == 0);
17315         assert(d.barbrace_bg_color == 0);
17316         assert(d.barbrace_fg_bold == 0);
17317         assert(d.bar_fg_color == 0);
17318         assert(d.bar_bg_color == 0);
17319         assert(d.bar_fg_bold == 0);
17320         assert(io.in == 0);
17321         assert(io.out == 1);
17322         assert(io.in_ready == 0);
17323         assert(io.out_ready == 0);
17324         assert(io.eof_in == 0);
17325         assert(io.eof_out == 0);
17326         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17327         /* assert(io.cbuf == 0x0); */
17328         assert(io.last_read == 0);
17329         assert(io.last_write == 0);
17330         assert(io.total_read == 0);
17331         assert(io.total_write == 0);
17332         assert(io.total_size == 0);
17333         assert(io.total_size_known == 0);
17334         assert(io.timeout == 250000);
17335 
17336         assert(test_parse_rc(out,0));
17337         assert(d.screen_width == 1);
17338 
17339 #ifdef PRINT_DEBUG
17340         print();
17341 #endif
17342         assert(d.start_time == 0);
17343         assert(d.total_time == 0);
17344         assert(d.current_time == 0);
17345         assert(d.elapsed_time == 0);
17346         assert(d.percent_complete == 0);
17347         assert(d.display_interval == 1);
17348         assert(d.overtime_flag == 0);
17349         assert(d.k == 1024);
17350         assert(d.twiddle == '-');
17351         assert(d.manual_width == 1);
17352         assert(d.screen_width_minus_one == 0);
17353         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
17354         assert(d.display_datacount == 1);
17355         assert(d.display_throughput == 1);
17356         assert(d.display_time == 1);
17357         assert(d.display_percent == 1);
17358         assert(d.display_bar == 1);
17359         assert(d.display_summary == 1);
17360         assert(d.display_ansi == 0);
17361         assert(d.twiddle_fg_color == 0);
17362         assert(d.twiddle_bg_color == 0);
17363         assert(d.twiddle_fg_bold == 0);
17364         assert(d.datacount_fg_color == 0);
17365         assert(d.datacount_bg_color == 0);
17366         assert(d.datacount_fg_bold == 0);
17367         assert(d.throughput_label_fg_color == 0);
17368         assert(d.throughput_label_bg_color == 0);
17369         assert(d.throughput_label_fg_bold == 0);
17370         assert(d.throughput_fg_color == 0);
17371         assert(d.throughput_bg_color == 0);
17372         assert(d.throughput_fg_bold == 0);
17373         assert(d.time_label_fg_color == 0);
17374         assert(d.time_label_bg_color == 0);
17375         assert(d.time_label_fg_bold == 0);
17376         assert(d.percent_fg_color == 0);
17377         assert(d.percent_bg_color == 0);
17378         assert(d.percent_fg_bold == 0);
17379         assert(d.barbrace_fg_color == 0);
17380         assert(d.barbrace_bg_color == 0);
17381         assert(d.barbrace_fg_bold == 0);
17382         assert(d.bar_fg_color == 0);
17383         assert(d.bar_bg_color == 0);
17384         assert(d.bar_fg_bold == 0);
17385         assert(io.in == 0);
17386         assert(io.out == 1);
17387         assert(io.in_ready == 0);
17388         assert(io.out_ready == 0);
17389         assert(io.eof_in == 0);
17390         assert(io.eof_out == 0);
17391         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17392         /* assert(io.cbuf == 0x0); */
17393         assert(io.last_read == 0);
17394         assert(io.last_write == 0);
17395         assert(io.total_read == 0);
17396         assert(io.total_write == 0);
17397         assert(io.total_size == 0);
17398         assert(io.total_size_known == 0);
17399         assert(io.timeout == 250000);
17400 
17401         assert(unlink("./test-rcfile.txt") == 0);
17402 }
17403 
17404 void test127(FILE *out)
17405 {
17406         FILE *tmp_rcfile = 0;
17407         
17408         tmp_rcfile = fopen("test-rcfile.txt", "w");
17409         assert(tmp_rcfile != 0);
17410         fprintf(tmp_rcfile, "display-twiddle: Sjkhg");
17411         fclose(tmp_rcfile);
17412 
17413         clear_errno();
17414         ioInit();
17415         displayInit();
17416 
17417 #ifdef PRINT_DEBUG
17418         print();
17419 #endif
17420         assert(d.start_time == 0);
17421         assert(d.total_time == 0);
17422         assert(d.current_time == 0);
17423         assert(d.elapsed_time == 0);
17424         assert(d.percent_complete == 0);
17425         assert(d.display_interval == 1);
17426         assert(d.overtime_flag == 0);
17427         assert(d.k == 1024);
17428         assert(d.twiddle == '-');
17429         assert(d.manual_width == 0);
17430         assert(d.screen_width_minus_one == 0);
17431         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
17432         assert(d.display_datacount == 1);
17433         assert(d.display_throughput == 1);
17434         assert(d.display_time == 1);
17435         assert(d.display_percent == 1);
17436         assert(d.display_bar == 1);
17437         assert(d.display_summary == 1);
17438         assert(d.display_ansi == 0);
17439         assert(d.twiddle_fg_color == 0);
17440         assert(d.twiddle_bg_color == 0);
17441         assert(d.twiddle_fg_bold == 0);
17442         assert(d.datacount_fg_color == 0);
17443         assert(d.datacount_bg_color == 0);
17444         assert(d.datacount_fg_bold == 0);
17445         assert(d.throughput_label_fg_color == 0);
17446         assert(d.throughput_label_bg_color == 0);
17447         assert(d.throughput_label_fg_bold == 0);
17448         assert(d.throughput_fg_color == 0);
17449         assert(d.throughput_bg_color == 0);
17450         assert(d.throughput_fg_bold == 0);
17451         assert(d.time_label_fg_color == 0);
17452         assert(d.time_label_bg_color == 0);
17453         assert(d.time_label_fg_bold == 0);
17454         assert(d.percent_fg_color == 0);
17455         assert(d.percent_bg_color == 0);
17456         assert(d.percent_fg_bold == 0);
17457         assert(d.barbrace_fg_color == 0);
17458         assert(d.barbrace_bg_color == 0);
17459         assert(d.barbrace_fg_bold == 0);
17460         assert(d.bar_fg_color == 0);
17461         assert(d.bar_bg_color == 0);
17462         assert(d.bar_fg_bold == 0);
17463         assert(io.in == 0);
17464         assert(io.out == 1);
17465         assert(io.in_ready == 0);
17466         assert(io.out_ready == 0);
17467         assert(io.eof_in == 0);
17468         assert(io.eof_out == 0);
17469         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17470         /* assert(io.cbuf == 0x0); */
17471         assert(io.last_read == 0);
17472         assert(io.last_write == 0);
17473         assert(io.total_read == 0);
17474         assert(io.total_write == 0);
17475         assert(io.total_size == 0);
17476         assert(io.total_size_known == 0);
17477         assert(io.timeout == 250000);
17478 
17479         assert(test_parse_rc(out,1));
17480 
17481 #ifdef PRINT_DEBUG
17482         print();
17483 #endif
17484         assert(d.start_time == 0);
17485         assert(d.total_time == 0);
17486         assert(d.current_time == 0);
17487         assert(d.elapsed_time == 0);
17488         assert(d.percent_complete == 0);
17489         assert(d.display_interval == 1);
17490         assert(d.overtime_flag == 0);
17491         assert(d.k == 1024);
17492         assert(d.twiddle == '-');
17493         assert(d.manual_width == 0);
17494         assert(d.screen_width_minus_one == 0);
17495         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
17496         assert(d.display_datacount == 1);
17497         assert(d.display_throughput == 1);
17498         assert(d.display_time == 1);
17499         assert(d.display_percent == 1);
17500         assert(d.display_bar == 1);
17501         assert(d.display_summary == 1);
17502         assert(d.display_ansi == 0);
17503         assert(d.twiddle_fg_color == 0);
17504         assert(d.twiddle_bg_color == 0);
17505         assert(d.twiddle_fg_bold == 0);
17506         assert(d.datacount_fg_color == 0);
17507         assert(d.datacount_bg_color == 0);
17508         assert(d.datacount_fg_bold == 0);
17509         assert(d.throughput_label_fg_color == 0);
17510         assert(d.throughput_label_bg_color == 0);
17511         assert(d.throughput_label_fg_bold == 0);
17512         assert(d.throughput_fg_color == 0);
17513         assert(d.throughput_bg_color == 0);
17514         assert(d.throughput_fg_bold == 0);
17515         assert(d.time_label_fg_color == 0);
17516         assert(d.time_label_bg_color == 0);
17517         assert(d.time_label_fg_bold == 0);
17518         assert(d.percent_fg_color == 0);
17519         assert(d.percent_bg_color == 0);
17520         assert(d.percent_fg_bold == 0);
17521         assert(d.barbrace_fg_color == 0);
17522         assert(d.barbrace_bg_color == 0);
17523         assert(d.barbrace_fg_bold == 0);
17524         assert(d.bar_fg_color == 0);
17525         assert(d.bar_bg_color == 0);
17526         assert(d.bar_fg_bold == 0);
17527         assert(io.in == 0);
17528         assert(io.out == 1);
17529         assert(io.in_ready == 0);
17530         assert(io.out_ready == 0);
17531         assert(io.eof_in == 0);
17532         assert(io.eof_out == 0);
17533         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17534         /* assert(io.cbuf == 0x0); */
17535         assert(io.last_read == 0);
17536         assert(io.last_write == 0);
17537         assert(io.total_read == 0);
17538         assert(io.total_write == 0);
17539         assert(io.total_size == 0);
17540         assert(io.total_size_known == 0);
17541         assert(io.timeout == 250000);
17542 
17543         tmp_rcfile = fopen("test-rcfile.txt", "w");
17544         assert(tmp_rcfile != 0);
17545         fprintf(tmp_rcfile, "display-twiddle: no");
17546         fclose(tmp_rcfile);
17547 
17548         assert(test_parse_rc(out,0));
17549 
17550 #ifdef PRINT_DEBUG
17551         print();
17552 #endif
17553         assert(d.start_time == 0);
17554         assert(d.total_time == 0);
17555         assert(d.current_time == 0);
17556         assert(d.elapsed_time == 0);
17557         assert(d.percent_complete == 0);
17558         assert(d.display_interval == 1);
17559         assert(d.overtime_flag == 0);
17560         assert(d.k == 1024);
17561         assert(d.twiddle == '-');
17562         assert(d.manual_width == 0);
17563         assert(d.screen_width_minus_one == 0);
17564         assert(d.display_twiddle == 0);
17565         assert(d.display_datacount == 1);
17566         assert(d.display_throughput == 1);
17567         assert(d.display_time == 1);
17568         assert(d.display_percent == 1);
17569         assert(d.display_bar == 1);
17570         assert(d.display_summary == 1);
17571         assert(d.display_ansi == 0);
17572         assert(d.twiddle_fg_color == 0);
17573         assert(d.twiddle_bg_color == 0);
17574         assert(d.twiddle_fg_bold == 0);
17575         assert(d.datacount_fg_color == 0);
17576         assert(d.datacount_bg_color == 0);
17577         assert(d.datacount_fg_bold == 0);
17578         assert(d.throughput_label_fg_color == 0);
17579         assert(d.throughput_label_bg_color == 0);
17580         assert(d.throughput_label_fg_bold == 0);
17581         assert(d.throughput_fg_color == 0);
17582         assert(d.throughput_bg_color == 0);
17583         assert(d.throughput_fg_bold == 0);
17584         assert(d.time_label_fg_color == 0);
17585         assert(d.time_label_bg_color == 0);
17586         assert(d.time_label_fg_bold == 0);
17587         assert(d.percent_fg_color == 0);
17588         assert(d.percent_bg_color == 0);
17589         assert(d.percent_fg_bold == 0);
17590         assert(d.barbrace_fg_color == 0);
17591         assert(d.barbrace_bg_color == 0);
17592         assert(d.barbrace_fg_bold == 0);
17593         assert(d.bar_fg_color == 0);
17594         assert(d.bar_bg_color == 0);
17595         assert(d.bar_fg_bold == 0);
17596         assert(io.in == 0);
17597         assert(io.out == 1);
17598         assert(io.in_ready == 0);
17599         assert(io.out_ready == 0);
17600         assert(io.eof_in == 0);
17601         assert(io.eof_out == 0);
17602         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17603         /* assert(io.cbuf == 0x0); */
17604         assert(io.last_read == 0);
17605         assert(io.last_write == 0);
17606         assert(io.total_read == 0);
17607         assert(io.total_write == 0);
17608         assert(io.total_size == 0);
17609         assert(io.total_size_known == 0);
17610         assert(io.timeout == 250000);
17611 
17612         tmp_rcfile = fopen("test-rcfile.txt", "w");
17613         assert(tmp_rcfile != 0);
17614         fprintf(tmp_rcfile, "display-twiddle: yes");
17615         fclose(tmp_rcfile);
17616 
17617         assert(test_parse_rc(out,0));
17618 
17619 #ifdef PRINT_DEBUG
17620         print();
17621 #endif
17622         assert(d.start_time == 0);
17623         assert(d.total_time == 0);
17624         assert(d.current_time == 0);
17625         assert(d.elapsed_time == 0);
17626         assert(d.percent_complete == 0);
17627         assert(d.display_interval == 1);
17628         assert(d.overtime_flag == 0);
17629         assert(d.k == 1024);
17630         assert(d.twiddle == '-');
17631         assert(d.manual_width == 0);
17632         assert(d.screen_width_minus_one == 0);
17633         assert(d.display_twiddle == 1);
17634         assert(d.display_datacount == 1);
17635         assert(d.display_throughput == 1);
17636         assert(d.display_time == 1);
17637         assert(d.display_percent == 1);
17638         assert(d.display_bar == 1);
17639         assert(d.display_summary == 1);
17640         assert(d.display_ansi == 0);
17641         assert(d.twiddle_fg_color == 0);
17642         assert(d.twiddle_bg_color == 0);
17643         assert(d.twiddle_fg_bold == 0);
17644         assert(d.datacount_fg_color == 0);
17645         assert(d.datacount_bg_color == 0);
17646         assert(d.datacount_fg_bold == 0);
17647         assert(d.throughput_label_fg_color == 0);
17648         assert(d.throughput_label_bg_color == 0);
17649         assert(d.throughput_label_fg_bold == 0);
17650         assert(d.throughput_fg_color == 0);
17651         assert(d.throughput_bg_color == 0);
17652         assert(d.throughput_fg_bold == 0);
17653         assert(d.time_label_fg_color == 0);
17654         assert(d.time_label_bg_color == 0);
17655         assert(d.time_label_fg_bold == 0);
17656         assert(d.percent_fg_color == 0);
17657         assert(d.percent_bg_color == 0);
17658         assert(d.percent_fg_bold == 0);
17659         assert(d.barbrace_fg_color == 0);
17660         assert(d.barbrace_bg_color == 0);
17661         assert(d.barbrace_fg_bold == 0);
17662         assert(d.bar_fg_color == 0);
17663         assert(d.bar_bg_color == 0);
17664         assert(d.bar_fg_bold == 0);
17665         assert(io.in == 0);
17666         assert(io.out == 1);
17667         assert(io.in_ready == 0);
17668         assert(io.out_ready == 0);
17669         assert(io.eof_in == 0);
17670         assert(io.eof_out == 0);
17671         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17672         /* assert(io.cbuf == 0x0); */
17673         assert(io.last_read == 0);
17674         assert(io.last_write == 0);
17675         assert(io.total_read == 0);
17676         assert(io.total_write == 0);
17677         assert(io.total_size == 0);
17678         assert(io.total_size_known == 0);
17679         assert(io.timeout == 250000);
17680 
17681         tmp_rcfile = fopen("test-rcfile.txt", "w");
17682         assert(tmp_rcfile != 0);
17683         fprintf(tmp_rcfile, "display-twiddle: n");
17684         fclose(tmp_rcfile);
17685 
17686         assert(test_parse_rc(out,0));
17687 
17688 #ifdef PRINT_DEBUG
17689         print();
17690 #endif
17691         assert(d.start_time == 0);
17692         assert(d.total_time == 0);
17693         assert(d.current_time == 0);
17694         assert(d.elapsed_time == 0);
17695         assert(d.percent_complete == 0);
17696         assert(d.display_interval == 1);
17697         assert(d.overtime_flag == 0);
17698         assert(d.k == 1024);
17699         assert(d.twiddle == '-');
17700         assert(d.manual_width == 0);
17701         assert(d.screen_width_minus_one == 0);
17702         assert(d.display_twiddle == 0);
17703         assert(d.display_datacount == 1);
17704         assert(d.display_throughput == 1);
17705         assert(d.display_time == 1);
17706         assert(d.display_percent == 1);
17707         assert(d.display_bar == 1);
17708         assert(d.display_summary == 1);
17709         assert(d.display_ansi == 0);
17710         assert(d.twiddle_fg_color == 0);
17711         assert(d.twiddle_bg_color == 0);
17712         assert(d.twiddle_fg_bold == 0);
17713         assert(d.datacount_fg_color == 0);
17714         assert(d.datacount_bg_color == 0);
17715         assert(d.datacount_fg_bold == 0);
17716         assert(d.throughput_label_fg_color == 0);
17717         assert(d.throughput_label_bg_color == 0);
17718         assert(d.throughput_label_fg_bold == 0);
17719         assert(d.throughput_fg_color == 0);
17720         assert(d.throughput_bg_color == 0);
17721         assert(d.throughput_fg_bold == 0);
17722         assert(d.time_label_fg_color == 0);
17723         assert(d.time_label_bg_color == 0);
17724         assert(d.time_label_fg_bold == 0);
17725         assert(d.percent_fg_color == 0);
17726         assert(d.percent_bg_color == 0);
17727         assert(d.percent_fg_bold == 0);
17728         assert(d.barbrace_fg_color == 0);
17729         assert(d.barbrace_bg_color == 0);
17730         assert(d.barbrace_fg_bold == 0);
17731         assert(d.bar_fg_color == 0);
17732         assert(d.bar_bg_color == 0);
17733         assert(d.bar_fg_bold == 0);
17734         assert(io.in == 0);
17735         assert(io.out == 1);
17736         assert(io.in_ready == 0);
17737         assert(io.out_ready == 0);
17738         assert(io.eof_in == 0);
17739         assert(io.eof_out == 0);
17740         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17741         /* assert(io.cbuf == 0x0); */
17742         assert(io.last_read == 0);
17743         assert(io.last_write == 0);
17744         assert(io.total_read == 0);
17745         assert(io.total_write == 0);
17746         assert(io.total_size == 0);
17747         assert(io.total_size_known == 0);
17748         assert(io.timeout == 250000);
17749 
17750         tmp_rcfile = fopen("test-rcfile.txt", "w");
17751         assert(tmp_rcfile != 0);
17752         fprintf(tmp_rcfile, "display-twiddle: y");
17753         fclose(tmp_rcfile);
17754 
17755         assert(test_parse_rc(out,0));
17756 
17757 #ifdef PRINT_DEBUG
17758         print();
17759 #endif
17760         assert(d.start_time == 0);
17761         assert(d.total_time == 0);
17762         assert(d.current_time == 0);
17763         assert(d.elapsed_time == 0);
17764         assert(d.percent_complete == 0);
17765         assert(d.display_interval == 1);
17766         assert(d.overtime_flag == 0);
17767         assert(d.k == 1024);
17768         assert(d.twiddle == '-');
17769         assert(d.manual_width == 0);
17770         assert(d.screen_width_minus_one == 0);
17771         assert(d.display_twiddle == 1);
17772         assert(d.display_datacount == 1);
17773         assert(d.display_throughput == 1);
17774         assert(d.display_time == 1);
17775         assert(d.display_percent == 1);
17776         assert(d.display_bar == 1);
17777         assert(d.display_summary == 1);
17778         assert(d.display_ansi == 0);
17779         assert(d.twiddle_fg_color == 0);
17780         assert(d.twiddle_bg_color == 0);
17781         assert(d.twiddle_fg_bold == 0);
17782         assert(d.datacount_fg_color == 0);
17783         assert(d.datacount_bg_color == 0);
17784         assert(d.datacount_fg_bold == 0);
17785         assert(d.throughput_label_fg_color == 0);
17786         assert(d.throughput_label_bg_color == 0);
17787         assert(d.throughput_label_fg_bold == 0);
17788         assert(d.throughput_fg_color == 0);
17789         assert(d.throughput_bg_color == 0);
17790         assert(d.throughput_fg_bold == 0);
17791         assert(d.time_label_fg_color == 0);
17792         assert(d.time_label_bg_color == 0);
17793         assert(d.time_label_fg_bold == 0);
17794         assert(d.percent_fg_color == 0);
17795         assert(d.percent_bg_color == 0);
17796         assert(d.percent_fg_bold == 0);
17797         assert(d.barbrace_fg_color == 0);
17798         assert(d.barbrace_bg_color == 0);
17799         assert(d.barbrace_fg_bold == 0);
17800         assert(d.bar_fg_color == 0);
17801         assert(d.bar_bg_color == 0);
17802         assert(d.bar_fg_bold == 0);
17803         assert(io.in == 0);
17804         assert(io.out == 1);
17805         assert(io.in_ready == 0);
17806         assert(io.out_ready == 0);
17807         assert(io.eof_in == 0);
17808         assert(io.eof_out == 0);
17809         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17810         /* assert(io.cbuf == 0x0); */
17811         assert(io.last_read == 0);
17812         assert(io.last_write == 0);
17813         assert(io.total_read == 0);
17814         assert(io.total_write == 0);
17815         assert(io.total_size == 0);
17816         assert(io.total_size_known == 0);
17817         assert(io.timeout == 250000);
17818 
17819         tmp_rcfile = fopen("test-rcfile.txt", "w");
17820         assert(tmp_rcfile != 0);
17821         fprintf(tmp_rcfile, "display-twiddle: false");
17822         fclose(tmp_rcfile);
17823 
17824         assert(test_parse_rc(out,0));
17825 
17826 #ifdef PRINT_DEBUG
17827         print();
17828 #endif
17829         assert(d.start_time == 0);
17830         assert(d.total_time == 0);
17831         assert(d.current_time == 0);
17832         assert(d.elapsed_time == 0);
17833         assert(d.percent_complete == 0);
17834         assert(d.display_interval == 1);
17835         assert(d.overtime_flag == 0);
17836         assert(d.k == 1024);
17837         assert(d.twiddle == '-');
17838         assert(d.manual_width == 0);
17839         assert(d.screen_width_minus_one == 0);
17840         assert(d.display_twiddle == 0);
17841         assert(d.display_datacount == 1);
17842         assert(d.display_throughput == 1);
17843         assert(d.display_time == 1);
17844         assert(d.display_percent == 1);
17845         assert(d.display_bar == 1);
17846         assert(d.display_summary == 1);
17847         assert(d.display_ansi == 0);
17848         assert(d.twiddle_fg_color == 0);
17849         assert(d.twiddle_bg_color == 0);
17850         assert(d.twiddle_fg_bold == 0);
17851         assert(d.datacount_fg_color == 0);
17852         assert(d.datacount_bg_color == 0);
17853         assert(d.datacount_fg_bold == 0);
17854         assert(d.throughput_label_fg_color == 0);
17855         assert(d.throughput_label_bg_color == 0);
17856         assert(d.throughput_label_fg_bold == 0);
17857         assert(d.throughput_fg_color == 0);
17858         assert(d.throughput_bg_color == 0);
17859         assert(d.throughput_fg_bold == 0);
17860         assert(d.time_label_fg_color == 0);
17861         assert(d.time_label_bg_color == 0);
17862         assert(d.time_label_fg_bold == 0);
17863         assert(d.percent_fg_color == 0);
17864         assert(d.percent_bg_color == 0);
17865         assert(d.percent_fg_bold == 0);
17866         assert(d.barbrace_fg_color == 0);
17867         assert(d.barbrace_bg_color == 0);
17868         assert(d.barbrace_fg_bold == 0);
17869         assert(d.bar_fg_color == 0);
17870         assert(d.bar_bg_color == 0);
17871         assert(d.bar_fg_bold == 0);
17872         assert(io.in == 0);
17873         assert(io.out == 1);
17874         assert(io.in_ready == 0);
17875         assert(io.out_ready == 0);
17876         assert(io.eof_in == 0);
17877         assert(io.eof_out == 0);
17878         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17879         /* assert(io.cbuf == 0x0); */
17880         assert(io.last_read == 0);
17881         assert(io.last_write == 0);
17882         assert(io.total_read == 0);
17883         assert(io.total_write == 0);
17884         assert(io.total_size == 0);
17885         assert(io.total_size_known == 0);
17886         assert(io.timeout == 250000);
17887 
17888         tmp_rcfile = fopen("test-rcfile.txt", "w");
17889         assert(tmp_rcfile != 0);
17890         fprintf(tmp_rcfile, "display-twiddle: true");
17891         fclose(tmp_rcfile);
17892 
17893         assert(test_parse_rc(out,0));
17894 
17895 #ifdef PRINT_DEBUG
17896         print();
17897 #endif
17898         assert(d.start_time == 0);
17899         assert(d.total_time == 0);
17900         assert(d.current_time == 0);
17901         assert(d.elapsed_time == 0);
17902         assert(d.percent_complete == 0);
17903         assert(d.display_interval == 1);
17904         assert(d.overtime_flag == 0);
17905         assert(d.k == 1024);
17906         assert(d.twiddle == '-');
17907         assert(d.manual_width == 0);
17908         assert(d.screen_width_minus_one == 0);
17909         assert(d.display_twiddle == 1);
17910         assert(d.display_datacount == 1);
17911         assert(d.display_throughput == 1);
17912         assert(d.display_time == 1);
17913         assert(d.display_percent == 1);
17914         assert(d.display_bar == 1);
17915         assert(d.display_summary == 1);
17916         assert(d.display_ansi == 0);
17917         assert(d.twiddle_fg_color == 0);
17918         assert(d.twiddle_bg_color == 0);
17919         assert(d.twiddle_fg_bold == 0);
17920         assert(d.datacount_fg_color == 0);
17921         assert(d.datacount_bg_color == 0);
17922         assert(d.datacount_fg_bold == 0);
17923         assert(d.throughput_label_fg_color == 0);
17924         assert(d.throughput_label_bg_color == 0);
17925         assert(d.throughput_label_fg_bold == 0);
17926         assert(d.throughput_fg_color == 0);
17927         assert(d.throughput_bg_color == 0);
17928         assert(d.throughput_fg_bold == 0);
17929         assert(d.time_label_fg_color == 0);
17930         assert(d.time_label_bg_color == 0);
17931         assert(d.time_label_fg_bold == 0);
17932         assert(d.percent_fg_color == 0);
17933         assert(d.percent_bg_color == 0);
17934         assert(d.percent_fg_bold == 0);
17935         assert(d.barbrace_fg_color == 0);
17936         assert(d.barbrace_bg_color == 0);
17937         assert(d.barbrace_fg_bold == 0);
17938         assert(d.bar_fg_color == 0);
17939         assert(d.bar_bg_color == 0);
17940         assert(d.bar_fg_bold == 0);
17941         assert(io.in == 0);
17942         assert(io.out == 1);
17943         assert(io.in_ready == 0);
17944         assert(io.out_ready == 0);
17945         assert(io.eof_in == 0);
17946         assert(io.eof_out == 0);
17947         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
17948         /* assert(io.cbuf == 0x0); */
17949         assert(io.last_read == 0);
17950         assert(io.last_write == 0);
17951         assert(io.total_read == 0);
17952         assert(io.total_write == 0);
17953         assert(io.total_size == 0);
17954         assert(io.total_size_known == 0);
17955         assert(io.timeout == 250000);
17956 
17957         tmp_rcfile = fopen("test-rcfile.txt", "w");
17958         assert(tmp_rcfile != 0);
17959         fprintf(tmp_rcfile, "display-twiddle: f");
17960         fclose(tmp_rcfile);
17961 
17962         assert(test_parse_rc(out,0));
17963 
17964 #ifdef PRINT_DEBUG
17965         print();
17966 #endif
17967         assert(d.start_time == 0);
17968         assert(d.total_time == 0);
17969         assert(d.current_time == 0);
17970         assert(d.elapsed_time == 0);
17971         assert(d.percent_complete == 0);
17972         assert(d.display_interval == 1);
17973         assert(d.overtime_flag == 0);
17974         assert(d.k == 1024);
17975         assert(d.twiddle == '-');
17976         assert(d.manual_width == 0);
17977         assert(d.screen_width_minus_one == 0);
17978         assert(d.display_twiddle == 0);
17979         assert(d.display_datacount == 1);
17980         assert(d.display_throughput == 1);
17981         assert(d.display_time == 1);
17982         assert(d.display_percent == 1);
17983         assert(d.display_bar == 1);
17984         assert(d.display_summary == 1);
17985         assert(d.display_ansi == 0);
17986         assert(d.twiddle_fg_color == 0);
17987         assert(d.twiddle_bg_color == 0);
17988         assert(d.twiddle_fg_bold == 0);
17989         assert(d.datacount_fg_color == 0);
17990         assert(d.datacount_bg_color == 0);
17991         assert(d.datacount_fg_bold == 0);
17992         assert(d.throughput_label_fg_color == 0);
17993         assert(d.throughput_label_bg_color == 0);
17994         assert(d.throughput_label_fg_bold == 0);
17995         assert(d.throughput_fg_color == 0);
17996         assert(d.throughput_bg_color == 0);
17997         assert(d.throughput_fg_bold == 0);
17998         assert(d.time_label_fg_color == 0);
17999         assert(d.time_label_bg_color == 0);
18000         assert(d.time_label_fg_bold == 0);
18001         assert(d.percent_fg_color == 0);
18002         assert(d.percent_bg_color == 0);
18003         assert(d.percent_fg_bold == 0);
18004         assert(d.barbrace_fg_color == 0);
18005         assert(d.barbrace_bg_color == 0);
18006         assert(d.barbrace_fg_bold == 0);
18007         assert(d.bar_fg_color == 0);
18008         assert(d.bar_bg_color == 0);
18009         assert(d.bar_fg_bold == 0);
18010         assert(io.in == 0);
18011         assert(io.out == 1);
18012         assert(io.in_ready == 0);
18013         assert(io.out_ready == 0);
18014         assert(io.eof_in == 0);
18015         assert(io.eof_out == 0);
18016         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18017         /* assert(io.cbuf == 0x0); */
18018         assert(io.last_read == 0);
18019         assert(io.last_write == 0);
18020         assert(io.total_read == 0);
18021         assert(io.total_write == 0);
18022         assert(io.total_size == 0);
18023         assert(io.total_size_known == 0);
18024         assert(io.timeout == 250000);
18025 
18026         tmp_rcfile = fopen("test-rcfile.txt", "w");
18027         assert(tmp_rcfile != 0);
18028         fprintf(tmp_rcfile, "display-twiddle: t");
18029         fclose(tmp_rcfile);
18030 
18031         assert(test_parse_rc(out,0));
18032 
18033 #ifdef PRINT_DEBUG
18034         print();
18035 #endif
18036         assert(d.start_time == 0);
18037         assert(d.total_time == 0);
18038         assert(d.current_time == 0);
18039         assert(d.elapsed_time == 0);
18040         assert(d.percent_complete == 0);
18041         assert(d.display_interval == 1);
18042         assert(d.overtime_flag == 0);
18043         assert(d.k == 1024);
18044         assert(d.twiddle == '-');
18045         assert(d.manual_width == 0);
18046         assert(d.screen_width_minus_one == 0);
18047         assert(d.display_twiddle == 1);
18048         assert(d.display_datacount == 1);
18049         assert(d.display_throughput == 1);
18050         assert(d.display_time == 1);
18051         assert(d.display_percent == 1);
18052         assert(d.display_bar == 1);
18053         assert(d.display_summary == 1);
18054         assert(d.display_ansi == 0);
18055         assert(d.twiddle_fg_color == 0);
18056         assert(d.twiddle_bg_color == 0);
18057         assert(d.twiddle_fg_bold == 0);
18058         assert(d.datacount_fg_color == 0);
18059         assert(d.datacount_bg_color == 0);
18060         assert(d.datacount_fg_bold == 0);
18061         assert(d.throughput_label_fg_color == 0);
18062         assert(d.throughput_label_bg_color == 0);
18063         assert(d.throughput_label_fg_bold == 0);
18064         assert(d.throughput_fg_color == 0);
18065         assert(d.throughput_bg_color == 0);
18066         assert(d.throughput_fg_bold == 0);
18067         assert(d.time_label_fg_color == 0);
18068         assert(d.time_label_bg_color == 0);
18069         assert(d.time_label_fg_bold == 0);
18070         assert(d.percent_fg_color == 0);
18071         assert(d.percent_bg_color == 0);
18072         assert(d.percent_fg_bold == 0);
18073         assert(d.barbrace_fg_color == 0);
18074         assert(d.barbrace_bg_color == 0);
18075         assert(d.barbrace_fg_bold == 0);
18076         assert(d.bar_fg_color == 0);
18077         assert(d.bar_bg_color == 0);
18078         assert(d.bar_fg_bold == 0);
18079         assert(io.in == 0);
18080         assert(io.out == 1);
18081         assert(io.in_ready == 0);
18082         assert(io.out_ready == 0);
18083         assert(io.eof_in == 0);
18084         assert(io.eof_out == 0);
18085         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18086         /* assert(io.cbuf == 0x0); */
18087         assert(io.last_read == 0);
18088         assert(io.last_write == 0);
18089         assert(io.total_read == 0);
18090         assert(io.total_write == 0);
18091         assert(io.total_size == 0);
18092         assert(io.total_size_known == 0);
18093         assert(io.timeout == 250000);
18094 
18095         tmp_rcfile = fopen("test-rcfile.txt", "w");
18096         assert(tmp_rcfile != 0);
18097         fprintf(tmp_rcfile, "display-twiddle: 0");
18098         fclose(tmp_rcfile);
18099 
18100         assert(test_parse_rc(out,0));
18101 
18102 #ifdef PRINT_DEBUG
18103         print();
18104 #endif
18105         assert(d.start_time == 0);
18106         assert(d.total_time == 0);
18107         assert(d.current_time == 0);
18108         assert(d.elapsed_time == 0);
18109         assert(d.percent_complete == 0);
18110         assert(d.display_interval == 1);
18111         assert(d.overtime_flag == 0);
18112         assert(d.k == 1024);
18113         assert(d.twiddle == '-');
18114         assert(d.manual_width == 0);
18115         assert(d.screen_width_minus_one == 0);
18116         assert(d.display_twiddle == 0);
18117         assert(d.display_datacount == 1);
18118         assert(d.display_throughput == 1);
18119         assert(d.display_time == 1);
18120         assert(d.display_percent == 1);
18121         assert(d.display_bar == 1);
18122         assert(d.display_summary == 1);
18123         assert(d.display_ansi == 0);
18124         assert(d.twiddle_fg_color == 0);
18125         assert(d.twiddle_bg_color == 0);
18126         assert(d.twiddle_fg_bold == 0);
18127         assert(d.datacount_fg_color == 0);
18128         assert(d.datacount_bg_color == 0);
18129         assert(d.datacount_fg_bold == 0);
18130         assert(d.throughput_label_fg_color == 0);
18131         assert(d.throughput_label_bg_color == 0);
18132         assert(d.throughput_label_fg_bold == 0);
18133         assert(d.throughput_fg_color == 0);
18134         assert(d.throughput_bg_color == 0);
18135         assert(d.throughput_fg_bold == 0);
18136         assert(d.time_label_fg_color == 0);
18137         assert(d.time_label_bg_color == 0);
18138         assert(d.time_label_fg_bold == 0);
18139         assert(d.percent_fg_color == 0);
18140         assert(d.percent_bg_color == 0);
18141         assert(d.percent_fg_bold == 0);
18142         assert(d.barbrace_fg_color == 0);
18143         assert(d.barbrace_bg_color == 0);
18144         assert(d.barbrace_fg_bold == 0);
18145         assert(d.bar_fg_color == 0);
18146         assert(d.bar_bg_color == 0);
18147         assert(d.bar_fg_bold == 0);
18148         assert(io.in == 0);
18149         assert(io.out == 1);
18150         assert(io.in_ready == 0);
18151         assert(io.out_ready == 0);
18152         assert(io.eof_in == 0);
18153         assert(io.eof_out == 0);
18154         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18155         /* assert(io.cbuf == 0x0); */
18156         assert(io.last_read == 0);
18157         assert(io.last_write == 0);
18158         assert(io.total_read == 0);
18159         assert(io.total_write == 0);
18160         assert(io.total_size == 0);
18161         assert(io.total_size_known == 0);
18162         assert(io.timeout == 250000);
18163 
18164         tmp_rcfile = fopen("test-rcfile.txt", "w");
18165         assert(tmp_rcfile != 0);
18166         fprintf(tmp_rcfile, "display-twiddle: 1");
18167         fclose(tmp_rcfile);
18168 
18169         assert(test_parse_rc(out,0));
18170 
18171 #ifdef PRINT_DEBUG
18172         print();
18173 #endif
18174         assert(d.start_time == 0);
18175         assert(d.total_time == 0);
18176         assert(d.current_time == 0);
18177         assert(d.elapsed_time == 0);
18178         assert(d.percent_complete == 0);
18179         assert(d.display_interval == 1);
18180         assert(d.overtime_flag == 0);
18181         assert(d.k == 1024);
18182         assert(d.twiddle == '-');
18183         assert(d.manual_width == 0);
18184         assert(d.screen_width_minus_one == 0);
18185         assert(d.display_twiddle == 1);
18186         assert(d.display_datacount == 1);
18187         assert(d.display_throughput == 1);
18188         assert(d.display_time == 1);
18189         assert(d.display_percent == 1);
18190         assert(d.display_bar == 1);
18191         assert(d.display_summary == 1);
18192         assert(d.display_ansi == 0);
18193         assert(d.twiddle_fg_color == 0);
18194         assert(d.twiddle_bg_color == 0);
18195         assert(d.twiddle_fg_bold == 0);
18196         assert(d.datacount_fg_color == 0);
18197         assert(d.datacount_bg_color == 0);
18198         assert(d.datacount_fg_bold == 0);
18199         assert(d.throughput_label_fg_color == 0);
18200         assert(d.throughput_label_bg_color == 0);
18201         assert(d.throughput_label_fg_bold == 0);
18202         assert(d.throughput_fg_color == 0);
18203         assert(d.throughput_bg_color == 0);
18204         assert(d.throughput_fg_bold == 0);
18205         assert(d.time_label_fg_color == 0);
18206         assert(d.time_label_bg_color == 0);
18207         assert(d.time_label_fg_bold == 0);
18208         assert(d.percent_fg_color == 0);
18209         assert(d.percent_bg_color == 0);
18210         assert(d.percent_fg_bold == 0);
18211         assert(d.barbrace_fg_color == 0);
18212         assert(d.barbrace_bg_color == 0);
18213         assert(d.barbrace_fg_bold == 0);
18214         assert(d.bar_fg_color == 0);
18215         assert(d.bar_bg_color == 0);
18216         assert(d.bar_fg_bold == 0);
18217         assert(io.in == 0);
18218         assert(io.out == 1);
18219         assert(io.in_ready == 0);
18220         assert(io.out_ready == 0);
18221         assert(io.eof_in == 0);
18222         assert(io.eof_out == 0);
18223         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18224         /* assert(io.cbuf == 0x0); */
18225         assert(io.last_read == 0);
18226         assert(io.last_write == 0);
18227         assert(io.total_read == 0);
18228         assert(io.total_write == 0);
18229         assert(io.total_size == 0);
18230         assert(io.total_size_known == 0);
18231         assert(io.timeout == 250000);
18232 
18233         tmp_rcfile = fopen("test-rcfile.txt", "w");
18234         assert(tmp_rcfile != 0);
18235         fprintf(tmp_rcfile, "display-twiddle: off");
18236         fclose(tmp_rcfile);
18237 
18238         assert(test_parse_rc(out,0));
18239 
18240 #ifdef PRINT_DEBUG
18241         print();
18242 #endif
18243         assert(d.start_time == 0);
18244         assert(d.total_time == 0);
18245         assert(d.current_time == 0);
18246         assert(d.elapsed_time == 0);
18247         assert(d.percent_complete == 0);
18248         assert(d.display_interval == 1);
18249         assert(d.overtime_flag == 0);
18250         assert(d.k == 1024);
18251         assert(d.twiddle == '-');
18252         assert(d.manual_width == 0);
18253         assert(d.screen_width_minus_one == 0);
18254         assert(d.display_twiddle == 0);
18255         assert(d.display_datacount == 1);
18256         assert(d.display_throughput == 1);
18257         assert(d.display_time == 1);
18258         assert(d.display_percent == 1);
18259         assert(d.display_bar == 1);
18260         assert(d.display_summary == 1);
18261         assert(d.display_ansi == 0);
18262         assert(d.twiddle_fg_color == 0);
18263         assert(d.twiddle_bg_color == 0);
18264         assert(d.twiddle_fg_bold == 0);
18265         assert(d.datacount_fg_color == 0);
18266         assert(d.datacount_bg_color == 0);
18267         assert(d.datacount_fg_bold == 0);
18268         assert(d.throughput_label_fg_color == 0);
18269         assert(d.throughput_label_bg_color == 0);
18270         assert(d.throughput_label_fg_bold == 0);
18271         assert(d.throughput_fg_color == 0);
18272         assert(d.throughput_bg_color == 0);
18273         assert(d.throughput_fg_bold == 0);
18274         assert(d.time_label_fg_color == 0);
18275         assert(d.time_label_bg_color == 0);
18276         assert(d.time_label_fg_bold == 0);
18277         assert(d.percent_fg_color == 0);
18278         assert(d.percent_bg_color == 0);
18279         assert(d.percent_fg_bold == 0);
18280         assert(d.barbrace_fg_color == 0);
18281         assert(d.barbrace_bg_color == 0);
18282         assert(d.barbrace_fg_bold == 0);
18283         assert(d.bar_fg_color == 0);
18284         assert(d.bar_bg_color == 0);
18285         assert(d.bar_fg_bold == 0);
18286         assert(io.in == 0);
18287         assert(io.out == 1);
18288         assert(io.in_ready == 0);
18289         assert(io.out_ready == 0);
18290         assert(io.eof_in == 0);
18291         assert(io.eof_out == 0);
18292         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18293         /* assert(io.cbuf == 0x0); */
18294         assert(io.last_read == 0);
18295         assert(io.last_write == 0);
18296         assert(io.total_read == 0);
18297         assert(io.total_write == 0);
18298         assert(io.total_size == 0);
18299         assert(io.total_size_known == 0);
18300         assert(io.timeout == 250000);
18301 
18302         tmp_rcfile = fopen("test-rcfile.txt", "w");
18303         assert(tmp_rcfile != 0);
18304         fprintf(tmp_rcfile, "display-twiddle: on");
18305         fclose(tmp_rcfile);
18306 
18307         assert(test_parse_rc(out,0));
18308 
18309 #ifdef PRINT_DEBUG
18310         print();
18311 #endif
18312         assert(d.start_time == 0);
18313         assert(d.total_time == 0);
18314         assert(d.current_time == 0);
18315         assert(d.elapsed_time == 0);
18316         assert(d.percent_complete == 0);
18317         assert(d.display_interval == 1);
18318         assert(d.overtime_flag == 0);
18319         assert(d.k == 1024);
18320         assert(d.twiddle == '-');
18321         assert(d.manual_width == 0);
18322         assert(d.screen_width_minus_one == 0);
18323         assert(d.display_twiddle == 1);
18324         assert(d.display_datacount == 1);
18325         assert(d.display_throughput == 1);
18326         assert(d.display_time == 1);
18327         assert(d.display_percent == 1);
18328         assert(d.display_bar == 1);
18329         assert(d.display_summary == 1);
18330         assert(d.display_ansi == 0);
18331         assert(d.twiddle_fg_color == 0);
18332         assert(d.twiddle_bg_color == 0);
18333         assert(d.twiddle_fg_bold == 0);
18334         assert(d.datacount_fg_color == 0);
18335         assert(d.datacount_bg_color == 0);
18336         assert(d.datacount_fg_bold == 0);
18337         assert(d.throughput_label_fg_color == 0);
18338         assert(d.throughput_label_bg_color == 0);
18339         assert(d.throughput_label_fg_bold == 0);
18340         assert(d.throughput_fg_color == 0);
18341         assert(d.throughput_bg_color == 0);
18342         assert(d.throughput_fg_bold == 0);
18343         assert(d.time_label_fg_color == 0);
18344         assert(d.time_label_bg_color == 0);
18345         assert(d.time_label_fg_bold == 0);
18346         assert(d.percent_fg_color == 0);
18347         assert(d.percent_bg_color == 0);
18348         assert(d.percent_fg_bold == 0);
18349         assert(d.barbrace_fg_color == 0);
18350         assert(d.barbrace_bg_color == 0);
18351         assert(d.barbrace_fg_bold == 0);
18352         assert(d.bar_fg_color == 0);
18353         assert(d.bar_bg_color == 0);
18354         assert(d.bar_fg_bold == 0);
18355         assert(io.in == 0);
18356         assert(io.out == 1);
18357         assert(io.in_ready == 0);
18358         assert(io.out_ready == 0);
18359         assert(io.eof_in == 0);
18360         assert(io.eof_out == 0);
18361         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18362         /* assert(io.cbuf == 0x0); */
18363         assert(io.last_read == 0);
18364         assert(io.last_write == 0);
18365         assert(io.total_read == 0);
18366         assert(io.total_write == 0);
18367         assert(io.total_size == 0);
18368         assert(io.total_size_known == 0);
18369         assert(io.timeout == 250000);
18370 
18371         assert(unlink("./test-rcfile.txt") == 0);
18372 }
18373 
18374 void test128(FILE *out)
18375 {
18376         FILE *tmp_rcfile = 0;
18377         
18378         tmp_rcfile = fopen("test-rcfile.txt", "w");
18379         assert(tmp_rcfile != 0);
18380         fprintf(tmp_rcfile, "display-count: Sjkhg");
18381         fclose(tmp_rcfile);
18382 
18383         clear_errno();
18384         ioInit();
18385         displayInit();
18386 
18387 #ifdef PRINT_DEBUG
18388         print();
18389 #endif
18390         assert(d.start_time == 0);
18391         assert(d.total_time == 0);
18392         assert(d.current_time == 0);
18393         assert(d.elapsed_time == 0);
18394         assert(d.percent_complete == 0);
18395         assert(d.display_interval == 1);
18396         assert(d.overtime_flag == 0);
18397         assert(d.k == 1024);
18398         assert(d.twiddle == '-');
18399         assert(d.manual_width == 0);
18400         assert(d.screen_width_minus_one == 0);
18401         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
18402         assert(d.display_datacount == 1);
18403         assert(d.display_throughput == 1);
18404         assert(d.display_time == 1);
18405         assert(d.display_percent == 1);
18406         assert(d.display_bar == 1);
18407         assert(d.display_summary == 1);
18408         assert(d.display_ansi == 0);
18409         assert(d.twiddle_fg_color == 0);
18410         assert(d.twiddle_bg_color == 0);
18411         assert(d.twiddle_fg_bold == 0);
18412         assert(d.datacount_fg_color == 0);
18413         assert(d.datacount_bg_color == 0);
18414         assert(d.datacount_fg_bold == 0);
18415         assert(d.throughput_label_fg_color == 0);
18416         assert(d.throughput_label_bg_color == 0);
18417         assert(d.throughput_label_fg_bold == 0);
18418         assert(d.throughput_fg_color == 0);
18419         assert(d.throughput_bg_color == 0);
18420         assert(d.throughput_fg_bold == 0);
18421         assert(d.time_label_fg_color == 0);
18422         assert(d.time_label_bg_color == 0);
18423         assert(d.time_label_fg_bold == 0);
18424         assert(d.percent_fg_color == 0);
18425         assert(d.percent_bg_color == 0);
18426         assert(d.percent_fg_bold == 0);
18427         assert(d.barbrace_fg_color == 0);
18428         assert(d.barbrace_bg_color == 0);
18429         assert(d.barbrace_fg_bold == 0);
18430         assert(d.bar_fg_color == 0);
18431         assert(d.bar_bg_color == 0);
18432         assert(d.bar_fg_bold == 0);
18433         assert(io.in == 0);
18434         assert(io.out == 1);
18435         assert(io.in_ready == 0);
18436         assert(io.out_ready == 0);
18437         assert(io.eof_in == 0);
18438         assert(io.eof_out == 0);
18439         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18440         /* assert(io.cbuf == 0x0); */
18441         assert(io.last_read == 0);
18442         assert(io.last_write == 0);
18443         assert(io.total_read == 0);
18444         assert(io.total_write == 0);
18445         assert(io.total_size == 0);
18446         assert(io.total_size_known == 0);
18447         assert(io.timeout == 250000);
18448 
18449         assert(test_parse_rc(out,1));
18450 
18451 #ifdef PRINT_DEBUG
18452         print();
18453 #endif
18454         assert(d.start_time == 0);
18455         assert(d.total_time == 0);
18456         assert(d.current_time == 0);
18457         assert(d.elapsed_time == 0);
18458         assert(d.percent_complete == 0);
18459         assert(d.display_interval == 1);
18460         assert(d.overtime_flag == 0);
18461         assert(d.k == 1024);
18462         assert(d.twiddle == '-');
18463         assert(d.manual_width == 0);
18464         assert(d.screen_width_minus_one == 0);
18465         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
18466         assert(d.display_datacount == 1);
18467         assert(d.display_throughput == 1);
18468         assert(d.display_time == 1);
18469         assert(d.display_percent == 1);
18470         assert(d.display_bar == 1);
18471         assert(d.display_summary == 1);
18472         assert(d.display_ansi == 0);
18473         assert(d.twiddle_fg_color == 0);
18474         assert(d.twiddle_bg_color == 0);
18475         assert(d.twiddle_fg_bold == 0);
18476         assert(d.datacount_fg_color == 0);
18477         assert(d.datacount_bg_color == 0);
18478         assert(d.datacount_fg_bold == 0);
18479         assert(d.throughput_label_fg_color == 0);
18480         assert(d.throughput_label_bg_color == 0);
18481         assert(d.throughput_label_fg_bold == 0);
18482         assert(d.throughput_fg_color == 0);
18483         assert(d.throughput_bg_color == 0);
18484         assert(d.throughput_fg_bold == 0);
18485         assert(d.time_label_fg_color == 0);
18486         assert(d.time_label_bg_color == 0);
18487         assert(d.time_label_fg_bold == 0);
18488         assert(d.percent_fg_color == 0);
18489         assert(d.percent_bg_color == 0);
18490         assert(d.percent_fg_bold == 0);
18491         assert(d.barbrace_fg_color == 0);
18492         assert(d.barbrace_bg_color == 0);
18493         assert(d.barbrace_fg_bold == 0);
18494         assert(d.bar_fg_color == 0);
18495         assert(d.bar_bg_color == 0);
18496         assert(d.bar_fg_bold == 0);
18497         assert(io.in == 0);
18498         assert(io.out == 1);
18499         assert(io.in_ready == 0);
18500         assert(io.out_ready == 0);
18501         assert(io.eof_in == 0);
18502         assert(io.eof_out == 0);
18503         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18504         /* assert(io.cbuf == 0x0); */
18505         assert(io.last_read == 0);
18506         assert(io.last_write == 0);
18507         assert(io.total_read == 0);
18508         assert(io.total_write == 0);
18509         assert(io.total_size == 0);
18510         assert(io.total_size_known == 0);
18511         assert(io.timeout == 250000);
18512 
18513         tmp_rcfile = fopen("test-rcfile.txt", "w");
18514         assert(tmp_rcfile != 0);
18515         fprintf(tmp_rcfile, "display-count: no");
18516         fclose(tmp_rcfile);
18517 
18518         assert(test_parse_rc(out,0));
18519 
18520 #ifdef PRINT_DEBUG
18521         print();
18522 #endif
18523         assert(d.start_time == 0);
18524         assert(d.total_time == 0);
18525         assert(d.current_time == 0);
18526         assert(d.elapsed_time == 0);
18527         assert(d.percent_complete == 0);
18528         assert(d.display_interval == 1);
18529         assert(d.overtime_flag == 0);
18530         assert(d.k == 1024);
18531         assert(d.twiddle == '-');
18532         assert(d.manual_width == 0);
18533         assert(d.screen_width_minus_one == 0);
18534         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
18535         assert(d.display_datacount == 0);
18536         assert(d.display_throughput == 1);
18537         assert(d.display_time == 1);
18538         assert(d.display_percent == 1);
18539         assert(d.display_bar == 1);
18540         assert(d.display_summary == 1);
18541         assert(d.display_ansi == 0);
18542         assert(d.twiddle_fg_color == 0);
18543         assert(d.twiddle_bg_color == 0);
18544         assert(d.twiddle_fg_bold == 0);
18545         assert(d.datacount_fg_color == 0);
18546         assert(d.datacount_bg_color == 0);
18547         assert(d.datacount_fg_bold == 0);
18548         assert(d.throughput_label_fg_color == 0);
18549         assert(d.throughput_label_bg_color == 0);
18550         assert(d.throughput_label_fg_bold == 0);
18551         assert(d.throughput_fg_color == 0);
18552         assert(d.throughput_bg_color == 0);
18553         assert(d.throughput_fg_bold == 0);
18554         assert(d.time_label_fg_color == 0);
18555         assert(d.time_label_bg_color == 0);
18556         assert(d.time_label_fg_bold == 0);
18557         assert(d.percent_fg_color == 0);
18558         assert(d.percent_bg_color == 0);
18559         assert(d.percent_fg_bold == 0);
18560         assert(d.barbrace_fg_color == 0);
18561         assert(d.barbrace_bg_color == 0);
18562         assert(d.barbrace_fg_bold == 0);
18563         assert(d.bar_fg_color == 0);
18564         assert(d.bar_bg_color == 0);
18565         assert(d.bar_fg_bold == 0);
18566         assert(io.in == 0);
18567         assert(io.out == 1);
18568         assert(io.in_ready == 0);
18569         assert(io.out_ready == 0);
18570         assert(io.eof_in == 0);
18571         assert(io.eof_out == 0);
18572         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18573         /* assert(io.cbuf == 0x0); */
18574         assert(io.last_read == 0);
18575         assert(io.last_write == 0);
18576         assert(io.total_read == 0);
18577         assert(io.total_write == 0);
18578         assert(io.total_size == 0);
18579         assert(io.total_size_known == 0);
18580         assert(io.timeout == 250000);
18581 
18582         tmp_rcfile = fopen("test-rcfile.txt", "w");
18583         assert(tmp_rcfile != 0);
18584         fprintf(tmp_rcfile, "display-count: yes");
18585         fclose(tmp_rcfile);
18586 
18587         assert(test_parse_rc(out,0));
18588 
18589 #ifdef PRINT_DEBUG
18590         print();
18591 #endif
18592         assert(d.start_time == 0);
18593         assert(d.total_time == 0);
18594         assert(d.current_time == 0);
18595         assert(d.elapsed_time == 0);
18596         assert(d.percent_complete == 0);
18597         assert(d.display_interval == 1);
18598         assert(d.overtime_flag == 0);
18599         assert(d.k == 1024);
18600         assert(d.twiddle == '-');
18601         assert(d.manual_width == 0);
18602         assert(d.screen_width_minus_one == 0);
18603         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
18604         assert(d.display_datacount == 1);
18605         assert(d.display_throughput == 1);
18606         assert(d.display_time == 1);
18607         assert(d.display_percent == 1);
18608         assert(d.display_bar == 1);
18609         assert(d.display_summary == 1);
18610         assert(d.display_ansi == 0);
18611         assert(d.twiddle_fg_color == 0);
18612         assert(d.twiddle_bg_color == 0);
18613         assert(d.twiddle_fg_bold == 0);
18614         assert(d.datacount_fg_color == 0);
18615         assert(d.datacount_bg_color == 0);
18616         assert(d.datacount_fg_bold == 0);
18617         assert(d.throughput_label_fg_color == 0);
18618         assert(d.throughput_label_bg_color == 0);
18619         assert(d.throughput_label_fg_bold == 0);
18620         assert(d.throughput_fg_color == 0);
18621         assert(d.throughput_bg_color == 0);
18622         assert(d.throughput_fg_bold == 0);
18623         assert(d.time_label_fg_color == 0);
18624         assert(d.time_label_bg_color == 0);
18625         assert(d.time_label_fg_bold == 0);
18626         assert(d.percent_fg_color == 0);
18627         assert(d.percent_bg_color == 0);
18628         assert(d.percent_fg_bold == 0);
18629         assert(d.barbrace_fg_color == 0);
18630         assert(d.barbrace_bg_color == 0);
18631         assert(d.barbrace_fg_bold == 0);
18632         assert(d.bar_fg_color == 0);
18633         assert(d.bar_bg_color == 0);
18634         assert(d.bar_fg_bold == 0);
18635         assert(io.in == 0);
18636         assert(io.out == 1);
18637         assert(io.in_ready == 0);
18638         assert(io.out_ready == 0);
18639         assert(io.eof_in == 0);
18640         assert(io.eof_out == 0);
18641         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18642         /* assert(io.cbuf == 0x0); */
18643         assert(io.last_read == 0);
18644         assert(io.last_write == 0);
18645         assert(io.total_read == 0);
18646         assert(io.total_write == 0);
18647         assert(io.total_size == 0);
18648         assert(io.total_size_known == 0);
18649         assert(io.timeout == 250000);
18650 
18651         tmp_rcfile = fopen("test-rcfile.txt", "w");
18652         assert(tmp_rcfile != 0);
18653         fprintf(tmp_rcfile, "display-count: n");
18654         fclose(tmp_rcfile);
18655 
18656         assert(test_parse_rc(out,0));
18657 
18658 #ifdef PRINT_DEBUG
18659         print();
18660 #endif
18661         assert(d.start_time == 0);
18662         assert(d.total_time == 0);
18663         assert(d.current_time == 0);
18664         assert(d.elapsed_time == 0);
18665         assert(d.percent_complete == 0);
18666         assert(d.display_interval == 1);
18667         assert(d.overtime_flag == 0);
18668         assert(d.k == 1024);
18669         assert(d.twiddle == '-');
18670         assert(d.manual_width == 0);
18671         assert(d.screen_width_minus_one == 0);
18672         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
18673         assert(d.display_datacount == 0);
18674         assert(d.display_throughput == 1);
18675         assert(d.display_time == 1);
18676         assert(d.display_percent == 1);
18677         assert(d.display_bar == 1);
18678         assert(d.display_summary == 1);
18679         assert(d.display_ansi == 0);
18680         assert(d.twiddle_fg_color == 0);
18681         assert(d.twiddle_bg_color == 0);
18682         assert(d.twiddle_fg_bold == 0);
18683         assert(d.datacount_fg_color == 0);
18684         assert(d.datacount_bg_color == 0);
18685         assert(d.datacount_fg_bold == 0);
18686         assert(d.throughput_label_fg_color == 0);
18687         assert(d.throughput_label_bg_color == 0);
18688         assert(d.throughput_label_fg_bold == 0);
18689         assert(d.throughput_fg_color == 0);
18690         assert(d.throughput_bg_color == 0);
18691         assert(d.throughput_fg_bold == 0);
18692         assert(d.time_label_fg_color == 0);
18693         assert(d.time_label_bg_color == 0);
18694         assert(d.time_label_fg_bold == 0);
18695         assert(d.percent_fg_color == 0);
18696         assert(d.percent_bg_color == 0);
18697         assert(d.percent_fg_bold == 0);
18698         assert(d.barbrace_fg_color == 0);
18699         assert(d.barbrace_bg_color == 0);
18700         assert(d.barbrace_fg_bold == 0);
18701         assert(d.bar_fg_color == 0);
18702         assert(d.bar_bg_color == 0);
18703         assert(d.bar_fg_bold == 0);
18704         assert(io.in == 0);
18705         assert(io.out == 1);
18706         assert(io.in_ready == 0);
18707         assert(io.out_ready == 0);
18708         assert(io.eof_in == 0);
18709         assert(io.eof_out == 0);
18710         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18711         /* assert(io.cbuf == 0x0); */
18712         assert(io.last_read == 0);
18713         assert(io.last_write == 0);
18714         assert(io.total_read == 0);
18715         assert(io.total_write == 0);
18716         assert(io.total_size == 0);
18717         assert(io.total_size_known == 0);
18718         assert(io.timeout == 250000);
18719 
18720         tmp_rcfile = fopen("test-rcfile.txt", "w");
18721         assert(tmp_rcfile != 0);
18722         fprintf(tmp_rcfile, "display-count: y");
18723         fclose(tmp_rcfile);
18724 
18725         assert(test_parse_rc(out,0));
18726 
18727 #ifdef PRINT_DEBUG
18728         print();
18729 #endif
18730         assert(d.start_time == 0);
18731         assert(d.total_time == 0);
18732         assert(d.current_time == 0);
18733         assert(d.elapsed_time == 0);
18734         assert(d.percent_complete == 0);
18735         assert(d.display_interval == 1);
18736         assert(d.overtime_flag == 0);
18737         assert(d.k == 1024);
18738         assert(d.twiddle == '-');
18739         assert(d.manual_width == 0);
18740         assert(d.screen_width_minus_one == 0);
18741         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
18742         assert(d.display_datacount == 1);
18743         assert(d.display_throughput == 1);
18744         assert(d.display_time == 1);
18745         assert(d.display_percent == 1);
18746         assert(d.display_bar == 1);
18747         assert(d.display_summary == 1);
18748         assert(d.display_ansi == 0);
18749         assert(d.twiddle_fg_color == 0);
18750         assert(d.twiddle_bg_color == 0);
18751         assert(d.twiddle_fg_bold == 0);
18752         assert(d.datacount_fg_color == 0);
18753         assert(d.datacount_bg_color == 0);
18754         assert(d.datacount_fg_bold == 0);
18755         assert(d.throughput_label_fg_color == 0);
18756         assert(d.throughput_label_bg_color == 0);
18757         assert(d.throughput_label_fg_bold == 0);
18758         assert(d.throughput_fg_color == 0);
18759         assert(d.throughput_bg_color == 0);
18760         assert(d.throughput_fg_bold == 0);
18761         assert(d.time_label_fg_color == 0);
18762         assert(d.time_label_bg_color == 0);
18763         assert(d.time_label_fg_bold == 0);
18764         assert(d.percent_fg_color == 0);
18765         assert(d.percent_bg_color == 0);
18766         assert(d.percent_fg_bold == 0);
18767         assert(d.barbrace_fg_color == 0);
18768         assert(d.barbrace_bg_color == 0);
18769         assert(d.barbrace_fg_bold == 0);
18770         assert(d.bar_fg_color == 0);
18771         assert(d.bar_bg_color == 0);
18772         assert(d.bar_fg_bold == 0);
18773         assert(io.in == 0);
18774         assert(io.out == 1);
18775         assert(io.in_ready == 0);
18776         assert(io.out_ready == 0);
18777         assert(io.eof_in == 0);
18778         assert(io.eof_out == 0);
18779         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18780         /* assert(io.cbuf == 0x0); */
18781         assert(io.last_read == 0);
18782         assert(io.last_write == 0);
18783         assert(io.total_read == 0);
18784         assert(io.total_write == 0);
18785         assert(io.total_size == 0);
18786         assert(io.total_size_known == 0);
18787         assert(io.timeout == 250000);
18788 
18789         tmp_rcfile = fopen("test-rcfile.txt", "w");
18790         assert(tmp_rcfile != 0);
18791         fprintf(tmp_rcfile, "display-count: false");
18792         fclose(tmp_rcfile);
18793 
18794         assert(test_parse_rc(out,0));
18795 
18796 #ifdef PRINT_DEBUG
18797         print();
18798 #endif
18799         assert(d.start_time == 0);
18800         assert(d.total_time == 0);
18801         assert(d.current_time == 0);
18802         assert(d.elapsed_time == 0);
18803         assert(d.percent_complete == 0);
18804         assert(d.display_interval == 1);
18805         assert(d.overtime_flag == 0);
18806         assert(d.k == 1024);
18807         assert(d.twiddle == '-');
18808         assert(d.manual_width == 0);
18809         assert(d.screen_width_minus_one == 0);
18810         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
18811         assert(d.display_datacount == 0);
18812         assert(d.display_throughput == 1);
18813         assert(d.display_time == 1);
18814         assert(d.display_percent == 1);
18815         assert(d.display_bar == 1);
18816         assert(d.display_summary == 1);
18817         assert(d.display_ansi == 0);
18818         assert(d.twiddle_fg_color == 0);
18819         assert(d.twiddle_bg_color == 0);
18820         assert(d.twiddle_fg_bold == 0);
18821         assert(d.datacount_fg_color == 0);
18822         assert(d.datacount_bg_color == 0);
18823         assert(d.datacount_fg_bold == 0);
18824         assert(d.throughput_label_fg_color == 0);
18825         assert(d.throughput_label_bg_color == 0);
18826         assert(d.throughput_label_fg_bold == 0);
18827         assert(d.throughput_fg_color == 0);
18828         assert(d.throughput_bg_color == 0);
18829         assert(d.throughput_fg_bold == 0);
18830         assert(d.time_label_fg_color == 0);
18831         assert(d.time_label_bg_color == 0);
18832         assert(d.time_label_fg_bold == 0);
18833         assert(d.percent_fg_color == 0);
18834         assert(d.percent_bg_color == 0);
18835         assert(d.percent_fg_bold == 0);
18836         assert(d.barbrace_fg_color == 0);
18837         assert(d.barbrace_bg_color == 0);
18838         assert(d.barbrace_fg_bold == 0);
18839         assert(d.bar_fg_color == 0);
18840         assert(d.bar_bg_color == 0);
18841         assert(d.bar_fg_bold == 0);
18842         assert(io.in == 0);
18843         assert(io.out == 1);
18844         assert(io.in_ready == 0);
18845         assert(io.out_ready == 0);
18846         assert(io.eof_in == 0);
18847         assert(io.eof_out == 0);
18848         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18849         /* assert(io.cbuf == 0x0); */
18850         assert(io.last_read == 0);
18851         assert(io.last_write == 0);
18852         assert(io.total_read == 0);
18853         assert(io.total_write == 0);
18854         assert(io.total_size == 0);
18855         assert(io.total_size_known == 0);
18856         assert(io.timeout == 250000);
18857 
18858         tmp_rcfile = fopen("test-rcfile.txt", "w");
18859         assert(tmp_rcfile != 0);
18860         fprintf(tmp_rcfile, "display-count: true");
18861         fclose(tmp_rcfile);
18862 
18863         assert(test_parse_rc(out,0));
18864 
18865 #ifdef PRINT_DEBUG
18866         print();
18867 #endif
18868         assert(d.start_time == 0);
18869         assert(d.total_time == 0);
18870         assert(d.current_time == 0);
18871         assert(d.elapsed_time == 0);
18872         assert(d.percent_complete == 0);
18873         assert(d.display_interval == 1);
18874         assert(d.overtime_flag == 0);
18875         assert(d.k == 1024);
18876         assert(d.twiddle == '-');
18877         assert(d.manual_width == 0);
18878         assert(d.screen_width_minus_one == 0);
18879         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
18880         assert(d.display_datacount == 1);
18881         assert(d.display_throughput == 1);
18882         assert(d.display_time == 1);
18883         assert(d.display_percent == 1);
18884         assert(d.display_bar == 1);
18885         assert(d.display_summary == 1);
18886         assert(d.display_ansi == 0);
18887         assert(d.twiddle_fg_color == 0);
18888         assert(d.twiddle_bg_color == 0);
18889         assert(d.twiddle_fg_bold == 0);
18890         assert(d.datacount_fg_color == 0);
18891         assert(d.datacount_bg_color == 0);
18892         assert(d.datacount_fg_bold == 0);
18893         assert(d.throughput_label_fg_color == 0);
18894         assert(d.throughput_label_bg_color == 0);
18895         assert(d.throughput_label_fg_bold == 0);
18896         assert(d.throughput_fg_color == 0);
18897         assert(d.throughput_bg_color == 0);
18898         assert(d.throughput_fg_bold == 0);
18899         assert(d.time_label_fg_color == 0);
18900         assert(d.time_label_bg_color == 0);
18901         assert(d.time_label_fg_bold == 0);
18902         assert(d.percent_fg_color == 0);
18903         assert(d.percent_bg_color == 0);
18904         assert(d.percent_fg_bold == 0);
18905         assert(d.barbrace_fg_color == 0);
18906         assert(d.barbrace_bg_color == 0);
18907         assert(d.barbrace_fg_bold == 0);
18908         assert(d.bar_fg_color == 0);
18909         assert(d.bar_bg_color == 0);
18910         assert(d.bar_fg_bold == 0);
18911         assert(io.in == 0);
18912         assert(io.out == 1);
18913         assert(io.in_ready == 0);
18914         assert(io.out_ready == 0);
18915         assert(io.eof_in == 0);
18916         assert(io.eof_out == 0);
18917         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18918         /* assert(io.cbuf == 0x0); */
18919         assert(io.last_read == 0);
18920         assert(io.last_write == 0);
18921         assert(io.total_read == 0);
18922         assert(io.total_write == 0);
18923         assert(io.total_size == 0);
18924         assert(io.total_size_known == 0);
18925         assert(io.timeout == 250000);
18926 
18927         tmp_rcfile = fopen("test-rcfile.txt", "w");
18928         assert(tmp_rcfile != 0);
18929         fprintf(tmp_rcfile, "display-count: f");
18930         fclose(tmp_rcfile);
18931 
18932         assert(test_parse_rc(out,0));
18933 
18934 #ifdef PRINT_DEBUG
18935         print();
18936 #endif
18937         assert(d.start_time == 0);
18938         assert(d.total_time == 0);
18939         assert(d.current_time == 0);
18940         assert(d.elapsed_time == 0);
18941         assert(d.percent_complete == 0);
18942         assert(d.display_interval == 1);
18943         assert(d.overtime_flag == 0);
18944         assert(d.k == 1024);
18945         assert(d.twiddle == '-');
18946         assert(d.manual_width == 0);
18947         assert(d.screen_width_minus_one == 0);
18948         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
18949         assert(d.display_datacount == 0);
18950         assert(d.display_throughput == 1);
18951         assert(d.display_time == 1);
18952         assert(d.display_percent == 1);
18953         assert(d.display_bar == 1);
18954         assert(d.display_summary == 1);
18955         assert(d.display_ansi == 0);
18956         assert(d.twiddle_fg_color == 0);
18957         assert(d.twiddle_bg_color == 0);
18958         assert(d.twiddle_fg_bold == 0);
18959         assert(d.datacount_fg_color == 0);
18960         assert(d.datacount_bg_color == 0);
18961         assert(d.datacount_fg_bold == 0);
18962         assert(d.throughput_label_fg_color == 0);
18963         assert(d.throughput_label_bg_color == 0);
18964         assert(d.throughput_label_fg_bold == 0);
18965         assert(d.throughput_fg_color == 0);
18966         assert(d.throughput_bg_color == 0);
18967         assert(d.throughput_fg_bold == 0);
18968         assert(d.time_label_fg_color == 0);
18969         assert(d.time_label_bg_color == 0);
18970         assert(d.time_label_fg_bold == 0);
18971         assert(d.percent_fg_color == 0);
18972         assert(d.percent_bg_color == 0);
18973         assert(d.percent_fg_bold == 0);
18974         assert(d.barbrace_fg_color == 0);
18975         assert(d.barbrace_bg_color == 0);
18976         assert(d.barbrace_fg_bold == 0);
18977         assert(d.bar_fg_color == 0);
18978         assert(d.bar_bg_color == 0);
18979         assert(d.bar_fg_bold == 0);
18980         assert(io.in == 0);
18981         assert(io.out == 1);
18982         assert(io.in_ready == 0);
18983         assert(io.out_ready == 0);
18984         assert(io.eof_in == 0);
18985         assert(io.eof_out == 0);
18986         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
18987         /* assert(io.cbuf == 0x0); */
18988         assert(io.last_read == 0);
18989         assert(io.last_write == 0);
18990         assert(io.total_read == 0);
18991         assert(io.total_write == 0);
18992         assert(io.total_size == 0);
18993         assert(io.total_size_known == 0);
18994         assert(io.timeout == 250000);
18995 
18996         tmp_rcfile = fopen("test-rcfile.txt", "w");
18997         assert(tmp_rcfile != 0);
18998         fprintf(tmp_rcfile, "display-count: t");
18999         fclose(tmp_rcfile);
19000 
19001         assert(test_parse_rc(out,0));
19002 
19003 #ifdef PRINT_DEBUG
19004         print();
19005 #endif
19006         assert(d.start_time == 0);
19007         assert(d.total_time == 0);
19008         assert(d.current_time == 0);
19009         assert(d.elapsed_time == 0);
19010         assert(d.percent_complete == 0);
19011         assert(d.display_interval == 1);
19012         assert(d.overtime_flag == 0);
19013         assert(d.k == 1024);
19014         assert(d.twiddle == '-');
19015         assert(d.manual_width == 0);
19016         assert(d.screen_width_minus_one == 0);
19017         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19018         assert(d.display_datacount == 1);
19019         assert(d.display_throughput == 1);
19020         assert(d.display_time == 1);
19021         assert(d.display_percent == 1);
19022         assert(d.display_bar == 1);
19023         assert(d.display_summary == 1);
19024         assert(d.display_ansi == 0);
19025         assert(d.twiddle_fg_color == 0);
19026         assert(d.twiddle_bg_color == 0);
19027         assert(d.twiddle_fg_bold == 0);
19028         assert(d.datacount_fg_color == 0);
19029         assert(d.datacount_bg_color == 0);
19030         assert(d.datacount_fg_bold == 0);
19031         assert(d.throughput_label_fg_color == 0);
19032         assert(d.throughput_label_bg_color == 0);
19033         assert(d.throughput_label_fg_bold == 0);
19034         assert(d.throughput_fg_color == 0);
19035         assert(d.throughput_bg_color == 0);
19036         assert(d.throughput_fg_bold == 0);
19037         assert(d.time_label_fg_color == 0);
19038         assert(d.time_label_bg_color == 0);
19039         assert(d.time_label_fg_bold == 0);
19040         assert(d.percent_fg_color == 0);
19041         assert(d.percent_bg_color == 0);
19042         assert(d.percent_fg_bold == 0);
19043         assert(d.barbrace_fg_color == 0);
19044         assert(d.barbrace_bg_color == 0);
19045         assert(d.barbrace_fg_bold == 0);
19046         assert(d.bar_fg_color == 0);
19047         assert(d.bar_bg_color == 0);
19048         assert(d.bar_fg_bold == 0);
19049         assert(io.in == 0);
19050         assert(io.out == 1);
19051         assert(io.in_ready == 0);
19052         assert(io.out_ready == 0);
19053         assert(io.eof_in == 0);
19054         assert(io.eof_out == 0);
19055         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19056         /* assert(io.cbuf == 0x0); */
19057         assert(io.last_read == 0);
19058         assert(io.last_write == 0);
19059         assert(io.total_read == 0);
19060         assert(io.total_write == 0);
19061         assert(io.total_size == 0);
19062         assert(io.total_size_known == 0);
19063         assert(io.timeout == 250000);
19064 
19065         tmp_rcfile = fopen("test-rcfile.txt", "w");
19066         assert(tmp_rcfile != 0);
19067         fprintf(tmp_rcfile, "display-count: 0");
19068         fclose(tmp_rcfile);
19069 
19070         assert(test_parse_rc(out,0));
19071 
19072 #ifdef PRINT_DEBUG
19073         print();
19074 #endif
19075         assert(d.start_time == 0);
19076         assert(d.total_time == 0);
19077         assert(d.current_time == 0);
19078         assert(d.elapsed_time == 0);
19079         assert(d.percent_complete == 0);
19080         assert(d.display_interval == 1);
19081         assert(d.overtime_flag == 0);
19082         assert(d.k == 1024);
19083         assert(d.twiddle == '-');
19084         assert(d.manual_width == 0);
19085         assert(d.screen_width_minus_one == 0);
19086         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19087         assert(d.display_datacount == 0);
19088         assert(d.display_throughput == 1);
19089         assert(d.display_time == 1);
19090         assert(d.display_percent == 1);
19091         assert(d.display_bar == 1);
19092         assert(d.display_summary == 1);
19093         assert(d.display_ansi == 0);
19094         assert(d.twiddle_fg_color == 0);
19095         assert(d.twiddle_bg_color == 0);
19096         assert(d.twiddle_fg_bold == 0);
19097         assert(d.datacount_fg_color == 0);
19098         assert(d.datacount_bg_color == 0);
19099         assert(d.datacount_fg_bold == 0);
19100         assert(d.throughput_label_fg_color == 0);
19101         assert(d.throughput_label_bg_color == 0);
19102         assert(d.throughput_label_fg_bold == 0);
19103         assert(d.throughput_fg_color == 0);
19104         assert(d.throughput_bg_color == 0);
19105         assert(d.throughput_fg_bold == 0);
19106         assert(d.time_label_fg_color == 0);
19107         assert(d.time_label_bg_color == 0);
19108         assert(d.time_label_fg_bold == 0);
19109         assert(d.percent_fg_color == 0);
19110         assert(d.percent_bg_color == 0);
19111         assert(d.percent_fg_bold == 0);
19112         assert(d.barbrace_fg_color == 0);
19113         assert(d.barbrace_bg_color == 0);
19114         assert(d.barbrace_fg_bold == 0);
19115         assert(d.bar_fg_color == 0);
19116         assert(d.bar_bg_color == 0);
19117         assert(d.bar_fg_bold == 0);
19118         assert(io.in == 0);
19119         assert(io.out == 1);
19120         assert(io.in_ready == 0);
19121         assert(io.out_ready == 0);
19122         assert(io.eof_in == 0);
19123         assert(io.eof_out == 0);
19124         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19125         /* assert(io.cbuf == 0x0); */
19126         assert(io.last_read == 0);
19127         assert(io.last_write == 0);
19128         assert(io.total_read == 0);
19129         assert(io.total_write == 0);
19130         assert(io.total_size == 0);
19131         assert(io.total_size_known == 0);
19132         assert(io.timeout == 250000);
19133 
19134         tmp_rcfile = fopen("test-rcfile.txt", "w");
19135         assert(tmp_rcfile != 0);
19136         fprintf(tmp_rcfile, "display-count: 1");
19137         fclose(tmp_rcfile);
19138 
19139         assert(test_parse_rc(out,0));
19140 
19141 #ifdef PRINT_DEBUG
19142         print();
19143 #endif
19144         assert(d.start_time == 0);
19145         assert(d.total_time == 0);
19146         assert(d.current_time == 0);
19147         assert(d.elapsed_time == 0);
19148         assert(d.percent_complete == 0);
19149         assert(d.display_interval == 1);
19150         assert(d.overtime_flag == 0);
19151         assert(d.k == 1024);
19152         assert(d.twiddle == '-');
19153         assert(d.manual_width == 0);
19154         assert(d.screen_width_minus_one == 0);
19155         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19156         assert(d.display_datacount == 1);
19157         assert(d.display_throughput == 1);
19158         assert(d.display_time == 1);
19159         assert(d.display_percent == 1);
19160         assert(d.display_bar == 1);
19161         assert(d.display_summary == 1);
19162         assert(d.display_ansi == 0);
19163         assert(d.twiddle_fg_color == 0);
19164         assert(d.twiddle_bg_color == 0);
19165         assert(d.twiddle_fg_bold == 0);
19166         assert(d.datacount_fg_color == 0);
19167         assert(d.datacount_bg_color == 0);
19168         assert(d.datacount_fg_bold == 0);
19169         assert(d.throughput_label_fg_color == 0);
19170         assert(d.throughput_label_bg_color == 0);
19171         assert(d.throughput_label_fg_bold == 0);
19172         assert(d.throughput_fg_color == 0);
19173         assert(d.throughput_bg_color == 0);
19174         assert(d.throughput_fg_bold == 0);
19175         assert(d.time_label_fg_color == 0);
19176         assert(d.time_label_bg_color == 0);
19177         assert(d.time_label_fg_bold == 0);
19178         assert(d.percent_fg_color == 0);
19179         assert(d.percent_bg_color == 0);
19180         assert(d.percent_fg_bold == 0);
19181         assert(d.barbrace_fg_color == 0);
19182         assert(d.barbrace_bg_color == 0);
19183         assert(d.barbrace_fg_bold == 0);
19184         assert(d.bar_fg_color == 0);
19185         assert(d.bar_bg_color == 0);
19186         assert(d.bar_fg_bold == 0);
19187         assert(io.in == 0);
19188         assert(io.out == 1);
19189         assert(io.in_ready == 0);
19190         assert(io.out_ready == 0);
19191         assert(io.eof_in == 0);
19192         assert(io.eof_out == 0);
19193         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19194         /* assert(io.cbuf == 0x0); */
19195         assert(io.last_read == 0);
19196         assert(io.last_write == 0);
19197         assert(io.total_read == 0);
19198         assert(io.total_write == 0);
19199         assert(io.total_size == 0);
19200         assert(io.total_size_known == 0);
19201         assert(io.timeout == 250000);
19202 
19203         tmp_rcfile = fopen("test-rcfile.txt", "w");
19204         assert(tmp_rcfile != 0);
19205         fprintf(tmp_rcfile, "display-count: off");
19206         fclose(tmp_rcfile);
19207 
19208         assert(test_parse_rc(out,0));
19209 
19210 #ifdef PRINT_DEBUG
19211         print();
19212 #endif
19213         assert(d.start_time == 0);
19214         assert(d.total_time == 0);
19215         assert(d.current_time == 0);
19216         assert(d.elapsed_time == 0);
19217         assert(d.percent_complete == 0);
19218         assert(d.display_interval == 1);
19219         assert(d.overtime_flag == 0);
19220         assert(d.k == 1024);
19221         assert(d.twiddle == '-');
19222         assert(d.manual_width == 0);
19223         assert(d.screen_width_minus_one == 0);
19224         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19225         assert(d.display_datacount == 0);
19226         assert(d.display_throughput == 1);
19227         assert(d.display_time == 1);
19228         assert(d.display_percent == 1);
19229         assert(d.display_bar == 1);
19230         assert(d.display_summary == 1);
19231         assert(d.display_ansi == 0);
19232         assert(d.twiddle_fg_color == 0);
19233         assert(d.twiddle_bg_color == 0);
19234         assert(d.twiddle_fg_bold == 0);
19235         assert(d.datacount_fg_color == 0);
19236         assert(d.datacount_bg_color == 0);
19237         assert(d.datacount_fg_bold == 0);
19238         assert(d.throughput_label_fg_color == 0);
19239         assert(d.throughput_label_bg_color == 0);
19240         assert(d.throughput_label_fg_bold == 0);
19241         assert(d.throughput_fg_color == 0);
19242         assert(d.throughput_bg_color == 0);
19243         assert(d.throughput_fg_bold == 0);
19244         assert(d.time_label_fg_color == 0);
19245         assert(d.time_label_bg_color == 0);
19246         assert(d.time_label_fg_bold == 0);
19247         assert(d.percent_fg_color == 0);
19248         assert(d.percent_bg_color == 0);
19249         assert(d.percent_fg_bold == 0);
19250         assert(d.barbrace_fg_color == 0);
19251         assert(d.barbrace_bg_color == 0);
19252         assert(d.barbrace_fg_bold == 0);
19253         assert(d.bar_fg_color == 0);
19254         assert(d.bar_bg_color == 0);
19255         assert(d.bar_fg_bold == 0);
19256         assert(io.in == 0);
19257         assert(io.out == 1);
19258         assert(io.in_ready == 0);
19259         assert(io.out_ready == 0);
19260         assert(io.eof_in == 0);
19261         assert(io.eof_out == 0);
19262         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19263         /* assert(io.cbuf == 0x0); */
19264         assert(io.last_read == 0);
19265         assert(io.last_write == 0);
19266         assert(io.total_read == 0);
19267         assert(io.total_write == 0);
19268         assert(io.total_size == 0);
19269         assert(io.total_size_known == 0);
19270         assert(io.timeout == 250000);
19271 
19272         tmp_rcfile = fopen("test-rcfile.txt", "w");
19273         assert(tmp_rcfile != 0);
19274         fprintf(tmp_rcfile, "display-count: on");
19275         fclose(tmp_rcfile);
19276 
19277         assert(test_parse_rc(out,0));
19278 
19279 #ifdef PRINT_DEBUG
19280         print();
19281 #endif
19282         assert(d.start_time == 0);
19283         assert(d.total_time == 0);
19284         assert(d.current_time == 0);
19285         assert(d.elapsed_time == 0);
19286         assert(d.percent_complete == 0);
19287         assert(d.display_interval == 1);
19288         assert(d.overtime_flag == 0);
19289         assert(d.k == 1024);
19290         assert(d.twiddle == '-');
19291         assert(d.manual_width == 0);
19292         assert(d.screen_width_minus_one == 0);
19293         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19294         assert(d.display_datacount == 1);
19295         assert(d.display_throughput == 1);
19296         assert(d.display_time == 1);
19297         assert(d.display_percent == 1);
19298         assert(d.display_bar == 1);
19299         assert(d.display_summary == 1);
19300         assert(d.display_ansi == 0);
19301         assert(d.twiddle_fg_color == 0);
19302         assert(d.twiddle_bg_color == 0);
19303         assert(d.twiddle_fg_bold == 0);
19304         assert(d.datacount_fg_color == 0);
19305         assert(d.datacount_bg_color == 0);
19306         assert(d.datacount_fg_bold == 0);
19307         assert(d.throughput_label_fg_color == 0);
19308         assert(d.throughput_label_bg_color == 0);
19309         assert(d.throughput_label_fg_bold == 0);
19310         assert(d.throughput_fg_color == 0);
19311         assert(d.throughput_bg_color == 0);
19312         assert(d.throughput_fg_bold == 0);
19313         assert(d.time_label_fg_color == 0);
19314         assert(d.time_label_bg_color == 0);
19315         assert(d.time_label_fg_bold == 0);
19316         assert(d.percent_fg_color == 0);
19317         assert(d.percent_bg_color == 0);
19318         assert(d.percent_fg_bold == 0);
19319         assert(d.barbrace_fg_color == 0);
19320         assert(d.barbrace_bg_color == 0);
19321         assert(d.barbrace_fg_bold == 0);
19322         assert(d.bar_fg_color == 0);
19323         assert(d.bar_bg_color == 0);
19324         assert(d.bar_fg_bold == 0);
19325         assert(io.in == 0);
19326         assert(io.out == 1);
19327         assert(io.in_ready == 0);
19328         assert(io.out_ready == 0);
19329         assert(io.eof_in == 0);
19330         assert(io.eof_out == 0);
19331         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19332         /* assert(io.cbuf == 0x0); */
19333         assert(io.last_read == 0);
19334         assert(io.last_write == 0);
19335         assert(io.total_read == 0);
19336         assert(io.total_write == 0);
19337         assert(io.total_size == 0);
19338         assert(io.total_size_known == 0);
19339         assert(io.timeout == 250000);
19340 
19341         assert(unlink("./test-rcfile.txt") == 0);
19342 }
19343 
19344 void test129(FILE *out)
19345 {
19346         FILE *tmp_rcfile = 0;
19347         
19348         tmp_rcfile = fopen("test-rcfile.txt", "w");
19349         assert(tmp_rcfile != 0);
19350         fprintf(tmp_rcfile, "display-throughput: Sjkhg");
19351         fclose(tmp_rcfile);
19352 
19353         clear_errno();
19354         ioInit();
19355         displayInit();
19356 
19357 #ifdef PRINT_DEBUG
19358         print();
19359 #endif
19360         assert(d.start_time == 0);
19361         assert(d.total_time == 0);
19362         assert(d.current_time == 0);
19363         assert(d.elapsed_time == 0);
19364         assert(d.percent_complete == 0);
19365         assert(d.display_interval == 1);
19366         assert(d.overtime_flag == 0);
19367         assert(d.k == 1024);
19368         assert(d.twiddle == '-');
19369         assert(d.manual_width == 0);
19370         assert(d.screen_width_minus_one == 0);
19371         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19372         assert(d.display_datacount == 1);
19373         assert(d.display_throughput == 1);
19374         assert(d.display_time == 1);
19375         assert(d.display_percent == 1);
19376         assert(d.display_bar == 1);
19377         assert(d.display_summary == 1);
19378         assert(d.display_ansi == 0);
19379         assert(d.twiddle_fg_color == 0);
19380         assert(d.twiddle_bg_color == 0);
19381         assert(d.twiddle_fg_bold == 0);
19382         assert(d.datacount_fg_color == 0);
19383         assert(d.datacount_bg_color == 0);
19384         assert(d.datacount_fg_bold == 0);
19385         assert(d.throughput_label_fg_color == 0);
19386         assert(d.throughput_label_bg_color == 0);
19387         assert(d.throughput_label_fg_bold == 0);
19388         assert(d.throughput_fg_color == 0);
19389         assert(d.throughput_bg_color == 0);
19390         assert(d.throughput_fg_bold == 0);
19391         assert(d.time_label_fg_color == 0);
19392         assert(d.time_label_bg_color == 0);
19393         assert(d.time_label_fg_bold == 0);
19394         assert(d.percent_fg_color == 0);
19395         assert(d.percent_bg_color == 0);
19396         assert(d.percent_fg_bold == 0);
19397         assert(d.barbrace_fg_color == 0);
19398         assert(d.barbrace_bg_color == 0);
19399         assert(d.barbrace_fg_bold == 0);
19400         assert(d.bar_fg_color == 0);
19401         assert(d.bar_bg_color == 0);
19402         assert(d.bar_fg_bold == 0);
19403         assert(io.in == 0);
19404         assert(io.out == 1);
19405         assert(io.in_ready == 0);
19406         assert(io.out_ready == 0);
19407         assert(io.eof_in == 0);
19408         assert(io.eof_out == 0);
19409         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19410         /* assert(io.cbuf == 0x0); */
19411         assert(io.last_read == 0);
19412         assert(io.last_write == 0);
19413         assert(io.total_read == 0);
19414         assert(io.total_write == 0);
19415         assert(io.total_size == 0);
19416         assert(io.total_size_known == 0);
19417         assert(io.timeout == 250000);
19418 
19419         assert(test_parse_rc(out,1));
19420 
19421 #ifdef PRINT_DEBUG
19422         print();
19423 #endif
19424         assert(d.start_time == 0);
19425         assert(d.total_time == 0);
19426         assert(d.current_time == 0);
19427         assert(d.elapsed_time == 0);
19428         assert(d.percent_complete == 0);
19429         assert(d.display_interval == 1);
19430         assert(d.overtime_flag == 0);
19431         assert(d.k == 1024);
19432         assert(d.twiddle == '-');
19433         assert(d.manual_width == 0);
19434         assert(d.screen_width_minus_one == 0);
19435         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19436         assert(d.display_datacount == 1);
19437         assert(d.display_throughput == 1);
19438         assert(d.display_time == 1);
19439         assert(d.display_percent == 1);
19440         assert(d.display_bar == 1);
19441         assert(d.display_summary == 1);
19442         assert(d.display_ansi == 0);
19443         assert(d.twiddle_fg_color == 0);
19444         assert(d.twiddle_bg_color == 0);
19445         assert(d.twiddle_fg_bold == 0);
19446         assert(d.datacount_fg_color == 0);
19447         assert(d.datacount_bg_color == 0);
19448         assert(d.datacount_fg_bold == 0);
19449         assert(d.throughput_label_fg_color == 0);
19450         assert(d.throughput_label_bg_color == 0);
19451         assert(d.throughput_label_fg_bold == 0);
19452         assert(d.throughput_fg_color == 0);
19453         assert(d.throughput_bg_color == 0);
19454         assert(d.throughput_fg_bold == 0);
19455         assert(d.time_label_fg_color == 0);
19456         assert(d.time_label_bg_color == 0);
19457         assert(d.time_label_fg_bold == 0);
19458         assert(d.percent_fg_color == 0);
19459         assert(d.percent_bg_color == 0);
19460         assert(d.percent_fg_bold == 0);
19461         assert(d.barbrace_fg_color == 0);
19462         assert(d.barbrace_bg_color == 0);
19463         assert(d.barbrace_fg_bold == 0);
19464         assert(d.bar_fg_color == 0);
19465         assert(d.bar_bg_color == 0);
19466         assert(d.bar_fg_bold == 0);
19467         assert(io.in == 0);
19468         assert(io.out == 1);
19469         assert(io.in_ready == 0);
19470         assert(io.out_ready == 0);
19471         assert(io.eof_in == 0);
19472         assert(io.eof_out == 0);
19473         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19474         /* assert(io.cbuf == 0x0); */
19475         assert(io.last_read == 0);
19476         assert(io.last_write == 0);
19477         assert(io.total_read == 0);
19478         assert(io.total_write == 0);
19479         assert(io.total_size == 0);
19480         assert(io.total_size_known == 0);
19481         assert(io.timeout == 250000);
19482 
19483         tmp_rcfile = fopen("test-rcfile.txt", "w");
19484         assert(tmp_rcfile != 0);
19485         fprintf(tmp_rcfile, "display-throughput: no");
19486         fclose(tmp_rcfile);
19487 
19488         assert(test_parse_rc(out,0));
19489 
19490 #ifdef PRINT_DEBUG
19491         print();
19492 #endif
19493         assert(d.start_time == 0);
19494         assert(d.total_time == 0);
19495         assert(d.current_time == 0);
19496         assert(d.elapsed_time == 0);
19497         assert(d.percent_complete == 0);
19498         assert(d.display_interval == 1);
19499         assert(d.overtime_flag == 0);
19500         assert(d.k == 1024);
19501         assert(d.twiddle == '-');
19502         assert(d.manual_width == 0);
19503         assert(d.screen_width_minus_one == 0);
19504         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19505         assert(d.display_datacount == 1);
19506         assert(d.display_throughput == 0);
19507         assert(d.display_time == 1);
19508         assert(d.display_percent == 1);
19509         assert(d.display_bar == 1);
19510         assert(d.display_summary == 1);
19511         assert(d.display_ansi == 0);
19512         assert(d.twiddle_fg_color == 0);
19513         assert(d.twiddle_bg_color == 0);
19514         assert(d.twiddle_fg_bold == 0);
19515         assert(d.datacount_fg_color == 0);
19516         assert(d.datacount_bg_color == 0);
19517         assert(d.datacount_fg_bold == 0);
19518         assert(d.throughput_label_fg_color == 0);
19519         assert(d.throughput_label_bg_color == 0);
19520         assert(d.throughput_label_fg_bold == 0);
19521         assert(d.throughput_fg_color == 0);
19522         assert(d.throughput_bg_color == 0);
19523         assert(d.throughput_fg_bold == 0);
19524         assert(d.time_label_fg_color == 0);
19525         assert(d.time_label_bg_color == 0);
19526         assert(d.time_label_fg_bold == 0);
19527         assert(d.percent_fg_color == 0);
19528         assert(d.percent_bg_color == 0);
19529         assert(d.percent_fg_bold == 0);
19530         assert(d.barbrace_fg_color == 0);
19531         assert(d.barbrace_bg_color == 0);
19532         assert(d.barbrace_fg_bold == 0);
19533         assert(d.bar_fg_color == 0);
19534         assert(d.bar_bg_color == 0);
19535         assert(d.bar_fg_bold == 0);
19536         assert(io.in == 0);
19537         assert(io.out == 1);
19538         assert(io.in_ready == 0);
19539         assert(io.out_ready == 0);
19540         assert(io.eof_in == 0);
19541         assert(io.eof_out == 0);
19542         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19543         /* assert(io.cbuf == 0x0); */
19544         assert(io.last_read == 0);
19545         assert(io.last_write == 0);
19546         assert(io.total_read == 0);
19547         assert(io.total_write == 0);
19548         assert(io.total_size == 0);
19549         assert(io.total_size_known == 0);
19550         assert(io.timeout == 250000);
19551 
19552         tmp_rcfile = fopen("test-rcfile.txt", "w");
19553         assert(tmp_rcfile != 0);
19554         fprintf(tmp_rcfile, "display-throughput: yes");
19555         fclose(tmp_rcfile);
19556 
19557         assert(test_parse_rc(out,0));
19558 
19559 #ifdef PRINT_DEBUG
19560         print();
19561 #endif
19562         assert(d.start_time == 0);
19563         assert(d.total_time == 0);
19564         assert(d.current_time == 0);
19565         assert(d.elapsed_time == 0);
19566         assert(d.percent_complete == 0);
19567         assert(d.display_interval == 1);
19568         assert(d.overtime_flag == 0);
19569         assert(d.k == 1024);
19570         assert(d.twiddle == '-');
19571         assert(d.manual_width == 0);
19572         assert(d.screen_width_minus_one == 0);
19573         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19574         assert(d.display_datacount == 1);
19575         assert(d.display_throughput == 1);
19576         assert(d.display_time == 1);
19577         assert(d.display_percent == 1);
19578         assert(d.display_bar == 1);
19579         assert(d.display_summary == 1);
19580         assert(d.display_ansi == 0);
19581         assert(d.twiddle_fg_color == 0);
19582         assert(d.twiddle_bg_color == 0);
19583         assert(d.twiddle_fg_bold == 0);
19584         assert(d.datacount_fg_color == 0);
19585         assert(d.datacount_bg_color == 0);
19586         assert(d.datacount_fg_bold == 0);
19587         assert(d.throughput_label_fg_color == 0);
19588         assert(d.throughput_label_bg_color == 0);
19589         assert(d.throughput_label_fg_bold == 0);
19590         assert(d.throughput_fg_color == 0);
19591         assert(d.throughput_bg_color == 0);
19592         assert(d.throughput_fg_bold == 0);
19593         assert(d.time_label_fg_color == 0);
19594         assert(d.time_label_bg_color == 0);
19595         assert(d.time_label_fg_bold == 0);
19596         assert(d.percent_fg_color == 0);
19597         assert(d.percent_bg_color == 0);
19598         assert(d.percent_fg_bold == 0);
19599         assert(d.barbrace_fg_color == 0);
19600         assert(d.barbrace_bg_color == 0);
19601         assert(d.barbrace_fg_bold == 0);
19602         assert(d.bar_fg_color == 0);
19603         assert(d.bar_bg_color == 0);
19604         assert(d.bar_fg_bold == 0);
19605         assert(io.in == 0);
19606         assert(io.out == 1);
19607         assert(io.in_ready == 0);
19608         assert(io.out_ready == 0);
19609         assert(io.eof_in == 0);
19610         assert(io.eof_out == 0);
19611         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19612         /* assert(io.cbuf == 0x0); */
19613         assert(io.last_read == 0);
19614         assert(io.last_write == 0);
19615         assert(io.total_read == 0);
19616         assert(io.total_write == 0);
19617         assert(io.total_size == 0);
19618         assert(io.total_size_known == 0);
19619         assert(io.timeout == 250000);
19620 
19621         tmp_rcfile = fopen("test-rcfile.txt", "w");
19622         assert(tmp_rcfile != 0);
19623         fprintf(tmp_rcfile, "display-throughput: n");
19624         fclose(tmp_rcfile);
19625 
19626         assert(test_parse_rc(out,0));
19627 
19628 #ifdef PRINT_DEBUG
19629         print();
19630 #endif
19631         assert(d.start_time == 0);
19632         assert(d.total_time == 0);
19633         assert(d.current_time == 0);
19634         assert(d.elapsed_time == 0);
19635         assert(d.percent_complete == 0);
19636         assert(d.display_interval == 1);
19637         assert(d.overtime_flag == 0);
19638         assert(d.k == 1024);
19639         assert(d.twiddle == '-');
19640         assert(d.manual_width == 0);
19641         assert(d.screen_width_minus_one == 0);
19642         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19643         assert(d.display_datacount == 1);
19644         assert(d.display_throughput == 0);
19645         assert(d.display_time == 1);
19646         assert(d.display_percent == 1);
19647         assert(d.display_bar == 1);
19648         assert(d.display_summary == 1);
19649         assert(d.display_ansi == 0);
19650         assert(d.twiddle_fg_color == 0);
19651         assert(d.twiddle_bg_color == 0);
19652         assert(d.twiddle_fg_bold == 0);
19653         assert(d.datacount_fg_color == 0);
19654         assert(d.datacount_bg_color == 0);
19655         assert(d.datacount_fg_bold == 0);
19656         assert(d.throughput_label_fg_color == 0);
19657         assert(d.throughput_label_bg_color == 0);
19658         assert(d.throughput_label_fg_bold == 0);
19659         assert(d.throughput_fg_color == 0);
19660         assert(d.throughput_bg_color == 0);
19661         assert(d.throughput_fg_bold == 0);
19662         assert(d.time_label_fg_color == 0);
19663         assert(d.time_label_bg_color == 0);
19664         assert(d.time_label_fg_bold == 0);
19665         assert(d.percent_fg_color == 0);
19666         assert(d.percent_bg_color == 0);
19667         assert(d.percent_fg_bold == 0);
19668         assert(d.barbrace_fg_color == 0);
19669         assert(d.barbrace_bg_color == 0);
19670         assert(d.barbrace_fg_bold == 0);
19671         assert(d.bar_fg_color == 0);
19672         assert(d.bar_bg_color == 0);
19673         assert(d.bar_fg_bold == 0);
19674         assert(io.in == 0);
19675         assert(io.out == 1);
19676         assert(io.in_ready == 0);
19677         assert(io.out_ready == 0);
19678         assert(io.eof_in == 0);
19679         assert(io.eof_out == 0);
19680         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19681         /* assert(io.cbuf == 0x0); */
19682         assert(io.last_read == 0);
19683         assert(io.last_write == 0);
19684         assert(io.total_read == 0);
19685         assert(io.total_write == 0);
19686         assert(io.total_size == 0);
19687         assert(io.total_size_known == 0);
19688         assert(io.timeout == 250000);
19689 
19690         tmp_rcfile = fopen("test-rcfile.txt", "w");
19691         assert(tmp_rcfile != 0);
19692         fprintf(tmp_rcfile, "display-throughput: y");
19693         fclose(tmp_rcfile);
19694 
19695         assert(test_parse_rc(out,0));
19696 
19697 #ifdef PRINT_DEBUG
19698         print();
19699 #endif
19700         assert(d.start_time == 0);
19701         assert(d.total_time == 0);
19702         assert(d.current_time == 0);
19703         assert(d.elapsed_time == 0);
19704         assert(d.percent_complete == 0);
19705         assert(d.display_interval == 1);
19706         assert(d.overtime_flag == 0);
19707         assert(d.k == 1024);
19708         assert(d.twiddle == '-');
19709         assert(d.manual_width == 0);
19710         assert(d.screen_width_minus_one == 0);
19711         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19712         assert(d.display_datacount == 1);
19713         assert(d.display_throughput == 1);
19714         assert(d.display_time == 1);
19715         assert(d.display_percent == 1);
19716         assert(d.display_bar == 1);
19717         assert(d.display_summary == 1);
19718         assert(d.display_ansi == 0);
19719         assert(d.twiddle_fg_color == 0);
19720         assert(d.twiddle_bg_color == 0);
19721         assert(d.twiddle_fg_bold == 0);
19722         assert(d.datacount_fg_color == 0);
19723         assert(d.datacount_bg_color == 0);
19724         assert(d.datacount_fg_bold == 0);
19725         assert(d.throughput_label_fg_color == 0);
19726         assert(d.throughput_label_bg_color == 0);
19727         assert(d.throughput_label_fg_bold == 0);
19728         assert(d.throughput_fg_color == 0);
19729         assert(d.throughput_bg_color == 0);
19730         assert(d.throughput_fg_bold == 0);
19731         assert(d.time_label_fg_color == 0);
19732         assert(d.time_label_bg_color == 0);
19733         assert(d.time_label_fg_bold == 0);
19734         assert(d.percent_fg_color == 0);
19735         assert(d.percent_bg_color == 0);
19736         assert(d.percent_fg_bold == 0);
19737         assert(d.barbrace_fg_color == 0);
19738         assert(d.barbrace_bg_color == 0);
19739         assert(d.barbrace_fg_bold == 0);
19740         assert(d.bar_fg_color == 0);
19741         assert(d.bar_bg_color == 0);
19742         assert(d.bar_fg_bold == 0);
19743         assert(io.in == 0);
19744         assert(io.out == 1);
19745         assert(io.in_ready == 0);
19746         assert(io.out_ready == 0);
19747         assert(io.eof_in == 0);
19748         assert(io.eof_out == 0);
19749         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19750         /* assert(io.cbuf == 0x0); */
19751         assert(io.last_read == 0);
19752         assert(io.last_write == 0);
19753         assert(io.total_read == 0);
19754         assert(io.total_write == 0);
19755         assert(io.total_size == 0);
19756         assert(io.total_size_known == 0);
19757         assert(io.timeout == 250000);
19758 
19759         tmp_rcfile = fopen("test-rcfile.txt", "w");
19760         assert(tmp_rcfile != 0);
19761         fprintf(tmp_rcfile, "display-throughput: false");
19762         fclose(tmp_rcfile);
19763 
19764         assert(test_parse_rc(out,0));
19765 
19766 #ifdef PRINT_DEBUG
19767         print();
19768 #endif
19769         assert(d.start_time == 0);
19770         assert(d.total_time == 0);
19771         assert(d.current_time == 0);
19772         assert(d.elapsed_time == 0);
19773         assert(d.percent_complete == 0);
19774         assert(d.display_interval == 1);
19775         assert(d.overtime_flag == 0);
19776         assert(d.k == 1024);
19777         assert(d.twiddle == '-');
19778         assert(d.manual_width == 0);
19779         assert(d.screen_width_minus_one == 0);
19780         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19781         assert(d.display_datacount == 1);
19782         assert(d.display_throughput == 0);
19783         assert(d.display_time == 1);
19784         assert(d.display_percent == 1);
19785         assert(d.display_bar == 1);
19786         assert(d.display_summary == 1);
19787         assert(d.display_ansi == 0);
19788         assert(d.twiddle_fg_color == 0);
19789         assert(d.twiddle_bg_color == 0);
19790         assert(d.twiddle_fg_bold == 0);
19791         assert(d.datacount_fg_color == 0);
19792         assert(d.datacount_bg_color == 0);
19793         assert(d.datacount_fg_bold == 0);
19794         assert(d.throughput_label_fg_color == 0);
19795         assert(d.throughput_label_bg_color == 0);
19796         assert(d.throughput_label_fg_bold == 0);
19797         assert(d.throughput_fg_color == 0);
19798         assert(d.throughput_bg_color == 0);
19799         assert(d.throughput_fg_bold == 0);
19800         assert(d.time_label_fg_color == 0);
19801         assert(d.time_label_bg_color == 0);
19802         assert(d.time_label_fg_bold == 0);
19803         assert(d.percent_fg_color == 0);
19804         assert(d.percent_bg_color == 0);
19805         assert(d.percent_fg_bold == 0);
19806         assert(d.barbrace_fg_color == 0);
19807         assert(d.barbrace_bg_color == 0);
19808         assert(d.barbrace_fg_bold == 0);
19809         assert(d.bar_fg_color == 0);
19810         assert(d.bar_bg_color == 0);
19811         assert(d.bar_fg_bold == 0);
19812         assert(io.in == 0);
19813         assert(io.out == 1);
19814         assert(io.in_ready == 0);
19815         assert(io.out_ready == 0);
19816         assert(io.eof_in == 0);
19817         assert(io.eof_out == 0);
19818         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19819         /* assert(io.cbuf == 0x0); */
19820         assert(io.last_read == 0);
19821         assert(io.last_write == 0);
19822         assert(io.total_read == 0);
19823         assert(io.total_write == 0);
19824         assert(io.total_size == 0);
19825         assert(io.total_size_known == 0);
19826         assert(io.timeout == 250000);
19827 
19828         tmp_rcfile = fopen("test-rcfile.txt", "w");
19829         assert(tmp_rcfile != 0);
19830         fprintf(tmp_rcfile, "display-throughput: true");
19831         fclose(tmp_rcfile);
19832 
19833         assert(test_parse_rc(out,0));
19834 
19835 #ifdef PRINT_DEBUG
19836         print();
19837 #endif
19838         assert(d.start_time == 0);
19839         assert(d.total_time == 0);
19840         assert(d.current_time == 0);
19841         assert(d.elapsed_time == 0);
19842         assert(d.percent_complete == 0);
19843         assert(d.display_interval == 1);
19844         assert(d.overtime_flag == 0);
19845         assert(d.k == 1024);
19846         assert(d.twiddle == '-');
19847         assert(d.manual_width == 0);
19848         assert(d.screen_width_minus_one == 0);
19849         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19850         assert(d.display_datacount == 1);
19851         assert(d.display_throughput == 1);
19852         assert(d.display_time == 1);
19853         assert(d.display_percent == 1);
19854         assert(d.display_bar == 1);
19855         assert(d.display_summary == 1);
19856         assert(d.display_ansi == 0);
19857         assert(d.twiddle_fg_color == 0);
19858         assert(d.twiddle_bg_color == 0);
19859         assert(d.twiddle_fg_bold == 0);
19860         assert(d.datacount_fg_color == 0);
19861         assert(d.datacount_bg_color == 0);
19862         assert(d.datacount_fg_bold == 0);
19863         assert(d.throughput_label_fg_color == 0);
19864         assert(d.throughput_label_bg_color == 0);
19865         assert(d.throughput_label_fg_bold == 0);
19866         assert(d.throughput_fg_color == 0);
19867         assert(d.throughput_bg_color == 0);
19868         assert(d.throughput_fg_bold == 0);
19869         assert(d.time_label_fg_color == 0);
19870         assert(d.time_label_bg_color == 0);
19871         assert(d.time_label_fg_bold == 0);
19872         assert(d.percent_fg_color == 0);
19873         assert(d.percent_bg_color == 0);
19874         assert(d.percent_fg_bold == 0);
19875         assert(d.barbrace_fg_color == 0);
19876         assert(d.barbrace_bg_color == 0);
19877         assert(d.barbrace_fg_bold == 0);
19878         assert(d.bar_fg_color == 0);
19879         assert(d.bar_bg_color == 0);
19880         assert(d.bar_fg_bold == 0);
19881         assert(io.in == 0);
19882         assert(io.out == 1);
19883         assert(io.in_ready == 0);
19884         assert(io.out_ready == 0);
19885         assert(io.eof_in == 0);
19886         assert(io.eof_out == 0);
19887         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19888         /* assert(io.cbuf == 0x0); */
19889         assert(io.last_read == 0);
19890         assert(io.last_write == 0);
19891         assert(io.total_read == 0);
19892         assert(io.total_write == 0);
19893         assert(io.total_size == 0);
19894         assert(io.total_size_known == 0);
19895         assert(io.timeout == 250000);
19896 
19897         tmp_rcfile = fopen("test-rcfile.txt", "w");
19898         assert(tmp_rcfile != 0);
19899         fprintf(tmp_rcfile, "display-throughput: f");
19900         fclose(tmp_rcfile);
19901 
19902         assert(test_parse_rc(out,0));
19903 
19904 #ifdef PRINT_DEBUG
19905         print();
19906 #endif
19907         assert(d.start_time == 0);
19908         assert(d.total_time == 0);
19909         assert(d.current_time == 0);
19910         assert(d.elapsed_time == 0);
19911         assert(d.percent_complete == 0);
19912         assert(d.display_interval == 1);
19913         assert(d.overtime_flag == 0);
19914         assert(d.k == 1024);
19915         assert(d.twiddle == '-');
19916         assert(d.manual_width == 0);
19917         assert(d.screen_width_minus_one == 0);
19918         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19919         assert(d.display_datacount == 1);
19920         assert(d.display_throughput == 0);
19921         assert(d.display_time == 1);
19922         assert(d.display_percent == 1);
19923         assert(d.display_bar == 1);
19924         assert(d.display_summary == 1);
19925         assert(d.display_ansi == 0);
19926         assert(d.twiddle_fg_color == 0);
19927         assert(d.twiddle_bg_color == 0);
19928         assert(d.twiddle_fg_bold == 0);
19929         assert(d.datacount_fg_color == 0);
19930         assert(d.datacount_bg_color == 0);
19931         assert(d.datacount_fg_bold == 0);
19932         assert(d.throughput_label_fg_color == 0);
19933         assert(d.throughput_label_bg_color == 0);
19934         assert(d.throughput_label_fg_bold == 0);
19935         assert(d.throughput_fg_color == 0);
19936         assert(d.throughput_bg_color == 0);
19937         assert(d.throughput_fg_bold == 0);
19938         assert(d.time_label_fg_color == 0);
19939         assert(d.time_label_bg_color == 0);
19940         assert(d.time_label_fg_bold == 0);
19941         assert(d.percent_fg_color == 0);
19942         assert(d.percent_bg_color == 0);
19943         assert(d.percent_fg_bold == 0);
19944         assert(d.barbrace_fg_color == 0);
19945         assert(d.barbrace_bg_color == 0);
19946         assert(d.barbrace_fg_bold == 0);
19947         assert(d.bar_fg_color == 0);
19948         assert(d.bar_bg_color == 0);
19949         assert(d.bar_fg_bold == 0);
19950         assert(io.in == 0);
19951         assert(io.out == 1);
19952         assert(io.in_ready == 0);
19953         assert(io.out_ready == 0);
19954         assert(io.eof_in == 0);
19955         assert(io.eof_out == 0);
19956         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
19957         /* assert(io.cbuf == 0x0); */
19958         assert(io.last_read == 0);
19959         assert(io.last_write == 0);
19960         assert(io.total_read == 0);
19961         assert(io.total_write == 0);
19962         assert(io.total_size == 0);
19963         assert(io.total_size_known == 0);
19964         assert(io.timeout == 250000);
19965 
19966         tmp_rcfile = fopen("test-rcfile.txt", "w");
19967         assert(tmp_rcfile != 0);
19968         fprintf(tmp_rcfile, "display-throughput: t");
19969         fclose(tmp_rcfile);
19970 
19971         assert(test_parse_rc(out,0));
19972 
19973 #ifdef PRINT_DEBUG
19974         print();
19975 #endif
19976         assert(d.start_time == 0);
19977         assert(d.total_time == 0);
19978         assert(d.current_time == 0);
19979         assert(d.elapsed_time == 0);
19980         assert(d.percent_complete == 0);
19981         assert(d.display_interval == 1);
19982         assert(d.overtime_flag == 0);
19983         assert(d.k == 1024);
19984         assert(d.twiddle == '-');
19985         assert(d.manual_width == 0);
19986         assert(d.screen_width_minus_one == 0);
19987         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
19988         assert(d.display_datacount == 1);
19989         assert(d.display_throughput == 1);
19990         assert(d.display_time == 1);
19991         assert(d.display_percent == 1);
19992         assert(d.display_bar == 1);
19993         assert(d.display_summary == 1);
19994         assert(d.display_ansi == 0);
19995         assert(d.twiddle_fg_color == 0);
19996         assert(d.twiddle_bg_color == 0);
19997         assert(d.twiddle_fg_bold == 0);
19998         assert(d.datacount_fg_color == 0);
19999         assert(d.datacount_bg_color == 0);
20000         assert(d.datacount_fg_bold == 0);
20001         assert(d.throughput_label_fg_color == 0);
20002         assert(d.throughput_label_bg_color == 0);
20003         assert(d.throughput_label_fg_bold == 0);
20004         assert(d.throughput_fg_color == 0);
20005         assert(d.throughput_bg_color == 0);
20006         assert(d.throughput_fg_bold == 0);
20007         assert(d.time_label_fg_color == 0);
20008         assert(d.time_label_bg_color == 0);
20009         assert(d.time_label_fg_bold == 0);
20010         assert(d.percent_fg_color == 0);
20011         assert(d.percent_bg_color == 0);
20012         assert(d.percent_fg_bold == 0);
20013         assert(d.barbrace_fg_color == 0);
20014         assert(d.barbrace_bg_color == 0);
20015         assert(d.barbrace_fg_bold == 0);
20016         assert(d.bar_fg_color == 0);
20017         assert(d.bar_bg_color == 0);
20018         assert(d.bar_fg_bold == 0);
20019         assert(io.in == 0);
20020         assert(io.out == 1);
20021         assert(io.in_ready == 0);
20022         assert(io.out_ready == 0);
20023         assert(io.eof_in == 0);
20024         assert(io.eof_out == 0);
20025         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20026         /* assert(io.cbuf == 0x0); */
20027         assert(io.last_read == 0);
20028         assert(io.last_write == 0);
20029         assert(io.total_read == 0);
20030         assert(io.total_write == 0);
20031         assert(io.total_size == 0);
20032         assert(io.total_size_known == 0);
20033         assert(io.timeout == 250000);
20034 
20035         tmp_rcfile = fopen("test-rcfile.txt", "w");
20036         assert(tmp_rcfile != 0);
20037         fprintf(tmp_rcfile, "display-throughput: 0");
20038         fclose(tmp_rcfile);
20039 
20040         assert(test_parse_rc(out,0));
20041 
20042 #ifdef PRINT_DEBUG
20043         print();
20044 #endif
20045         assert(d.start_time == 0);
20046         assert(d.total_time == 0);
20047         assert(d.current_time == 0);
20048         assert(d.elapsed_time == 0);
20049         assert(d.percent_complete == 0);
20050         assert(d.display_interval == 1);
20051         assert(d.overtime_flag == 0);
20052         assert(d.k == 1024);
20053         assert(d.twiddle == '-');
20054         assert(d.manual_width == 0);
20055         assert(d.screen_width_minus_one == 0);
20056         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20057         assert(d.display_datacount == 1);
20058         assert(d.display_throughput == 0);
20059         assert(d.display_time == 1);
20060         assert(d.display_percent == 1);
20061         assert(d.display_bar == 1);
20062         assert(d.display_summary == 1);
20063         assert(d.display_ansi == 0);
20064         assert(d.twiddle_fg_color == 0);
20065         assert(d.twiddle_bg_color == 0);
20066         assert(d.twiddle_fg_bold == 0);
20067         assert(d.datacount_fg_color == 0);
20068         assert(d.datacount_bg_color == 0);
20069         assert(d.datacount_fg_bold == 0);
20070         assert(d.throughput_label_fg_color == 0);
20071         assert(d.throughput_label_bg_color == 0);
20072         assert(d.throughput_label_fg_bold == 0);
20073         assert(d.throughput_fg_color == 0);
20074         assert(d.throughput_bg_color == 0);
20075         assert(d.throughput_fg_bold == 0);
20076         assert(d.time_label_fg_color == 0);
20077         assert(d.time_label_bg_color == 0);
20078         assert(d.time_label_fg_bold == 0);
20079         assert(d.percent_fg_color == 0);
20080         assert(d.percent_bg_color == 0);
20081         assert(d.percent_fg_bold == 0);
20082         assert(d.barbrace_fg_color == 0);
20083         assert(d.barbrace_bg_color == 0);
20084         assert(d.barbrace_fg_bold == 0);
20085         assert(d.bar_fg_color == 0);
20086         assert(d.bar_bg_color == 0);
20087         assert(d.bar_fg_bold == 0);
20088         assert(io.in == 0);
20089         assert(io.out == 1);
20090         assert(io.in_ready == 0);
20091         assert(io.out_ready == 0);
20092         assert(io.eof_in == 0);
20093         assert(io.eof_out == 0);
20094         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20095         /* assert(io.cbuf == 0x0); */
20096         assert(io.last_read == 0);
20097         assert(io.last_write == 0);
20098         assert(io.total_read == 0);
20099         assert(io.total_write == 0);
20100         assert(io.total_size == 0);
20101         assert(io.total_size_known == 0);
20102         assert(io.timeout == 250000);
20103 
20104         tmp_rcfile = fopen("test-rcfile.txt", "w");
20105         assert(tmp_rcfile != 0);
20106         fprintf(tmp_rcfile, "display-throughput: 1");
20107         fclose(tmp_rcfile);
20108 
20109         assert(test_parse_rc(out,0));
20110 
20111 #ifdef PRINT_DEBUG
20112         print();
20113 #endif
20114         assert(d.start_time == 0);
20115         assert(d.total_time == 0);
20116         assert(d.current_time == 0);
20117         assert(d.elapsed_time == 0);
20118         assert(d.percent_complete == 0);
20119         assert(d.display_interval == 1);
20120         assert(d.overtime_flag == 0);
20121         assert(d.k == 1024);
20122         assert(d.twiddle == '-');
20123         assert(d.manual_width == 0);
20124         assert(d.screen_width_minus_one == 0);
20125         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20126         assert(d.display_datacount == 1);
20127         assert(d.display_throughput == 1);
20128         assert(d.display_time == 1);
20129         assert(d.display_percent == 1);
20130         assert(d.display_bar == 1);
20131         assert(d.display_summary == 1);
20132         assert(d.display_ansi == 0);
20133         assert(d.twiddle_fg_color == 0);
20134         assert(d.twiddle_bg_color == 0);
20135         assert(d.twiddle_fg_bold == 0);
20136         assert(d.datacount_fg_color == 0);
20137         assert(d.datacount_bg_color == 0);
20138         assert(d.datacount_fg_bold == 0);
20139         assert(d.throughput_label_fg_color == 0);
20140         assert(d.throughput_label_bg_color == 0);
20141         assert(d.throughput_label_fg_bold == 0);
20142         assert(d.throughput_fg_color == 0);
20143         assert(d.throughput_bg_color == 0);
20144         assert(d.throughput_fg_bold == 0);
20145         assert(d.time_label_fg_color == 0);
20146         assert(d.time_label_bg_color == 0);
20147         assert(d.time_label_fg_bold == 0);
20148         assert(d.percent_fg_color == 0);
20149         assert(d.percent_bg_color == 0);
20150         assert(d.percent_fg_bold == 0);
20151         assert(d.barbrace_fg_color == 0);
20152         assert(d.barbrace_bg_color == 0);
20153         assert(d.barbrace_fg_bold == 0);
20154         assert(d.bar_fg_color == 0);
20155         assert(d.bar_bg_color == 0);
20156         assert(d.bar_fg_bold == 0);
20157         assert(io.in == 0);
20158         assert(io.out == 1);
20159         assert(io.in_ready == 0);
20160         assert(io.out_ready == 0);
20161         assert(io.eof_in == 0);
20162         assert(io.eof_out == 0);
20163         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20164         /* assert(io.cbuf == 0x0); */
20165         assert(io.last_read == 0);
20166         assert(io.last_write == 0);
20167         assert(io.total_read == 0);
20168         assert(io.total_write == 0);
20169         assert(io.total_size == 0);
20170         assert(io.total_size_known == 0);
20171         assert(io.timeout == 250000);
20172 
20173         tmp_rcfile = fopen("test-rcfile.txt", "w");
20174         assert(tmp_rcfile != 0);
20175         fprintf(tmp_rcfile, "display-throughput: off");
20176         fclose(tmp_rcfile);
20177 
20178         assert(test_parse_rc(out,0));
20179 
20180 #ifdef PRINT_DEBUG
20181         print();
20182 #endif
20183         assert(d.start_time == 0);
20184         assert(d.total_time == 0);
20185         assert(d.current_time == 0);
20186         assert(d.elapsed_time == 0);
20187         assert(d.percent_complete == 0);
20188         assert(d.display_interval == 1);
20189         assert(d.overtime_flag == 0);
20190         assert(d.k == 1024);
20191         assert(d.twiddle == '-');
20192         assert(d.manual_width == 0);
20193         assert(d.screen_width_minus_one == 0);
20194         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20195         assert(d.display_datacount == 1);
20196         assert(d.display_throughput == 0);
20197         assert(d.display_time == 1);
20198         assert(d.display_percent == 1);
20199         assert(d.display_bar == 1);
20200         assert(d.display_summary == 1);
20201         assert(d.display_ansi == 0);
20202         assert(d.twiddle_fg_color == 0);
20203         assert(d.twiddle_bg_color == 0);
20204         assert(d.twiddle_fg_bold == 0);
20205         assert(d.datacount_fg_color == 0);
20206         assert(d.datacount_bg_color == 0);
20207         assert(d.datacount_fg_bold == 0);
20208         assert(d.throughput_label_fg_color == 0);
20209         assert(d.throughput_label_bg_color == 0);
20210         assert(d.throughput_label_fg_bold == 0);
20211         assert(d.throughput_fg_color == 0);
20212         assert(d.throughput_bg_color == 0);
20213         assert(d.throughput_fg_bold == 0);
20214         assert(d.time_label_fg_color == 0);
20215         assert(d.time_label_bg_color == 0);
20216         assert(d.time_label_fg_bold == 0);
20217         assert(d.percent_fg_color == 0);
20218         assert(d.percent_bg_color == 0);
20219         assert(d.percent_fg_bold == 0);
20220         assert(d.barbrace_fg_color == 0);
20221         assert(d.barbrace_bg_color == 0);
20222         assert(d.barbrace_fg_bold == 0);
20223         assert(d.bar_fg_color == 0);
20224         assert(d.bar_bg_color == 0);
20225         assert(d.bar_fg_bold == 0);
20226         assert(io.in == 0);
20227         assert(io.out == 1);
20228         assert(io.in_ready == 0);
20229         assert(io.out_ready == 0);
20230         assert(io.eof_in == 0);
20231         assert(io.eof_out == 0);
20232         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20233         /* assert(io.cbuf == 0x0); */
20234         assert(io.last_read == 0);
20235         assert(io.last_write == 0);
20236         assert(io.total_read == 0);
20237         assert(io.total_write == 0);
20238         assert(io.total_size == 0);
20239         assert(io.total_size_known == 0);
20240         assert(io.timeout == 250000);
20241 
20242         tmp_rcfile = fopen("test-rcfile.txt", "w");
20243         assert(tmp_rcfile != 0);
20244         fprintf(tmp_rcfile, "display-throughput: on");
20245         fclose(tmp_rcfile);
20246 
20247         assert(test_parse_rc(out,0));
20248 
20249 #ifdef PRINT_DEBUG
20250         print();
20251 #endif
20252         assert(d.start_time == 0);
20253         assert(d.total_time == 0);
20254         assert(d.current_time == 0);
20255         assert(d.elapsed_time == 0);
20256         assert(d.percent_complete == 0);
20257         assert(d.display_interval == 1);
20258         assert(d.overtime_flag == 0);
20259         assert(d.k == 1024);
20260         assert(d.twiddle == '-');
20261         assert(d.manual_width == 0);
20262         assert(d.screen_width_minus_one == 0);
20263         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20264         assert(d.display_datacount == 1);
20265         assert(d.display_throughput == 1);
20266         assert(d.display_time == 1);
20267         assert(d.display_percent == 1);
20268         assert(d.display_bar == 1);
20269         assert(d.display_summary == 1);
20270         assert(d.display_ansi == 0);
20271         assert(d.twiddle_fg_color == 0);
20272         assert(d.twiddle_bg_color == 0);
20273         assert(d.twiddle_fg_bold == 0);
20274         assert(d.datacount_fg_color == 0);
20275         assert(d.datacount_bg_color == 0);
20276         assert(d.datacount_fg_bold == 0);
20277         assert(d.throughput_label_fg_color == 0);
20278         assert(d.throughput_label_bg_color == 0);
20279         assert(d.throughput_label_fg_bold == 0);
20280         assert(d.throughput_fg_color == 0);
20281         assert(d.throughput_bg_color == 0);
20282         assert(d.throughput_fg_bold == 0);
20283         assert(d.time_label_fg_color == 0);
20284         assert(d.time_label_bg_color == 0);
20285         assert(d.time_label_fg_bold == 0);
20286         assert(d.percent_fg_color == 0);
20287         assert(d.percent_bg_color == 0);
20288         assert(d.percent_fg_bold == 0);
20289         assert(d.barbrace_fg_color == 0);
20290         assert(d.barbrace_bg_color == 0);
20291         assert(d.barbrace_fg_bold == 0);
20292         assert(d.bar_fg_color == 0);
20293         assert(d.bar_bg_color == 0);
20294         assert(d.bar_fg_bold == 0);
20295         assert(io.in == 0);
20296         assert(io.out == 1);
20297         assert(io.in_ready == 0);
20298         assert(io.out_ready == 0);
20299         assert(io.eof_in == 0);
20300         assert(io.eof_out == 0);
20301         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20302         /* assert(io.cbuf == 0x0); */
20303         assert(io.last_read == 0);
20304         assert(io.last_write == 0);
20305         assert(io.total_read == 0);
20306         assert(io.total_write == 0);
20307         assert(io.total_size == 0);
20308         assert(io.total_size_known == 0);
20309         assert(io.timeout == 250000);
20310 
20311         assert(unlink("./test-rcfile.txt") == 0);
20312 }
20313 
20314 void test130(FILE *out)
20315 {
20316         FILE *tmp_rcfile = 0;
20317         
20318         tmp_rcfile = fopen("test-rcfile.txt", "w");
20319         assert(tmp_rcfile != 0);
20320         fprintf(tmp_rcfile, "display-time: Sjkhg");
20321         fclose(tmp_rcfile);
20322 
20323         clear_errno();
20324         ioInit();
20325         displayInit();
20326 
20327 #ifdef PRINT_DEBUG
20328         print();
20329 #endif
20330         assert(d.start_time == 0);
20331         assert(d.total_time == 0);
20332         assert(d.current_time == 0);
20333         assert(d.elapsed_time == 0);
20334         assert(d.percent_complete == 0);
20335         assert(d.display_interval == 1);
20336         assert(d.overtime_flag == 0);
20337         assert(d.k == 1024);
20338         assert(d.twiddle == '-');
20339         assert(d.manual_width == 0);
20340         assert(d.screen_width_minus_one == 0);
20341         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20342         assert(d.display_datacount == 1);
20343         assert(d.display_throughput == 1);
20344         assert(d.display_time == 1);
20345         assert(d.display_percent == 1);
20346         assert(d.display_bar == 1);
20347         assert(d.display_summary == 1);
20348         assert(d.display_ansi == 0);
20349         assert(d.twiddle_fg_color == 0);
20350         assert(d.twiddle_bg_color == 0);
20351         assert(d.twiddle_fg_bold == 0);
20352         assert(d.datacount_fg_color == 0);
20353         assert(d.datacount_bg_color == 0);
20354         assert(d.datacount_fg_bold == 0);
20355         assert(d.throughput_label_fg_color == 0);
20356         assert(d.throughput_label_bg_color == 0);
20357         assert(d.throughput_label_fg_bold == 0);
20358         assert(d.throughput_fg_color == 0);
20359         assert(d.throughput_bg_color == 0);
20360         assert(d.throughput_fg_bold == 0);
20361         assert(d.time_label_fg_color == 0);
20362         assert(d.time_label_bg_color == 0);
20363         assert(d.time_label_fg_bold == 0);
20364         assert(d.percent_fg_color == 0);
20365         assert(d.percent_bg_color == 0);
20366         assert(d.percent_fg_bold == 0);
20367         assert(d.barbrace_fg_color == 0);
20368         assert(d.barbrace_bg_color == 0);
20369         assert(d.barbrace_fg_bold == 0);
20370         assert(d.bar_fg_color == 0);
20371         assert(d.bar_bg_color == 0);
20372         assert(d.bar_fg_bold == 0);
20373         assert(io.in == 0);
20374         assert(io.out == 1);
20375         assert(io.in_ready == 0);
20376         assert(io.out_ready == 0);
20377         assert(io.eof_in == 0);
20378         assert(io.eof_out == 0);
20379         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20380         /* assert(io.cbuf == 0x0); */
20381         assert(io.last_read == 0);
20382         assert(io.last_write == 0);
20383         assert(io.total_read == 0);
20384         assert(io.total_write == 0);
20385         assert(io.total_size == 0);
20386         assert(io.total_size_known == 0);
20387         assert(io.timeout == 250000);
20388 
20389         assert(test_parse_rc(out,1));
20390 
20391 #ifdef PRINT_DEBUG
20392         print();
20393 #endif
20394         assert(d.start_time == 0);
20395         assert(d.total_time == 0);
20396         assert(d.current_time == 0);
20397         assert(d.elapsed_time == 0);
20398         assert(d.percent_complete == 0);
20399         assert(d.display_interval == 1);
20400         assert(d.overtime_flag == 0);
20401         assert(d.k == 1024);
20402         assert(d.twiddle == '-');
20403         assert(d.manual_width == 0);
20404         assert(d.screen_width_minus_one == 0);
20405         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20406         assert(d.display_datacount == 1);
20407         assert(d.display_throughput == 1);
20408         assert(d.display_time == 1);
20409         assert(d.display_percent == 1);
20410         assert(d.display_bar == 1);
20411         assert(d.display_summary == 1);
20412         assert(d.display_ansi == 0);
20413         assert(d.twiddle_fg_color == 0);
20414         assert(d.twiddle_bg_color == 0);
20415         assert(d.twiddle_fg_bold == 0);
20416         assert(d.datacount_fg_color == 0);
20417         assert(d.datacount_bg_color == 0);
20418         assert(d.datacount_fg_bold == 0);
20419         assert(d.throughput_label_fg_color == 0);
20420         assert(d.throughput_label_bg_color == 0);
20421         assert(d.throughput_label_fg_bold == 0);
20422         assert(d.throughput_fg_color == 0);
20423         assert(d.throughput_bg_color == 0);
20424         assert(d.throughput_fg_bold == 0);
20425         assert(d.time_label_fg_color == 0);
20426         assert(d.time_label_bg_color == 0);
20427         assert(d.time_label_fg_bold == 0);
20428         assert(d.percent_fg_color == 0);
20429         assert(d.percent_bg_color == 0);
20430         assert(d.percent_fg_bold == 0);
20431         assert(d.barbrace_fg_color == 0);
20432         assert(d.barbrace_bg_color == 0);
20433         assert(d.barbrace_fg_bold == 0);
20434         assert(d.bar_fg_color == 0);
20435         assert(d.bar_bg_color == 0);
20436         assert(d.bar_fg_bold == 0);
20437         assert(io.in == 0);
20438         assert(io.out == 1);
20439         assert(io.in_ready == 0);
20440         assert(io.out_ready == 0);
20441         assert(io.eof_in == 0);
20442         assert(io.eof_out == 0);
20443         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20444         /* assert(io.cbuf == 0x0); */
20445         assert(io.last_read == 0);
20446         assert(io.last_write == 0);
20447         assert(io.total_read == 0);
20448         assert(io.total_write == 0);
20449         assert(io.total_size == 0);
20450         assert(io.total_size_known == 0);
20451         assert(io.timeout == 250000);
20452 
20453         tmp_rcfile = fopen("test-rcfile.txt", "w");
20454         assert(tmp_rcfile != 0);
20455         fprintf(tmp_rcfile, "display-time: no");
20456         fclose(tmp_rcfile);
20457 
20458         assert(test_parse_rc(out,0));
20459 
20460 #ifdef PRINT_DEBUG
20461         print();
20462 #endif
20463         assert(d.start_time == 0);
20464         assert(d.total_time == 0);
20465         assert(d.current_time == 0);
20466         assert(d.elapsed_time == 0);
20467         assert(d.percent_complete == 0);
20468         assert(d.display_interval == 1);
20469         assert(d.overtime_flag == 0);
20470         assert(d.k == 1024);
20471         assert(d.twiddle == '-');
20472         assert(d.manual_width == 0);
20473         assert(d.screen_width_minus_one == 0);
20474         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20475         assert(d.display_datacount == 1);
20476         assert(d.display_throughput == 1);
20477         assert(d.display_time == 0);
20478         assert(d.display_percent == 1);
20479         assert(d.display_bar == 1);
20480         assert(d.display_summary == 1);
20481         assert(d.display_ansi == 0);
20482         assert(d.twiddle_fg_color == 0);
20483         assert(d.twiddle_bg_color == 0);
20484         assert(d.twiddle_fg_bold == 0);
20485         assert(d.datacount_fg_color == 0);
20486         assert(d.datacount_bg_color == 0);
20487         assert(d.datacount_fg_bold == 0);
20488         assert(d.throughput_label_fg_color == 0);
20489         assert(d.throughput_label_bg_color == 0);
20490         assert(d.throughput_label_fg_bold == 0);
20491         assert(d.throughput_fg_color == 0);
20492         assert(d.throughput_bg_color == 0);
20493         assert(d.throughput_fg_bold == 0);
20494         assert(d.time_label_fg_color == 0);
20495         assert(d.time_label_bg_color == 0);
20496         assert(d.time_label_fg_bold == 0);
20497         assert(d.percent_fg_color == 0);
20498         assert(d.percent_bg_color == 0);
20499         assert(d.percent_fg_bold == 0);
20500         assert(d.barbrace_fg_color == 0);
20501         assert(d.barbrace_bg_color == 0);
20502         assert(d.barbrace_fg_bold == 0);
20503         assert(d.bar_fg_color == 0);
20504         assert(d.bar_bg_color == 0);
20505         assert(d.bar_fg_bold == 0);
20506         assert(io.in == 0);
20507         assert(io.out == 1);
20508         assert(io.in_ready == 0);
20509         assert(io.out_ready == 0);
20510         assert(io.eof_in == 0);
20511         assert(io.eof_out == 0);
20512         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20513         /* assert(io.cbuf == 0x0); */
20514         assert(io.last_read == 0);
20515         assert(io.last_write == 0);
20516         assert(io.total_read == 0);
20517         assert(io.total_write == 0);
20518         assert(io.total_size == 0);
20519         assert(io.total_size_known == 0);
20520         assert(io.timeout == 250000);
20521 
20522         tmp_rcfile = fopen("test-rcfile.txt", "w");
20523         assert(tmp_rcfile != 0);
20524         fprintf(tmp_rcfile, "display-time: yes");
20525         fclose(tmp_rcfile);
20526 
20527         assert(test_parse_rc(out,0));
20528 
20529 #ifdef PRINT_DEBUG
20530         print();
20531 #endif
20532         assert(d.start_time == 0);
20533         assert(d.total_time == 0);
20534         assert(d.current_time == 0);
20535         assert(d.elapsed_time == 0);
20536         assert(d.percent_complete == 0);
20537         assert(d.display_interval == 1);
20538         assert(d.overtime_flag == 0);
20539         assert(d.k == 1024);
20540         assert(d.twiddle == '-');
20541         assert(d.manual_width == 0);
20542         assert(d.screen_width_minus_one == 0);
20543         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20544         assert(d.display_datacount == 1);
20545         assert(d.display_throughput == 1);
20546         assert(d.display_time == 1);
20547         assert(d.display_percent == 1);
20548         assert(d.display_bar == 1);
20549         assert(d.display_summary == 1);
20550         assert(d.display_ansi == 0);
20551         assert(d.twiddle_fg_color == 0);
20552         assert(d.twiddle_bg_color == 0);
20553         assert(d.twiddle_fg_bold == 0);
20554         assert(d.datacount_fg_color == 0);
20555         assert(d.datacount_bg_color == 0);
20556         assert(d.datacount_fg_bold == 0);
20557         assert(d.throughput_label_fg_color == 0);
20558         assert(d.throughput_label_bg_color == 0);
20559         assert(d.throughput_label_fg_bold == 0);
20560         assert(d.throughput_fg_color == 0);
20561         assert(d.throughput_bg_color == 0);
20562         assert(d.throughput_fg_bold == 0);
20563         assert(d.time_label_fg_color == 0);
20564         assert(d.time_label_bg_color == 0);
20565         assert(d.time_label_fg_bold == 0);
20566         assert(d.percent_fg_color == 0);
20567         assert(d.percent_bg_color == 0);
20568         assert(d.percent_fg_bold == 0);
20569         assert(d.barbrace_fg_color == 0);
20570         assert(d.barbrace_bg_color == 0);
20571         assert(d.barbrace_fg_bold == 0);
20572         assert(d.bar_fg_color == 0);
20573         assert(d.bar_bg_color == 0);
20574         assert(d.bar_fg_bold == 0);
20575         assert(io.in == 0);
20576         assert(io.out == 1);
20577         assert(io.in_ready == 0);
20578         assert(io.out_ready == 0);
20579         assert(io.eof_in == 0);
20580         assert(io.eof_out == 0);
20581         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20582         /* assert(io.cbuf == 0x0); */
20583         assert(io.last_read == 0);
20584         assert(io.last_write == 0);
20585         assert(io.total_read == 0);
20586         assert(io.total_write == 0);
20587         assert(io.total_size == 0);
20588         assert(io.total_size_known == 0);
20589         assert(io.timeout == 250000);
20590 
20591         tmp_rcfile = fopen("test-rcfile.txt", "w");
20592         assert(tmp_rcfile != 0);
20593         fprintf(tmp_rcfile, "display-time: n");
20594         fclose(tmp_rcfile);
20595 
20596         assert(test_parse_rc(out,0));
20597 
20598 #ifdef PRINT_DEBUG
20599         print();
20600 #endif
20601         assert(d.start_time == 0);
20602         assert(d.total_time == 0);
20603         assert(d.current_time == 0);
20604         assert(d.elapsed_time == 0);
20605         assert(d.percent_complete == 0);
20606         assert(d.display_interval == 1);
20607         assert(d.overtime_flag == 0);
20608         assert(d.k == 1024);
20609         assert(d.twiddle == '-');
20610         assert(d.manual_width == 0);
20611         assert(d.screen_width_minus_one == 0);
20612         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20613         assert(d.display_datacount == 1);
20614         assert(d.display_throughput == 1);
20615         assert(d.display_time == 0);
20616         assert(d.display_percent == 1);
20617         assert(d.display_bar == 1);
20618         assert(d.display_summary == 1);
20619         assert(d.display_ansi == 0);
20620         assert(d.twiddle_fg_color == 0);
20621         assert(d.twiddle_bg_color == 0);
20622         assert(d.twiddle_fg_bold == 0);
20623         assert(d.datacount_fg_color == 0);
20624         assert(d.datacount_bg_color == 0);
20625         assert(d.datacount_fg_bold == 0);
20626         assert(d.throughput_label_fg_color == 0);
20627         assert(d.throughput_label_bg_color == 0);
20628         assert(d.throughput_label_fg_bold == 0);
20629         assert(d.throughput_fg_color == 0);
20630         assert(d.throughput_bg_color == 0);
20631         assert(d.throughput_fg_bold == 0);
20632         assert(d.time_label_fg_color == 0);
20633         assert(d.time_label_bg_color == 0);
20634         assert(d.time_label_fg_bold == 0);
20635         assert(d.percent_fg_color == 0);
20636         assert(d.percent_bg_color == 0);
20637         assert(d.percent_fg_bold == 0);
20638         assert(d.barbrace_fg_color == 0);
20639         assert(d.barbrace_bg_color == 0);
20640         assert(d.barbrace_fg_bold == 0);
20641         assert(d.bar_fg_color == 0);
20642         assert(d.bar_bg_color == 0);
20643         assert(d.bar_fg_bold == 0);
20644         assert(io.in == 0);
20645         assert(io.out == 1);
20646         assert(io.in_ready == 0);
20647         assert(io.out_ready == 0);
20648         assert(io.eof_in == 0);
20649         assert(io.eof_out == 0);
20650         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20651         /* assert(io.cbuf == 0x0); */
20652         assert(io.last_read == 0);
20653         assert(io.last_write == 0);
20654         assert(io.total_read == 0);
20655         assert(io.total_write == 0);
20656         assert(io.total_size == 0);
20657         assert(io.total_size_known == 0);
20658         assert(io.timeout == 250000);
20659 
20660         tmp_rcfile = fopen("test-rcfile.txt", "w");
20661         assert(tmp_rcfile != 0);
20662         fprintf(tmp_rcfile, "display-time: y");
20663         fclose(tmp_rcfile);
20664 
20665         assert(test_parse_rc(out,0));
20666 
20667 #ifdef PRINT_DEBUG
20668         print();
20669 #endif
20670         assert(d.start_time == 0);
20671         assert(d.total_time == 0);
20672         assert(d.current_time == 0);
20673         assert(d.elapsed_time == 0);
20674         assert(d.percent_complete == 0);
20675         assert(d.display_interval == 1);
20676         assert(d.overtime_flag == 0);
20677         assert(d.k == 1024);
20678         assert(d.twiddle == '-');
20679         assert(d.manual_width == 0);
20680         assert(d.screen_width_minus_one == 0);
20681         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20682         assert(d.display_datacount == 1);
20683         assert(d.display_throughput == 1);
20684         assert(d.display_time == 1);
20685         assert(d.display_percent == 1);
20686         assert(d.display_bar == 1);
20687         assert(d.display_summary == 1);
20688         assert(d.display_ansi == 0);
20689         assert(d.twiddle_fg_color == 0);
20690         assert(d.twiddle_bg_color == 0);
20691         assert(d.twiddle_fg_bold == 0);
20692         assert(d.datacount_fg_color == 0);
20693         assert(d.datacount_bg_color == 0);
20694         assert(d.datacount_fg_bold == 0);
20695         assert(d.throughput_label_fg_color == 0);
20696         assert(d.throughput_label_bg_color == 0);
20697         assert(d.throughput_label_fg_bold == 0);
20698         assert(d.throughput_fg_color == 0);
20699         assert(d.throughput_bg_color == 0);
20700         assert(d.throughput_fg_bold == 0);
20701         assert(d.time_label_fg_color == 0);
20702         assert(d.time_label_bg_color == 0);
20703         assert(d.time_label_fg_bold == 0);
20704         assert(d.percent_fg_color == 0);
20705         assert(d.percent_bg_color == 0);
20706         assert(d.percent_fg_bold == 0);
20707         assert(d.barbrace_fg_color == 0);
20708         assert(d.barbrace_bg_color == 0);
20709         assert(d.barbrace_fg_bold == 0);
20710         assert(d.bar_fg_color == 0);
20711         assert(d.bar_bg_color == 0);
20712         assert(d.bar_fg_bold == 0);
20713         assert(io.in == 0);
20714         assert(io.out == 1);
20715         assert(io.in_ready == 0);
20716         assert(io.out_ready == 0);
20717         assert(io.eof_in == 0);
20718         assert(io.eof_out == 0);
20719         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20720         /* assert(io.cbuf == 0x0); */
20721         assert(io.last_read == 0);
20722         assert(io.last_write == 0);
20723         assert(io.total_read == 0);
20724         assert(io.total_write == 0);
20725         assert(io.total_size == 0);
20726         assert(io.total_size_known == 0);
20727         assert(io.timeout == 250000);
20728 
20729         tmp_rcfile = fopen("test-rcfile.txt", "w");
20730         assert(tmp_rcfile != 0);
20731         fprintf(tmp_rcfile, "display-time: false");
20732         fclose(tmp_rcfile);
20733 
20734         assert(test_parse_rc(out,0));
20735 
20736 #ifdef PRINT_DEBUG
20737         print();
20738 #endif
20739         assert(d.start_time == 0);
20740         assert(d.total_time == 0);
20741         assert(d.current_time == 0);
20742         assert(d.elapsed_time == 0);
20743         assert(d.percent_complete == 0);
20744         assert(d.display_interval == 1);
20745         assert(d.overtime_flag == 0);
20746         assert(d.k == 1024);
20747         assert(d.twiddle == '-');
20748         assert(d.manual_width == 0);
20749         assert(d.screen_width_minus_one == 0);
20750         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20751         assert(d.display_datacount == 1);
20752         assert(d.display_throughput == 1);
20753         assert(d.display_time == 0);
20754         assert(d.display_percent == 1);
20755         assert(d.display_bar == 1);
20756         assert(d.display_summary == 1);
20757         assert(d.display_ansi == 0);
20758         assert(d.twiddle_fg_color == 0);
20759         assert(d.twiddle_bg_color == 0);
20760         assert(d.twiddle_fg_bold == 0);
20761         assert(d.datacount_fg_color == 0);
20762         assert(d.datacount_bg_color == 0);
20763         assert(d.datacount_fg_bold == 0);
20764         assert(d.throughput_label_fg_color == 0);
20765         assert(d.throughput_label_bg_color == 0);
20766         assert(d.throughput_label_fg_bold == 0);
20767         assert(d.throughput_fg_color == 0);
20768         assert(d.throughput_bg_color == 0);
20769         assert(d.throughput_fg_bold == 0);
20770         assert(d.time_label_fg_color == 0);
20771         assert(d.time_label_bg_color == 0);
20772         assert(d.time_label_fg_bold == 0);
20773         assert(d.percent_fg_color == 0);
20774         assert(d.percent_bg_color == 0);
20775         assert(d.percent_fg_bold == 0);
20776         assert(d.barbrace_fg_color == 0);
20777         assert(d.barbrace_bg_color == 0);
20778         assert(d.barbrace_fg_bold == 0);
20779         assert(d.bar_fg_color == 0);
20780         assert(d.bar_bg_color == 0);
20781         assert(d.bar_fg_bold == 0);
20782         assert(io.in == 0);
20783         assert(io.out == 1);
20784         assert(io.in_ready == 0);
20785         assert(io.out_ready == 0);
20786         assert(io.eof_in == 0);
20787         assert(io.eof_out == 0);
20788         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20789         /* assert(io.cbuf == 0x0); */
20790         assert(io.last_read == 0);
20791         assert(io.last_write == 0);
20792         assert(io.total_read == 0);
20793         assert(io.total_write == 0);
20794         assert(io.total_size == 0);
20795         assert(io.total_size_known == 0);
20796         assert(io.timeout == 250000);
20797 
20798         tmp_rcfile = fopen("test-rcfile.txt", "w");
20799         assert(tmp_rcfile != 0);
20800         fprintf(tmp_rcfile, "display-time: true");
20801         fclose(tmp_rcfile);
20802 
20803         assert(test_parse_rc(out,0));
20804 
20805 #ifdef PRINT_DEBUG
20806         print();
20807 #endif
20808         assert(d.start_time == 0);
20809         assert(d.total_time == 0);
20810         assert(d.current_time == 0);
20811         assert(d.elapsed_time == 0);
20812         assert(d.percent_complete == 0);
20813         assert(d.display_interval == 1);
20814         assert(d.overtime_flag == 0);
20815         assert(d.k == 1024);
20816         assert(d.twiddle == '-');
20817         assert(d.manual_width == 0);
20818         assert(d.screen_width_minus_one == 0);
20819         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20820         assert(d.display_datacount == 1);
20821         assert(d.display_throughput == 1);
20822         assert(d.display_time == 1);
20823         assert(d.display_percent == 1);
20824         assert(d.display_bar == 1);
20825         assert(d.display_summary == 1);
20826         assert(d.display_ansi == 0);
20827         assert(d.twiddle_fg_color == 0);
20828         assert(d.twiddle_bg_color == 0);
20829         assert(d.twiddle_fg_bold == 0);
20830         assert(d.datacount_fg_color == 0);
20831         assert(d.datacount_bg_color == 0);
20832         assert(d.datacount_fg_bold == 0);
20833         assert(d.throughput_label_fg_color == 0);
20834         assert(d.throughput_label_bg_color == 0);
20835         assert(d.throughput_label_fg_bold == 0);
20836         assert(d.throughput_fg_color == 0);
20837         assert(d.throughput_bg_color == 0);
20838         assert(d.throughput_fg_bold == 0);
20839         assert(d.time_label_fg_color == 0);
20840         assert(d.time_label_bg_color == 0);
20841         assert(d.time_label_fg_bold == 0);
20842         assert(d.percent_fg_color == 0);
20843         assert(d.percent_bg_color == 0);
20844         assert(d.percent_fg_bold == 0);
20845         assert(d.barbrace_fg_color == 0);
20846         assert(d.barbrace_bg_color == 0);
20847         assert(d.barbrace_fg_bold == 0);
20848         assert(d.bar_fg_color == 0);
20849         assert(d.bar_bg_color == 0);
20850         assert(d.bar_fg_bold == 0);
20851         assert(io.in == 0);
20852         assert(io.out == 1);
20853         assert(io.in_ready == 0);
20854         assert(io.out_ready == 0);
20855         assert(io.eof_in == 0);
20856         assert(io.eof_out == 0);
20857         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20858         /* assert(io.cbuf == 0x0); */
20859         assert(io.last_read == 0);
20860         assert(io.last_write == 0);
20861         assert(io.total_read == 0);
20862         assert(io.total_write == 0);
20863         assert(io.total_size == 0);
20864         assert(io.total_size_known == 0);
20865         assert(io.timeout == 250000);
20866 
20867         tmp_rcfile = fopen("test-rcfile.txt", "w");
20868         assert(tmp_rcfile != 0);
20869         fprintf(tmp_rcfile, "display-time: f");
20870         fclose(tmp_rcfile);
20871 
20872         assert(test_parse_rc(out,0));
20873 
20874 #ifdef PRINT_DEBUG
20875         print();
20876 #endif
20877         assert(d.start_time == 0);
20878         assert(d.total_time == 0);
20879         assert(d.current_time == 0);
20880         assert(d.elapsed_time == 0);
20881         assert(d.percent_complete == 0);
20882         assert(d.display_interval == 1);
20883         assert(d.overtime_flag == 0);
20884         assert(d.k == 1024);
20885         assert(d.twiddle == '-');
20886         assert(d.manual_width == 0);
20887         assert(d.screen_width_minus_one == 0);
20888         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20889         assert(d.display_datacount == 1);
20890         assert(d.display_throughput == 1);
20891         assert(d.display_time == 0);
20892         assert(d.display_percent == 1);
20893         assert(d.display_bar == 1);
20894         assert(d.display_summary == 1);
20895         assert(d.display_ansi == 0);
20896         assert(d.twiddle_fg_color == 0);
20897         assert(d.twiddle_bg_color == 0);
20898         assert(d.twiddle_fg_bold == 0);
20899         assert(d.datacount_fg_color == 0);
20900         assert(d.datacount_bg_color == 0);
20901         assert(d.datacount_fg_bold == 0);
20902         assert(d.throughput_label_fg_color == 0);
20903         assert(d.throughput_label_bg_color == 0);
20904         assert(d.throughput_label_fg_bold == 0);
20905         assert(d.throughput_fg_color == 0);
20906         assert(d.throughput_bg_color == 0);
20907         assert(d.throughput_fg_bold == 0);
20908         assert(d.time_label_fg_color == 0);
20909         assert(d.time_label_bg_color == 0);
20910         assert(d.time_label_fg_bold == 0);
20911         assert(d.percent_fg_color == 0);
20912         assert(d.percent_bg_color == 0);
20913         assert(d.percent_fg_bold == 0);
20914         assert(d.barbrace_fg_color == 0);
20915         assert(d.barbrace_bg_color == 0);
20916         assert(d.barbrace_fg_bold == 0);
20917         assert(d.bar_fg_color == 0);
20918         assert(d.bar_bg_color == 0);
20919         assert(d.bar_fg_bold == 0);
20920         assert(io.in == 0);
20921         assert(io.out == 1);
20922         assert(io.in_ready == 0);
20923         assert(io.out_ready == 0);
20924         assert(io.eof_in == 0);
20925         assert(io.eof_out == 0);
20926         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20927         /* assert(io.cbuf == 0x0); */
20928         assert(io.last_read == 0);
20929         assert(io.last_write == 0);
20930         assert(io.total_read == 0);
20931         assert(io.total_write == 0);
20932         assert(io.total_size == 0);
20933         assert(io.total_size_known == 0);
20934         assert(io.timeout == 250000);
20935 
20936         tmp_rcfile = fopen("test-rcfile.txt", "w");
20937         assert(tmp_rcfile != 0);
20938         fprintf(tmp_rcfile, "display-time: t");
20939         fclose(tmp_rcfile);
20940 
20941         assert(test_parse_rc(out,0));
20942 
20943 #ifdef PRINT_DEBUG
20944         print();
20945 #endif
20946         assert(d.start_time == 0);
20947         assert(d.total_time == 0);
20948         assert(d.current_time == 0);
20949         assert(d.elapsed_time == 0);
20950         assert(d.percent_complete == 0);
20951         assert(d.display_interval == 1);
20952         assert(d.overtime_flag == 0);
20953         assert(d.k == 1024);
20954         assert(d.twiddle == '-');
20955         assert(d.manual_width == 0);
20956         assert(d.screen_width_minus_one == 0);
20957         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
20958         assert(d.display_datacount == 1);
20959         assert(d.display_throughput == 1);
20960         assert(d.display_time == 1);
20961         assert(d.display_percent == 1);
20962         assert(d.display_bar == 1);
20963         assert(d.display_summary == 1);
20964         assert(d.display_ansi == 0);
20965         assert(d.twiddle_fg_color == 0);
20966         assert(d.twiddle_bg_color == 0);
20967         assert(d.twiddle_fg_bold == 0);
20968         assert(d.datacount_fg_color == 0);
20969         assert(d.datacount_bg_color == 0);
20970         assert(d.datacount_fg_bold == 0);
20971         assert(d.throughput_label_fg_color == 0);
20972         assert(d.throughput_label_bg_color == 0);
20973         assert(d.throughput_label_fg_bold == 0);
20974         assert(d.throughput_fg_color == 0);
20975         assert(d.throughput_bg_color == 0);
20976         assert(d.throughput_fg_bold == 0);
20977         assert(d.time_label_fg_color == 0);
20978         assert(d.time_label_bg_color == 0);
20979         assert(d.time_label_fg_bold == 0);
20980         assert(d.percent_fg_color == 0);
20981         assert(d.percent_bg_color == 0);
20982         assert(d.percent_fg_bold == 0);
20983         assert(d.barbrace_fg_color == 0);
20984         assert(d.barbrace_bg_color == 0);
20985         assert(d.barbrace_fg_bold == 0);
20986         assert(d.bar_fg_color == 0);
20987         assert(d.bar_bg_color == 0);
20988         assert(d.bar_fg_bold == 0);
20989         assert(io.in == 0);
20990         assert(io.out == 1);
20991         assert(io.in_ready == 0);
20992         assert(io.out_ready == 0);
20993         assert(io.eof_in == 0);
20994         assert(io.eof_out == 0);
20995         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
20996         /* assert(io.cbuf == 0x0); */
20997         assert(io.last_read == 0);
20998         assert(io.last_write == 0);
20999         assert(io.total_read == 0);
21000         assert(io.total_write == 0);
21001         assert(io.total_size == 0);
21002         assert(io.total_size_known == 0);
21003         assert(io.timeout == 250000);
21004 
21005         tmp_rcfile = fopen("test-rcfile.txt", "w");
21006         assert(tmp_rcfile != 0);
21007         fprintf(tmp_rcfile, "display-time: 0");
21008         fclose(tmp_rcfile);
21009 
21010         assert(test_parse_rc(out,0));
21011 
21012 #ifdef PRINT_DEBUG
21013         print();
21014 #endif
21015         assert(d.start_time == 0);
21016         assert(d.total_time == 0);
21017         assert(d.current_time == 0);
21018         assert(d.elapsed_time == 0);
21019         assert(d.percent_complete == 0);
21020         assert(d.display_interval == 1);
21021         assert(d.overtime_flag == 0);
21022         assert(d.k == 1024);
21023         assert(d.twiddle == '-');
21024         assert(d.manual_width == 0);
21025         assert(d.screen_width_minus_one == 0);
21026         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21027         assert(d.display_datacount == 1);
21028         assert(d.display_throughput == 1);
21029         assert(d.display_time == 0);
21030         assert(d.display_percent == 1);
21031         assert(d.display_bar == 1);
21032         assert(d.display_summary == 1);
21033         assert(d.display_ansi == 0);
21034         assert(d.twiddle_fg_color == 0);
21035         assert(d.twiddle_bg_color == 0);
21036         assert(d.twiddle_fg_bold == 0);
21037         assert(d.datacount_fg_color == 0);
21038         assert(d.datacount_bg_color == 0);
21039         assert(d.datacount_fg_bold == 0);
21040         assert(d.throughput_label_fg_color == 0);
21041         assert(d.throughput_label_bg_color == 0);
21042         assert(d.throughput_label_fg_bold == 0);
21043         assert(d.throughput_fg_color == 0);
21044         assert(d.throughput_bg_color == 0);
21045         assert(d.throughput_fg_bold == 0);
21046         assert(d.time_label_fg_color == 0);
21047         assert(d.time_label_bg_color == 0);
21048         assert(d.time_label_fg_bold == 0);
21049         assert(d.percent_fg_color == 0);
21050         assert(d.percent_bg_color == 0);
21051         assert(d.percent_fg_bold == 0);
21052         assert(d.barbrace_fg_color == 0);
21053         assert(d.barbrace_bg_color == 0);
21054         assert(d.barbrace_fg_bold == 0);
21055         assert(d.bar_fg_color == 0);
21056         assert(d.bar_bg_color == 0);
21057         assert(d.bar_fg_bold == 0);
21058         assert(io.in == 0);
21059         assert(io.out == 1);
21060         assert(io.in_ready == 0);
21061         assert(io.out_ready == 0);
21062         assert(io.eof_in == 0);
21063         assert(io.eof_out == 0);
21064         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21065         /* assert(io.cbuf == 0x0); */
21066         assert(io.last_read == 0);
21067         assert(io.last_write == 0);
21068         assert(io.total_read == 0);
21069         assert(io.total_write == 0);
21070         assert(io.total_size == 0);
21071         assert(io.total_size_known == 0);
21072         assert(io.timeout == 250000);
21073 
21074         tmp_rcfile = fopen("test-rcfile.txt", "w");
21075         assert(tmp_rcfile != 0);
21076         fprintf(tmp_rcfile, "display-time: 1");
21077         fclose(tmp_rcfile);
21078 
21079         assert(test_parse_rc(out,0));
21080 
21081 #ifdef PRINT_DEBUG
21082         print();
21083 #endif
21084         assert(d.start_time == 0);
21085         assert(d.total_time == 0);
21086         assert(d.current_time == 0);
21087         assert(d.elapsed_time == 0);
21088         assert(d.percent_complete == 0);
21089         assert(d.display_interval == 1);
21090         assert(d.overtime_flag == 0);
21091         assert(d.k == 1024);
21092         assert(d.twiddle == '-');
21093         assert(d.manual_width == 0);
21094         assert(d.screen_width_minus_one == 0);
21095         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21096         assert(d.display_datacount == 1);
21097         assert(d.display_throughput == 1);
21098         assert(d.display_time == 1);
21099         assert(d.display_percent == 1);
21100         assert(d.display_bar == 1);
21101         assert(d.display_summary == 1);
21102         assert(d.display_ansi == 0);
21103         assert(d.twiddle_fg_color == 0);
21104         assert(d.twiddle_bg_color == 0);
21105         assert(d.twiddle_fg_bold == 0);
21106         assert(d.datacount_fg_color == 0);
21107         assert(d.datacount_bg_color == 0);
21108         assert(d.datacount_fg_bold == 0);
21109         assert(d.throughput_label_fg_color == 0);
21110         assert(d.throughput_label_bg_color == 0);
21111         assert(d.throughput_label_fg_bold == 0);
21112         assert(d.throughput_fg_color == 0);
21113         assert(d.throughput_bg_color == 0);
21114         assert(d.throughput_fg_bold == 0);
21115         assert(d.time_label_fg_color == 0);
21116         assert(d.time_label_bg_color == 0);
21117         assert(d.time_label_fg_bold == 0);
21118         assert(d.percent_fg_color == 0);
21119         assert(d.percent_bg_color == 0);
21120         assert(d.percent_fg_bold == 0);
21121         assert(d.barbrace_fg_color == 0);
21122         assert(d.barbrace_bg_color == 0);
21123         assert(d.barbrace_fg_bold == 0);
21124         assert(d.bar_fg_color == 0);
21125         assert(d.bar_bg_color == 0);
21126         assert(d.bar_fg_bold == 0);
21127         assert(io.in == 0);
21128         assert(io.out == 1);
21129         assert(io.in_ready == 0);
21130         assert(io.out_ready == 0);
21131         assert(io.eof_in == 0);
21132         assert(io.eof_out == 0);
21133         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21134         /* assert(io.cbuf == 0x0); */
21135         assert(io.last_read == 0);
21136         assert(io.last_write == 0);
21137         assert(io.total_read == 0);
21138         assert(io.total_write == 0);
21139         assert(io.total_size == 0);
21140         assert(io.total_size_known == 0);
21141         assert(io.timeout == 250000);
21142 
21143         tmp_rcfile = fopen("test-rcfile.txt", "w");
21144         assert(tmp_rcfile != 0);
21145         fprintf(tmp_rcfile, "display-time: off");
21146         fclose(tmp_rcfile);
21147 
21148         assert(test_parse_rc(out,0));
21149 
21150 #ifdef PRINT_DEBUG
21151         print();
21152 #endif
21153         assert(d.start_time == 0);
21154         assert(d.total_time == 0);
21155         assert(d.current_time == 0);
21156         assert(d.elapsed_time == 0);
21157         assert(d.percent_complete == 0);
21158         assert(d.display_interval == 1);
21159         assert(d.overtime_flag == 0);
21160         assert(d.k == 1024);
21161         assert(d.twiddle == '-');
21162         assert(d.manual_width == 0);
21163         assert(d.screen_width_minus_one == 0);
21164         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21165         assert(d.display_datacount == 1);
21166         assert(d.display_throughput == 1);
21167         assert(d.display_time == 0);
21168         assert(d.display_percent == 1);
21169         assert(d.display_bar == 1);
21170         assert(d.display_summary == 1);
21171         assert(d.display_ansi == 0);
21172         assert(d.twiddle_fg_color == 0);
21173         assert(d.twiddle_bg_color == 0);
21174         assert(d.twiddle_fg_bold == 0);
21175         assert(d.datacount_fg_color == 0);
21176         assert(d.datacount_bg_color == 0);
21177         assert(d.datacount_fg_bold == 0);
21178         assert(d.throughput_label_fg_color == 0);
21179         assert(d.throughput_label_bg_color == 0);
21180         assert(d.throughput_label_fg_bold == 0);
21181         assert(d.throughput_fg_color == 0);
21182         assert(d.throughput_bg_color == 0);
21183         assert(d.throughput_fg_bold == 0);
21184         assert(d.time_label_fg_color == 0);
21185         assert(d.time_label_bg_color == 0);
21186         assert(d.time_label_fg_bold == 0);
21187         assert(d.percent_fg_color == 0);
21188         assert(d.percent_bg_color == 0);
21189         assert(d.percent_fg_bold == 0);
21190         assert(d.barbrace_fg_color == 0);
21191         assert(d.barbrace_bg_color == 0);
21192         assert(d.barbrace_fg_bold == 0);
21193         assert(d.bar_fg_color == 0);
21194         assert(d.bar_bg_color == 0);
21195         assert(d.bar_fg_bold == 0);
21196         assert(io.in == 0);
21197         assert(io.out == 1);
21198         assert(io.in_ready == 0);
21199         assert(io.out_ready == 0);
21200         assert(io.eof_in == 0);
21201         assert(io.eof_out == 0);
21202         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21203         /* assert(io.cbuf == 0x0); */
21204         assert(io.last_read == 0);
21205         assert(io.last_write == 0);
21206         assert(io.total_read == 0);
21207         assert(io.total_write == 0);
21208         assert(io.total_size == 0);
21209         assert(io.total_size_known == 0);
21210         assert(io.timeout == 250000);
21211 
21212         tmp_rcfile = fopen("test-rcfile.txt", "w");
21213         assert(tmp_rcfile != 0);
21214         fprintf(tmp_rcfile, "display-time: on");
21215         fclose(tmp_rcfile);
21216 
21217         assert(test_parse_rc(out,0));
21218 
21219 #ifdef PRINT_DEBUG
21220         print();
21221 #endif
21222         assert(d.start_time == 0);
21223         assert(d.total_time == 0);
21224         assert(d.current_time == 0);
21225         assert(d.elapsed_time == 0);
21226         assert(d.percent_complete == 0);
21227         assert(d.display_interval == 1);
21228         assert(d.overtime_flag == 0);
21229         assert(d.k == 1024);
21230         assert(d.twiddle == '-');
21231         assert(d.manual_width == 0);
21232         assert(d.screen_width_minus_one == 0);
21233         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21234         assert(d.display_datacount == 1);
21235         assert(d.display_throughput == 1);
21236         assert(d.display_time == 1);
21237         assert(d.display_percent == 1);
21238         assert(d.display_bar == 1);
21239         assert(d.display_summary == 1);
21240         assert(d.display_ansi == 0);
21241         assert(d.twiddle_fg_color == 0);
21242         assert(d.twiddle_bg_color == 0);
21243         assert(d.twiddle_fg_bold == 0);
21244         assert(d.datacount_fg_color == 0);
21245         assert(d.datacount_bg_color == 0);
21246         assert(d.datacount_fg_bold == 0);
21247         assert(d.throughput_label_fg_color == 0);
21248         assert(d.throughput_label_bg_color == 0);
21249         assert(d.throughput_label_fg_bold == 0);
21250         assert(d.throughput_fg_color == 0);
21251         assert(d.throughput_bg_color == 0);
21252         assert(d.throughput_fg_bold == 0);
21253         assert(d.time_label_fg_color == 0);
21254         assert(d.time_label_bg_color == 0);
21255         assert(d.time_label_fg_bold == 0);
21256         assert(d.percent_fg_color == 0);
21257         assert(d.percent_bg_color == 0);
21258         assert(d.percent_fg_bold == 0);
21259         assert(d.barbrace_fg_color == 0);
21260         assert(d.barbrace_bg_color == 0);
21261         assert(d.barbrace_fg_bold == 0);
21262         assert(d.bar_fg_color == 0);
21263         assert(d.bar_bg_color == 0);
21264         assert(d.bar_fg_bold == 0);
21265         assert(io.in == 0);
21266         assert(io.out == 1);
21267         assert(io.in_ready == 0);
21268         assert(io.out_ready == 0);
21269         assert(io.eof_in == 0);
21270         assert(io.eof_out == 0);
21271         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21272         /* assert(io.cbuf == 0x0); */
21273         assert(io.last_read == 0);
21274         assert(io.last_write == 0);
21275         assert(io.total_read == 0);
21276         assert(io.total_write == 0);
21277         assert(io.total_size == 0);
21278         assert(io.total_size_known == 0);
21279         assert(io.timeout == 250000);
21280 
21281         assert(unlink("./test-rcfile.txt") == 0);
21282 }
21283 
21284 void test131(FILE *out)
21285 {
21286         FILE *tmp_rcfile = 0;
21287         
21288         tmp_rcfile = fopen("test-rcfile.txt", "w");
21289         assert(tmp_rcfile != 0);
21290         fprintf(tmp_rcfile, "display-percent: Sjkhg");
21291         fclose(tmp_rcfile);
21292 
21293         clear_errno();
21294         ioInit();
21295         displayInit();
21296 
21297 #ifdef PRINT_DEBUG
21298         print();
21299 #endif
21300         assert(d.start_time == 0);
21301         assert(d.total_time == 0);
21302         assert(d.current_time == 0);
21303         assert(d.elapsed_time == 0);
21304         assert(d.percent_complete == 0);
21305         assert(d.display_interval == 1);
21306         assert(d.overtime_flag == 0);
21307         assert(d.k == 1024);
21308         assert(d.twiddle == '-');
21309         assert(d.manual_width == 0);
21310         assert(d.screen_width_minus_one == 0);
21311         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21312         assert(d.display_datacount == 1);
21313         assert(d.display_throughput == 1);
21314         assert(d.display_time == 1);
21315         assert(d.display_percent == 1);
21316         assert(d.display_bar == 1);
21317         assert(d.display_summary == 1);
21318         assert(d.display_ansi == 0);
21319         assert(d.twiddle_fg_color == 0);
21320         assert(d.twiddle_bg_color == 0);
21321         assert(d.twiddle_fg_bold == 0);
21322         assert(d.datacount_fg_color == 0);
21323         assert(d.datacount_bg_color == 0);
21324         assert(d.datacount_fg_bold == 0);
21325         assert(d.throughput_label_fg_color == 0);
21326         assert(d.throughput_label_bg_color == 0);
21327         assert(d.throughput_label_fg_bold == 0);
21328         assert(d.throughput_fg_color == 0);
21329         assert(d.throughput_bg_color == 0);
21330         assert(d.throughput_fg_bold == 0);
21331         assert(d.time_label_fg_color == 0);
21332         assert(d.time_label_bg_color == 0);
21333         assert(d.time_label_fg_bold == 0);
21334         assert(d.percent_fg_color == 0);
21335         assert(d.percent_bg_color == 0);
21336         assert(d.percent_fg_bold == 0);
21337         assert(d.barbrace_fg_color == 0);
21338         assert(d.barbrace_bg_color == 0);
21339         assert(d.barbrace_fg_bold == 0);
21340         assert(d.bar_fg_color == 0);
21341         assert(d.bar_bg_color == 0);
21342         assert(d.bar_fg_bold == 0);
21343         assert(io.in == 0);
21344         assert(io.out == 1);
21345         assert(io.in_ready == 0);
21346         assert(io.out_ready == 0);
21347         assert(io.eof_in == 0);
21348         assert(io.eof_out == 0);
21349         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21350         /* assert(io.cbuf == 0x0); */
21351         assert(io.last_read == 0);
21352         assert(io.last_write == 0);
21353         assert(io.total_read == 0);
21354         assert(io.total_write == 0);
21355         assert(io.total_size == 0);
21356         assert(io.total_size_known == 0);
21357         assert(io.timeout == 250000);
21358 
21359         assert(test_parse_rc(out,1));
21360 
21361 #ifdef PRINT_DEBUG
21362         print();
21363 #endif
21364         assert(d.start_time == 0);
21365         assert(d.total_time == 0);
21366         assert(d.current_time == 0);
21367         assert(d.elapsed_time == 0);
21368         assert(d.percent_complete == 0);
21369         assert(d.display_interval == 1);
21370         assert(d.overtime_flag == 0);
21371         assert(d.k == 1024);
21372         assert(d.twiddle == '-');
21373         assert(d.manual_width == 0);
21374         assert(d.screen_width_minus_one == 0);
21375         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21376         assert(d.display_datacount == 1);
21377         assert(d.display_throughput == 1);
21378         assert(d.display_time == 1);
21379         assert(d.display_percent == 1);
21380         assert(d.display_bar == 1);
21381         assert(d.display_summary == 1);
21382         assert(d.display_ansi == 0);
21383         assert(d.twiddle_fg_color == 0);
21384         assert(d.twiddle_bg_color == 0);
21385         assert(d.twiddle_fg_bold == 0);
21386         assert(d.datacount_fg_color == 0);
21387         assert(d.datacount_bg_color == 0);
21388         assert(d.datacount_fg_bold == 0);
21389         assert(d.throughput_label_fg_color == 0);
21390         assert(d.throughput_label_bg_color == 0);
21391         assert(d.throughput_label_fg_bold == 0);
21392         assert(d.throughput_fg_color == 0);
21393         assert(d.throughput_bg_color == 0);
21394         assert(d.throughput_fg_bold == 0);
21395         assert(d.time_label_fg_color == 0);
21396         assert(d.time_label_bg_color == 0);
21397         assert(d.time_label_fg_bold == 0);
21398         assert(d.percent_fg_color == 0);
21399         assert(d.percent_bg_color == 0);
21400         assert(d.percent_fg_bold == 0);
21401         assert(d.barbrace_fg_color == 0);
21402         assert(d.barbrace_bg_color == 0);
21403         assert(d.barbrace_fg_bold == 0);
21404         assert(d.bar_fg_color == 0);
21405         assert(d.bar_bg_color == 0);
21406         assert(d.bar_fg_bold == 0);
21407         assert(io.in == 0);
21408         assert(io.out == 1);
21409         assert(io.in_ready == 0);
21410         assert(io.out_ready == 0);
21411         assert(io.eof_in == 0);
21412         assert(io.eof_out == 0);
21413         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21414         /* assert(io.cbuf == 0x0); */
21415         assert(io.last_read == 0);
21416         assert(io.last_write == 0);
21417         assert(io.total_read == 0);
21418         assert(io.total_write == 0);
21419         assert(io.total_size == 0);
21420         assert(io.total_size_known == 0);
21421         assert(io.timeout == 250000);
21422 
21423         tmp_rcfile = fopen("test-rcfile.txt", "w");
21424         assert(tmp_rcfile != 0);
21425         fprintf(tmp_rcfile, "display-percent: no");
21426         fclose(tmp_rcfile);
21427 
21428         assert(test_parse_rc(out,0));
21429 
21430 #ifdef PRINT_DEBUG
21431         print();
21432 #endif
21433         assert(d.start_time == 0);
21434         assert(d.total_time == 0);
21435         assert(d.current_time == 0);
21436         assert(d.elapsed_time == 0);
21437         assert(d.percent_complete == 0);
21438         assert(d.display_interval == 1);
21439         assert(d.overtime_flag == 0);
21440         assert(d.k == 1024);
21441         assert(d.twiddle == '-');
21442         assert(d.manual_width == 0);
21443         assert(d.screen_width_minus_one == 0);
21444         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21445         assert(d.display_datacount == 1);
21446         assert(d.display_throughput == 1);
21447         assert(d.display_time == 1);
21448         assert(d.display_percent == 0);
21449         assert(d.display_bar == 1);
21450         assert(d.display_summary == 1);
21451         assert(d.display_ansi == 0);
21452         assert(d.twiddle_fg_color == 0);
21453         assert(d.twiddle_bg_color == 0);
21454         assert(d.twiddle_fg_bold == 0);
21455         assert(d.datacount_fg_color == 0);
21456         assert(d.datacount_bg_color == 0);
21457         assert(d.datacount_fg_bold == 0);
21458         assert(d.throughput_label_fg_color == 0);
21459         assert(d.throughput_label_bg_color == 0);
21460         assert(d.throughput_label_fg_bold == 0);
21461         assert(d.throughput_fg_color == 0);
21462         assert(d.throughput_bg_color == 0);
21463         assert(d.throughput_fg_bold == 0);
21464         assert(d.time_label_fg_color == 0);
21465         assert(d.time_label_bg_color == 0);
21466         assert(d.time_label_fg_bold == 0);
21467         assert(d.percent_fg_color == 0);
21468         assert(d.percent_bg_color == 0);
21469         assert(d.percent_fg_bold == 0);
21470         assert(d.barbrace_fg_color == 0);
21471         assert(d.barbrace_bg_color == 0);
21472         assert(d.barbrace_fg_bold == 0);
21473         assert(d.bar_fg_color == 0);
21474         assert(d.bar_bg_color == 0);
21475         assert(d.bar_fg_bold == 0);
21476         assert(io.in == 0);
21477         assert(io.out == 1);
21478         assert(io.in_ready == 0);
21479         assert(io.out_ready == 0);
21480         assert(io.eof_in == 0);
21481         assert(io.eof_out == 0);
21482         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21483         /* assert(io.cbuf == 0x0); */
21484         assert(io.last_read == 0);
21485         assert(io.last_write == 0);
21486         assert(io.total_read == 0);
21487         assert(io.total_write == 0);
21488         assert(io.total_size == 0);
21489         assert(io.total_size_known == 0);
21490         assert(io.timeout == 250000);
21491 
21492         tmp_rcfile = fopen("test-rcfile.txt", "w");
21493         assert(tmp_rcfile != 0);
21494         fprintf(tmp_rcfile, "display-percent: yes");
21495         fclose(tmp_rcfile);
21496 
21497         assert(test_parse_rc(out,0));
21498 
21499 #ifdef PRINT_DEBUG
21500         print();
21501 #endif
21502         assert(d.start_time == 0);
21503         assert(d.total_time == 0);
21504         assert(d.current_time == 0);
21505         assert(d.elapsed_time == 0);
21506         assert(d.percent_complete == 0);
21507         assert(d.display_interval == 1);
21508         assert(d.overtime_flag == 0);
21509         assert(d.k == 1024);
21510         assert(d.twiddle == '-');
21511         assert(d.manual_width == 0);
21512         assert(d.screen_width_minus_one == 0);
21513         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21514         assert(d.display_datacount == 1);
21515         assert(d.display_throughput == 1);
21516         assert(d.display_time == 1);
21517         assert(d.display_percent == 1);
21518         assert(d.display_bar == 1);
21519         assert(d.display_summary == 1);
21520         assert(d.display_ansi == 0);
21521         assert(d.twiddle_fg_color == 0);
21522         assert(d.twiddle_bg_color == 0);
21523         assert(d.twiddle_fg_bold == 0);
21524         assert(d.datacount_fg_color == 0);
21525         assert(d.datacount_bg_color == 0);
21526         assert(d.datacount_fg_bold == 0);
21527         assert(d.throughput_label_fg_color == 0);
21528         assert(d.throughput_label_bg_color == 0);
21529         assert(d.throughput_label_fg_bold == 0);
21530         assert(d.throughput_fg_color == 0);
21531         assert(d.throughput_bg_color == 0);
21532         assert(d.throughput_fg_bold == 0);
21533         assert(d.time_label_fg_color == 0);
21534         assert(d.time_label_bg_color == 0);
21535         assert(d.time_label_fg_bold == 0);
21536         assert(d.percent_fg_color == 0);
21537         assert(d.percent_bg_color == 0);
21538         assert(d.percent_fg_bold == 0);
21539         assert(d.barbrace_fg_color == 0);
21540         assert(d.barbrace_bg_color == 0);
21541         assert(d.barbrace_fg_bold == 0);
21542         assert(d.bar_fg_color == 0);
21543         assert(d.bar_bg_color == 0);
21544         assert(d.bar_fg_bold == 0);
21545         assert(io.in == 0);
21546         assert(io.out == 1);
21547         assert(io.in_ready == 0);
21548         assert(io.out_ready == 0);
21549         assert(io.eof_in == 0);
21550         assert(io.eof_out == 0);
21551         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21552         /* assert(io.cbuf == 0x0); */
21553         assert(io.last_read == 0);
21554         assert(io.last_write == 0);
21555         assert(io.total_read == 0);
21556         assert(io.total_write == 0);
21557         assert(io.total_size == 0);
21558         assert(io.total_size_known == 0);
21559         assert(io.timeout == 250000);
21560 
21561         tmp_rcfile = fopen("test-rcfile.txt", "w");
21562         assert(tmp_rcfile != 0);
21563         fprintf(tmp_rcfile, "display-percent: n");
21564         fclose(tmp_rcfile);
21565 
21566         assert(test_parse_rc(out,0));
21567 
21568 #ifdef PRINT_DEBUG
21569         print();
21570 #endif
21571         assert(d.start_time == 0);
21572         assert(d.total_time == 0);
21573         assert(d.current_time == 0);
21574         assert(d.elapsed_time == 0);
21575         assert(d.percent_complete == 0);
21576         assert(d.display_interval == 1);
21577         assert(d.overtime_flag == 0);
21578         assert(d.k == 1024);
21579         assert(d.twiddle == '-');
21580         assert(d.manual_width == 0);
21581         assert(d.screen_width_minus_one == 0);
21582         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21583         assert(d.display_datacount == 1);
21584         assert(d.display_throughput == 1);
21585         assert(d.display_time == 1);
21586         assert(d.display_percent == 0);
21587         assert(d.display_bar == 1);
21588         assert(d.display_summary == 1);
21589         assert(d.display_ansi == 0);
21590         assert(d.twiddle_fg_color == 0);
21591         assert(d.twiddle_bg_color == 0);
21592         assert(d.twiddle_fg_bold == 0);
21593         assert(d.datacount_fg_color == 0);
21594         assert(d.datacount_bg_color == 0);
21595         assert(d.datacount_fg_bold == 0);
21596         assert(d.throughput_label_fg_color == 0);
21597         assert(d.throughput_label_bg_color == 0);
21598         assert(d.throughput_label_fg_bold == 0);
21599         assert(d.throughput_fg_color == 0);
21600         assert(d.throughput_bg_color == 0);
21601         assert(d.throughput_fg_bold == 0);
21602         assert(d.time_label_fg_color == 0);
21603         assert(d.time_label_bg_color == 0);
21604         assert(d.time_label_fg_bold == 0);
21605         assert(d.percent_fg_color == 0);
21606         assert(d.percent_bg_color == 0);
21607         assert(d.percent_fg_bold == 0);
21608         assert(d.barbrace_fg_color == 0);
21609         assert(d.barbrace_bg_color == 0);
21610         assert(d.barbrace_fg_bold == 0);
21611         assert(d.bar_fg_color == 0);
21612         assert(d.bar_bg_color == 0);
21613         assert(d.bar_fg_bold == 0);
21614         assert(io.in == 0);
21615         assert(io.out == 1);
21616         assert(io.in_ready == 0);
21617         assert(io.out_ready == 0);
21618         assert(io.eof_in == 0);
21619         assert(io.eof_out == 0);
21620         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21621         /* assert(io.cbuf == 0x0); */
21622         assert(io.last_read == 0);
21623         assert(io.last_write == 0);
21624         assert(io.total_read == 0);
21625         assert(io.total_write == 0);
21626         assert(io.total_size == 0);
21627         assert(io.total_size_known == 0);
21628         assert(io.timeout == 250000);
21629 
21630         tmp_rcfile = fopen("test-rcfile.txt", "w");
21631         assert(tmp_rcfile != 0);
21632         fprintf(tmp_rcfile, "display-percent: y");
21633         fclose(tmp_rcfile);
21634 
21635         assert(test_parse_rc(out,0));
21636 
21637 #ifdef PRINT_DEBUG
21638         print();
21639 #endif
21640         assert(d.start_time == 0);
21641         assert(d.total_time == 0);
21642         assert(d.current_time == 0);
21643         assert(d.elapsed_time == 0);
21644         assert(d.percent_complete == 0);
21645         assert(d.display_interval == 1);
21646         assert(d.overtime_flag == 0);
21647         assert(d.k == 1024);
21648         assert(d.twiddle == '-');
21649         assert(d.manual_width == 0);
21650         assert(d.screen_width_minus_one == 0);
21651         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21652         assert(d.display_datacount == 1);
21653         assert(d.display_throughput == 1);
21654         assert(d.display_time == 1);
21655         assert(d.display_percent == 1);
21656         assert(d.display_bar == 1);
21657         assert(d.display_summary == 1);
21658         assert(d.display_ansi == 0);
21659         assert(d.twiddle_fg_color == 0);
21660         assert(d.twiddle_bg_color == 0);
21661         assert(d.twiddle_fg_bold == 0);
21662         assert(d.datacount_fg_color == 0);
21663         assert(d.datacount_bg_color == 0);
21664         assert(d.datacount_fg_bold == 0);
21665         assert(d.throughput_label_fg_color == 0);
21666         assert(d.throughput_label_bg_color == 0);
21667         assert(d.throughput_label_fg_bold == 0);
21668         assert(d.throughput_fg_color == 0);
21669         assert(d.throughput_bg_color == 0);
21670         assert(d.throughput_fg_bold == 0);
21671         assert(d.time_label_fg_color == 0);
21672         assert(d.time_label_bg_color == 0);
21673         assert(d.time_label_fg_bold == 0);
21674         assert(d.percent_fg_color == 0);
21675         assert(d.percent_bg_color == 0);
21676         assert(d.percent_fg_bold == 0);
21677         assert(d.barbrace_fg_color == 0);
21678         assert(d.barbrace_bg_color == 0);
21679         assert(d.barbrace_fg_bold == 0);
21680         assert(d.bar_fg_color == 0);
21681         assert(d.bar_bg_color == 0);
21682         assert(d.bar_fg_bold == 0);
21683         assert(io.in == 0);
21684         assert(io.out == 1);
21685         assert(io.in_ready == 0);
21686         assert(io.out_ready == 0);
21687         assert(io.eof_in == 0);
21688         assert(io.eof_out == 0);
21689         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21690         /* assert(io.cbuf == 0x0); */
21691         assert(io.last_read == 0);
21692         assert(io.last_write == 0);
21693         assert(io.total_read == 0);
21694         assert(io.total_write == 0);
21695         assert(io.total_size == 0);
21696         assert(io.total_size_known == 0);
21697         assert(io.timeout == 250000);
21698 
21699         tmp_rcfile = fopen("test-rcfile.txt", "w");
21700         assert(tmp_rcfile != 0);
21701         fprintf(tmp_rcfile, "display-percent: false");
21702         fclose(tmp_rcfile);
21703 
21704         assert(test_parse_rc(out,0));
21705 
21706 #ifdef PRINT_DEBUG
21707         print();
21708 #endif
21709         assert(d.start_time == 0);
21710         assert(d.total_time == 0);
21711         assert(d.current_time == 0);
21712         assert(d.elapsed_time == 0);
21713         assert(d.percent_complete == 0);
21714         assert(d.display_interval == 1);
21715         assert(d.overtime_flag == 0);
21716         assert(d.k == 1024);
21717         assert(d.twiddle == '-');
21718         assert(d.manual_width == 0);
21719         assert(d.screen_width_minus_one == 0);
21720         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21721         assert(d.display_datacount == 1);
21722         assert(d.display_throughput == 1);
21723         assert(d.display_time == 1);
21724         assert(d.display_percent == 0);
21725         assert(d.display_bar == 1);
21726         assert(d.display_summary == 1);
21727         assert(d.display_ansi == 0);
21728         assert(d.twiddle_fg_color == 0);
21729         assert(d.twiddle_bg_color == 0);
21730         assert(d.twiddle_fg_bold == 0);
21731         assert(d.datacount_fg_color == 0);
21732         assert(d.datacount_bg_color == 0);
21733         assert(d.datacount_fg_bold == 0);
21734         assert(d.throughput_label_fg_color == 0);
21735         assert(d.throughput_label_bg_color == 0);
21736         assert(d.throughput_label_fg_bold == 0);
21737         assert(d.throughput_fg_color == 0);
21738         assert(d.throughput_bg_color == 0);
21739         assert(d.throughput_fg_bold == 0);
21740         assert(d.time_label_fg_color == 0);
21741         assert(d.time_label_bg_color == 0);
21742         assert(d.time_label_fg_bold == 0);
21743         assert(d.percent_fg_color == 0);
21744         assert(d.percent_bg_color == 0);
21745         assert(d.percent_fg_bold == 0);
21746         assert(d.barbrace_fg_color == 0);
21747         assert(d.barbrace_bg_color == 0);
21748         assert(d.barbrace_fg_bold == 0);
21749         assert(d.bar_fg_color == 0);
21750         assert(d.bar_bg_color == 0);
21751         assert(d.bar_fg_bold == 0);
21752         assert(io.in == 0);
21753         assert(io.out == 1);
21754         assert(io.in_ready == 0);
21755         assert(io.out_ready == 0);
21756         assert(io.eof_in == 0);
21757         assert(io.eof_out == 0);
21758         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21759         /* assert(io.cbuf == 0x0); */
21760         assert(io.last_read == 0);
21761         assert(io.last_write == 0);
21762         assert(io.total_read == 0);
21763         assert(io.total_write == 0);
21764         assert(io.total_size == 0);
21765         assert(io.total_size_known == 0);
21766         assert(io.timeout == 250000);
21767 
21768         tmp_rcfile = fopen("test-rcfile.txt", "w");
21769         assert(tmp_rcfile != 0);
21770         fprintf(tmp_rcfile, "display-percent: true");
21771         fclose(tmp_rcfile);
21772 
21773         assert(test_parse_rc(out,0));
21774 
21775 #ifdef PRINT_DEBUG
21776         print();
21777 #endif
21778         assert(d.start_time == 0);
21779         assert(d.total_time == 0);
21780         assert(d.current_time == 0);
21781         assert(d.elapsed_time == 0);
21782         assert(d.percent_complete == 0);
21783         assert(d.display_interval == 1);
21784         assert(d.overtime_flag == 0);
21785         assert(d.k == 1024);
21786         assert(d.twiddle == '-');
21787         assert(d.manual_width == 0);
21788         assert(d.screen_width_minus_one == 0);
21789         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21790         assert(d.display_datacount == 1);
21791         assert(d.display_throughput == 1);
21792         assert(d.display_time == 1);
21793         assert(d.display_percent == 1);
21794         assert(d.display_bar == 1);
21795         assert(d.display_summary == 1);
21796         assert(d.display_ansi == 0);
21797         assert(d.twiddle_fg_color == 0);
21798         assert(d.twiddle_bg_color == 0);
21799         assert(d.twiddle_fg_bold == 0);
21800         assert(d.datacount_fg_color == 0);
21801         assert(d.datacount_bg_color == 0);
21802         assert(d.datacount_fg_bold == 0);
21803         assert(d.throughput_label_fg_color == 0);
21804         assert(d.throughput_label_bg_color == 0);
21805         assert(d.throughput_label_fg_bold == 0);
21806         assert(d.throughput_fg_color == 0);
21807         assert(d.throughput_bg_color == 0);
21808         assert(d.throughput_fg_bold == 0);
21809         assert(d.time_label_fg_color == 0);
21810         assert(d.time_label_bg_color == 0);
21811         assert(d.time_label_fg_bold == 0);
21812         assert(d.percent_fg_color == 0);
21813         assert(d.percent_bg_color == 0);
21814         assert(d.percent_fg_bold == 0);
21815         assert(d.barbrace_fg_color == 0);
21816         assert(d.barbrace_bg_color == 0);
21817         assert(d.barbrace_fg_bold == 0);
21818         assert(d.bar_fg_color == 0);
21819         assert(d.bar_bg_color == 0);
21820         assert(d.bar_fg_bold == 0);
21821         assert(io.in == 0);
21822         assert(io.out == 1);
21823         assert(io.in_ready == 0);
21824         assert(io.out_ready == 0);
21825         assert(io.eof_in == 0);
21826         assert(io.eof_out == 0);
21827         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21828         /* assert(io.cbuf == 0x0); */
21829         assert(io.last_read == 0);
21830         assert(io.last_write == 0);
21831         assert(io.total_read == 0);
21832         assert(io.total_write == 0);
21833         assert(io.total_size == 0);
21834         assert(io.total_size_known == 0);
21835         assert(io.timeout == 250000);
21836 
21837         tmp_rcfile = fopen("test-rcfile.txt", "w");
21838         assert(tmp_rcfile != 0);
21839         fprintf(tmp_rcfile, "display-percent: f");
21840         fclose(tmp_rcfile);
21841 
21842         assert(test_parse_rc(out,0));
21843 
21844 #ifdef PRINT_DEBUG
21845         print();
21846 #endif
21847         assert(d.start_time == 0);
21848         assert(d.total_time == 0);
21849         assert(d.current_time == 0);
21850         assert(d.elapsed_time == 0);
21851         assert(d.percent_complete == 0);
21852         assert(d.display_interval == 1);
21853         assert(d.overtime_flag == 0);
21854         assert(d.k == 1024);
21855         assert(d.twiddle == '-');
21856         assert(d.manual_width == 0);
21857         assert(d.screen_width_minus_one == 0);
21858         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21859         assert(d.display_datacount == 1);
21860         assert(d.display_throughput == 1);
21861         assert(d.display_time == 1);
21862         assert(d.display_percent == 0);
21863         assert(d.display_bar == 1);
21864         assert(d.display_summary == 1);
21865         assert(d.display_ansi == 0);
21866         assert(d.twiddle_fg_color == 0);
21867         assert(d.twiddle_bg_color == 0);
21868         assert(d.twiddle_fg_bold == 0);
21869         assert(d.datacount_fg_color == 0);
21870         assert(d.datacount_bg_color == 0);
21871         assert(d.datacount_fg_bold == 0);
21872         assert(d.throughput_label_fg_color == 0);
21873         assert(d.throughput_label_bg_color == 0);
21874         assert(d.throughput_label_fg_bold == 0);
21875         assert(d.throughput_fg_color == 0);
21876         assert(d.throughput_bg_color == 0);
21877         assert(d.throughput_fg_bold == 0);
21878         assert(d.time_label_fg_color == 0);
21879         assert(d.time_label_bg_color == 0);
21880         assert(d.time_label_fg_bold == 0);
21881         assert(d.percent_fg_color == 0);
21882         assert(d.percent_bg_color == 0);
21883         assert(d.percent_fg_bold == 0);
21884         assert(d.barbrace_fg_color == 0);
21885         assert(d.barbrace_bg_color == 0);
21886         assert(d.barbrace_fg_bold == 0);
21887         assert(d.bar_fg_color == 0);
21888         assert(d.bar_bg_color == 0);
21889         assert(d.bar_fg_bold == 0);
21890         assert(io.in == 0);
21891         assert(io.out == 1);
21892         assert(io.in_ready == 0);
21893         assert(io.out_ready == 0);
21894         assert(io.eof_in == 0);
21895         assert(io.eof_out == 0);
21896         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21897         /* assert(io.cbuf == 0x0); */
21898         assert(io.last_read == 0);
21899         assert(io.last_write == 0);
21900         assert(io.total_read == 0);
21901         assert(io.total_write == 0);
21902         assert(io.total_size == 0);
21903         assert(io.total_size_known == 0);
21904         assert(io.timeout == 250000);
21905 
21906         tmp_rcfile = fopen("test-rcfile.txt", "w");
21907         assert(tmp_rcfile != 0);
21908         fprintf(tmp_rcfile, "display-percent: t");
21909         fclose(tmp_rcfile);
21910 
21911         assert(test_parse_rc(out,0));
21912 
21913 #ifdef PRINT_DEBUG
21914         print();
21915 #endif
21916         assert(d.start_time == 0);
21917         assert(d.total_time == 0);
21918         assert(d.current_time == 0);
21919         assert(d.elapsed_time == 0);
21920         assert(d.percent_complete == 0);
21921         assert(d.display_interval == 1);
21922         assert(d.overtime_flag == 0);
21923         assert(d.k == 1024);
21924         assert(d.twiddle == '-');
21925         assert(d.manual_width == 0);
21926         assert(d.screen_width_minus_one == 0);
21927         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21928         assert(d.display_datacount == 1);
21929         assert(d.display_throughput == 1);
21930         assert(d.display_time == 1);
21931         assert(d.display_percent == 1);
21932         assert(d.display_bar == 1);
21933         assert(d.display_summary == 1);
21934         assert(d.display_ansi == 0);
21935         assert(d.twiddle_fg_color == 0);
21936         assert(d.twiddle_bg_color == 0);
21937         assert(d.twiddle_fg_bold == 0);
21938         assert(d.datacount_fg_color == 0);
21939         assert(d.datacount_bg_color == 0);
21940         assert(d.datacount_fg_bold == 0);
21941         assert(d.throughput_label_fg_color == 0);
21942         assert(d.throughput_label_bg_color == 0);
21943         assert(d.throughput_label_fg_bold == 0);
21944         assert(d.throughput_fg_color == 0);
21945         assert(d.throughput_bg_color == 0);
21946         assert(d.throughput_fg_bold == 0);
21947         assert(d.time_label_fg_color == 0);
21948         assert(d.time_label_bg_color == 0);
21949         assert(d.time_label_fg_bold == 0);
21950         assert(d.percent_fg_color == 0);
21951         assert(d.percent_bg_color == 0);
21952         assert(d.percent_fg_bold == 0);
21953         assert(d.barbrace_fg_color == 0);
21954         assert(d.barbrace_bg_color == 0);
21955         assert(d.barbrace_fg_bold == 0);
21956         assert(d.bar_fg_color == 0);
21957         assert(d.bar_bg_color == 0);
21958         assert(d.bar_fg_bold == 0);
21959         assert(io.in == 0);
21960         assert(io.out == 1);
21961         assert(io.in_ready == 0);
21962         assert(io.out_ready == 0);
21963         assert(io.eof_in == 0);
21964         assert(io.eof_out == 0);
21965         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
21966         /* assert(io.cbuf == 0x0); */
21967         assert(io.last_read == 0);
21968         assert(io.last_write == 0);
21969         assert(io.total_read == 0);
21970         assert(io.total_write == 0);
21971         assert(io.total_size == 0);
21972         assert(io.total_size_known == 0);
21973         assert(io.timeout == 250000);
21974 
21975         tmp_rcfile = fopen("test-rcfile.txt", "w");
21976         assert(tmp_rcfile != 0);
21977         fprintf(tmp_rcfile, "display-percent: 0");
21978         fclose(tmp_rcfile);
21979 
21980         assert(test_parse_rc(out,0));
21981 
21982 #ifdef PRINT_DEBUG
21983         print();
21984 #endif
21985         assert(d.start_time == 0);
21986         assert(d.total_time == 0);
21987         assert(d.current_time == 0);
21988         assert(d.elapsed_time == 0);
21989         assert(d.percent_complete == 0);
21990         assert(d.display_interval == 1);
21991         assert(d.overtime_flag == 0);
21992         assert(d.k == 1024);
21993         assert(d.twiddle == '-');
21994         assert(d.manual_width == 0);
21995         assert(d.screen_width_minus_one == 0);
21996         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
21997         assert(d.display_datacount == 1);
21998         assert(d.display_throughput == 1);
21999         assert(d.display_time == 1);
22000         assert(d.display_percent == 0);
22001         assert(d.display_bar == 1);
22002         assert(d.display_summary == 1);
22003         assert(d.display_ansi == 0);
22004         assert(d.twiddle_fg_color == 0);
22005         assert(d.twiddle_bg_color == 0);
22006         assert(d.twiddle_fg_bold == 0);
22007         assert(d.datacount_fg_color == 0);
22008         assert(d.datacount_bg_color == 0);
22009         assert(d.datacount_fg_bold == 0);
22010         assert(d.throughput_label_fg_color == 0);
22011         assert(d.throughput_label_bg_color == 0);
22012         assert(d.throughput_label_fg_bold == 0);
22013         assert(d.throughput_fg_color == 0);
22014         assert(d.throughput_bg_color == 0);
22015         assert(d.throughput_fg_bold == 0);
22016         assert(d.time_label_fg_color == 0);
22017         assert(d.time_label_bg_color == 0);
22018         assert(d.time_label_fg_bold == 0);
22019         assert(d.percent_fg_color == 0);
22020         assert(d.percent_bg_color == 0);
22021         assert(d.percent_fg_bold == 0);
22022         assert(d.barbrace_fg_color == 0);
22023         assert(d.barbrace_bg_color == 0);
22024         assert(d.barbrace_fg_bold == 0);
22025         assert(d.bar_fg_color == 0);
22026         assert(d.bar_bg_color == 0);
22027         assert(d.bar_fg_bold == 0);
22028         assert(io.in == 0);
22029         assert(io.out == 1);
22030         assert(io.in_ready == 0);
22031         assert(io.out_ready == 0);
22032         assert(io.eof_in == 0);
22033         assert(io.eof_out == 0);
22034         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22035         /* assert(io.cbuf == 0x0); */
22036         assert(io.last_read == 0);
22037         assert(io.last_write == 0);
22038         assert(io.total_read == 0);
22039         assert(io.total_write == 0);
22040         assert(io.total_size == 0);
22041         assert(io.total_size_known == 0);
22042         assert(io.timeout == 250000);
22043 
22044         tmp_rcfile = fopen("test-rcfile.txt", "w");
22045         assert(tmp_rcfile != 0);
22046         fprintf(tmp_rcfile, "display-percent: 1");
22047         fclose(tmp_rcfile);
22048 
22049         assert(test_parse_rc(out,0));
22050 
22051 #ifdef PRINT_DEBUG
22052         print();
22053 #endif
22054         assert(d.start_time == 0);
22055         assert(d.total_time == 0);
22056         assert(d.current_time == 0);
22057         assert(d.elapsed_time == 0);
22058         assert(d.percent_complete == 0);
22059         assert(d.display_interval == 1);
22060         assert(d.overtime_flag == 0);
22061         assert(d.k == 1024);
22062         assert(d.twiddle == '-');
22063         assert(d.manual_width == 0);
22064         assert(d.screen_width_minus_one == 0);
22065         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22066         assert(d.display_datacount == 1);
22067         assert(d.display_throughput == 1);
22068         assert(d.display_time == 1);
22069         assert(d.display_percent == 1);
22070         assert(d.display_bar == 1);
22071         assert(d.display_summary == 1);
22072         assert(d.display_ansi == 0);
22073         assert(d.twiddle_fg_color == 0);
22074         assert(d.twiddle_bg_color == 0);
22075         assert(d.twiddle_fg_bold == 0);
22076         assert(d.datacount_fg_color == 0);
22077         assert(d.datacount_bg_color == 0);
22078         assert(d.datacount_fg_bold == 0);
22079         assert(d.throughput_label_fg_color == 0);
22080         assert(d.throughput_label_bg_color == 0);
22081         assert(d.throughput_label_fg_bold == 0);
22082         assert(d.throughput_fg_color == 0);
22083         assert(d.throughput_bg_color == 0);
22084         assert(d.throughput_fg_bold == 0);
22085         assert(d.time_label_fg_color == 0);
22086         assert(d.time_label_bg_color == 0);
22087         assert(d.time_label_fg_bold == 0);
22088         assert(d.percent_fg_color == 0);
22089         assert(d.percent_bg_color == 0);
22090         assert(d.percent_fg_bold == 0);
22091         assert(d.barbrace_fg_color == 0);
22092         assert(d.barbrace_bg_color == 0);
22093         assert(d.barbrace_fg_bold == 0);
22094         assert(d.bar_fg_color == 0);
22095         assert(d.bar_bg_color == 0);
22096         assert(d.bar_fg_bold == 0);
22097         assert(io.in == 0);
22098         assert(io.out == 1);
22099         assert(io.in_ready == 0);
22100         assert(io.out_ready == 0);
22101         assert(io.eof_in == 0);
22102         assert(io.eof_out == 0);
22103         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22104         /* assert(io.cbuf == 0x0); */
22105         assert(io.last_read == 0);
22106         assert(io.last_write == 0);
22107         assert(io.total_read == 0);
22108         assert(io.total_write == 0);
22109         assert(io.total_size == 0);
22110         assert(io.total_size_known == 0);
22111         assert(io.timeout == 250000);
22112 
22113         tmp_rcfile = fopen("test-rcfile.txt", "w");
22114         assert(tmp_rcfile != 0);
22115         fprintf(tmp_rcfile, "display-percent: off");
22116         fclose(tmp_rcfile);
22117 
22118         assert(test_parse_rc(out,0));
22119 
22120 #ifdef PRINT_DEBUG
22121         print();
22122 #endif
22123         assert(d.start_time == 0);
22124         assert(d.total_time == 0);
22125         assert(d.current_time == 0);
22126         assert(d.elapsed_time == 0);
22127         assert(d.percent_complete == 0);
22128         assert(d.display_interval == 1);
22129         assert(d.overtime_flag == 0);
22130         assert(d.k == 1024);
22131         assert(d.twiddle == '-');
22132         assert(d.manual_width == 0);
22133         assert(d.screen_width_minus_one == 0);
22134         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22135         assert(d.display_datacount == 1);
22136         assert(d.display_throughput == 1);
22137         assert(d.display_time == 1);
22138         assert(d.display_percent == 0);
22139         assert(d.display_bar == 1);
22140         assert(d.display_summary == 1);
22141         assert(d.display_ansi == 0);
22142         assert(d.twiddle_fg_color == 0);
22143         assert(d.twiddle_bg_color == 0);
22144         assert(d.twiddle_fg_bold == 0);
22145         assert(d.datacount_fg_color == 0);
22146         assert(d.datacount_bg_color == 0);
22147         assert(d.datacount_fg_bold == 0);
22148         assert(d.throughput_label_fg_color == 0);
22149         assert(d.throughput_label_bg_color == 0);
22150         assert(d.throughput_label_fg_bold == 0);
22151         assert(d.throughput_fg_color == 0);
22152         assert(d.throughput_bg_color == 0);
22153         assert(d.throughput_fg_bold == 0);
22154         assert(d.time_label_fg_color == 0);
22155         assert(d.time_label_bg_color == 0);
22156         assert(d.time_label_fg_bold == 0);
22157         assert(d.percent_fg_color == 0);
22158         assert(d.percent_bg_color == 0);
22159         assert(d.percent_fg_bold == 0);
22160         assert(d.barbrace_fg_color == 0);
22161         assert(d.barbrace_bg_color == 0);
22162         assert(d.barbrace_fg_bold == 0);
22163         assert(d.bar_fg_color == 0);
22164         assert(d.bar_bg_color == 0);
22165         assert(d.bar_fg_bold == 0);
22166         assert(io.in == 0);
22167         assert(io.out == 1);
22168         assert(io.in_ready == 0);
22169         assert(io.out_ready == 0);
22170         assert(io.eof_in == 0);
22171         assert(io.eof_out == 0);
22172         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22173         /* assert(io.cbuf == 0x0); */
22174         assert(io.last_read == 0);
22175         assert(io.last_write == 0);
22176         assert(io.total_read == 0);
22177         assert(io.total_write == 0);
22178         assert(io.total_size == 0);
22179         assert(io.total_size_known == 0);
22180         assert(io.timeout == 250000);
22181 
22182         tmp_rcfile = fopen("test-rcfile.txt", "w");
22183         assert(tmp_rcfile != 0);
22184         fprintf(tmp_rcfile, "display-percent: on");
22185         fclose(tmp_rcfile);
22186 
22187         assert(test_parse_rc(out,0));
22188 
22189 #ifdef PRINT_DEBUG
22190         print();
22191 #endif
22192         assert(d.start_time == 0);
22193         assert(d.total_time == 0);
22194         assert(d.current_time == 0);
22195         assert(d.elapsed_time == 0);
22196         assert(d.percent_complete == 0);
22197         assert(d.display_interval == 1);
22198         assert(d.overtime_flag == 0);
22199         assert(d.k == 1024);
22200         assert(d.twiddle == '-');
22201         assert(d.manual_width == 0);
22202         assert(d.screen_width_minus_one == 0);
22203         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22204         assert(d.display_datacount == 1);
22205         assert(d.display_throughput == 1);
22206         assert(d.display_time == 1);
22207         assert(d.display_percent == 1);
22208         assert(d.display_bar == 1);
22209         assert(d.display_summary == 1);
22210         assert(d.display_ansi == 0);
22211         assert(d.twiddle_fg_color == 0);
22212         assert(d.twiddle_bg_color == 0);
22213         assert(d.twiddle_fg_bold == 0);
22214         assert(d.datacount_fg_color == 0);
22215         assert(d.datacount_bg_color == 0);
22216         assert(d.datacount_fg_bold == 0);
22217         assert(d.throughput_label_fg_color == 0);
22218         assert(d.throughput_label_bg_color == 0);
22219         assert(d.throughput_label_fg_bold == 0);
22220         assert(d.throughput_fg_color == 0);
22221         assert(d.throughput_bg_color == 0);
22222         assert(d.throughput_fg_bold == 0);
22223         assert(d.time_label_fg_color == 0);
22224         assert(d.time_label_bg_color == 0);
22225         assert(d.time_label_fg_bold == 0);
22226         assert(d.percent_fg_color == 0);
22227         assert(d.percent_bg_color == 0);
22228         assert(d.percent_fg_bold == 0);
22229         assert(d.barbrace_fg_color == 0);
22230         assert(d.barbrace_bg_color == 0);
22231         assert(d.barbrace_fg_bold == 0);
22232         assert(d.bar_fg_color == 0);
22233         assert(d.bar_bg_color == 0);
22234         assert(d.bar_fg_bold == 0);
22235         assert(io.in == 0);
22236         assert(io.out == 1);
22237         assert(io.in_ready == 0);
22238         assert(io.out_ready == 0);
22239         assert(io.eof_in == 0);
22240         assert(io.eof_out == 0);
22241         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22242         /* assert(io.cbuf == 0x0); */
22243         assert(io.last_read == 0);
22244         assert(io.last_write == 0);
22245         assert(io.total_read == 0);
22246         assert(io.total_write == 0);
22247         assert(io.total_size == 0);
22248         assert(io.total_size_known == 0);
22249         assert(io.timeout == 250000);
22250 
22251         assert(unlink("./test-rcfile.txt") == 0);
22252 }
22253 
22254 void test132(FILE *out)
22255 {
22256         FILE *tmp_rcfile = 0;
22257         
22258         tmp_rcfile = fopen("test-rcfile.txt", "w");
22259         assert(tmp_rcfile != 0);
22260         fprintf(tmp_rcfile, "display-bar: Sjkhg");
22261         fclose(tmp_rcfile);
22262 
22263         clear_errno();
22264         ioInit();
22265         displayInit();
22266 
22267 #ifdef PRINT_DEBUG
22268         print();
22269 #endif
22270         assert(d.start_time == 0);
22271         assert(d.total_time == 0);
22272         assert(d.current_time == 0);
22273         assert(d.elapsed_time == 0);
22274         assert(d.percent_complete == 0);
22275         assert(d.display_interval == 1);
22276         assert(d.overtime_flag == 0);
22277         assert(d.k == 1024);
22278         assert(d.twiddle == '-');
22279         assert(d.manual_width == 0);
22280         assert(d.screen_width_minus_one == 0);
22281         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22282         assert(d.display_datacount == 1);
22283         assert(d.display_throughput == 1);
22284         assert(d.display_time == 1);
22285         assert(d.display_percent == 1);
22286         assert(d.display_bar == 1);
22287         assert(d.display_summary == 1);
22288         assert(d.display_ansi == 0);
22289         assert(d.twiddle_fg_color == 0);
22290         assert(d.twiddle_bg_color == 0);
22291         assert(d.twiddle_fg_bold == 0);
22292         assert(d.datacount_fg_color == 0);
22293         assert(d.datacount_bg_color == 0);
22294         assert(d.datacount_fg_bold == 0);
22295         assert(d.throughput_label_fg_color == 0);
22296         assert(d.throughput_label_bg_color == 0);
22297         assert(d.throughput_label_fg_bold == 0);
22298         assert(d.throughput_fg_color == 0);
22299         assert(d.throughput_bg_color == 0);
22300         assert(d.throughput_fg_bold == 0);
22301         assert(d.time_label_fg_color == 0);
22302         assert(d.time_label_bg_color == 0);
22303         assert(d.time_label_fg_bold == 0);
22304         assert(d.percent_fg_color == 0);
22305         assert(d.percent_bg_color == 0);
22306         assert(d.percent_fg_bold == 0);
22307         assert(d.barbrace_fg_color == 0);
22308         assert(d.barbrace_bg_color == 0);
22309         assert(d.barbrace_fg_bold == 0);
22310         assert(d.bar_fg_color == 0);
22311         assert(d.bar_bg_color == 0);
22312         assert(d.bar_fg_bold == 0);
22313         assert(io.in == 0);
22314         assert(io.out == 1);
22315         assert(io.in_ready == 0);
22316         assert(io.out_ready == 0);
22317         assert(io.eof_in == 0);
22318         assert(io.eof_out == 0);
22319         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22320         /* assert(io.cbuf == 0x0); */
22321         assert(io.last_read == 0);
22322         assert(io.last_write == 0);
22323         assert(io.total_read == 0);
22324         assert(io.total_write == 0);
22325         assert(io.total_size == 0);
22326         assert(io.total_size_known == 0);
22327         assert(io.timeout == 250000);
22328 
22329         assert(test_parse_rc(out,1));
22330 
22331 #ifdef PRINT_DEBUG
22332         print();
22333 #endif
22334         assert(d.start_time == 0);
22335         assert(d.total_time == 0);
22336         assert(d.current_time == 0);
22337         assert(d.elapsed_time == 0);
22338         assert(d.percent_complete == 0);
22339         assert(d.display_interval == 1);
22340         assert(d.overtime_flag == 0);
22341         assert(d.k == 1024);
22342         assert(d.twiddle == '-');
22343         assert(d.manual_width == 0);
22344         assert(d.screen_width_minus_one == 0);
22345         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22346         assert(d.display_datacount == 1);
22347         assert(d.display_throughput == 1);
22348         assert(d.display_time == 1);
22349         assert(d.display_percent == 1);
22350         assert(d.display_bar == 1);
22351         assert(d.display_summary == 1);
22352         assert(d.display_ansi == 0);
22353         assert(d.twiddle_fg_color == 0);
22354         assert(d.twiddle_bg_color == 0);
22355         assert(d.twiddle_fg_bold == 0);
22356         assert(d.datacount_fg_color == 0);
22357         assert(d.datacount_bg_color == 0);
22358         assert(d.datacount_fg_bold == 0);
22359         assert(d.throughput_label_fg_color == 0);
22360         assert(d.throughput_label_bg_color == 0);
22361         assert(d.throughput_label_fg_bold == 0);
22362         assert(d.throughput_fg_color == 0);
22363         assert(d.throughput_bg_color == 0);
22364         assert(d.throughput_fg_bold == 0);
22365         assert(d.time_label_fg_color == 0);
22366         assert(d.time_label_bg_color == 0);
22367         assert(d.time_label_fg_bold == 0);
22368         assert(d.percent_fg_color == 0);
22369         assert(d.percent_bg_color == 0);
22370         assert(d.percent_fg_bold == 0);
22371         assert(d.barbrace_fg_color == 0);
22372         assert(d.barbrace_bg_color == 0);
22373         assert(d.barbrace_fg_bold == 0);
22374         assert(d.bar_fg_color == 0);
22375         assert(d.bar_bg_color == 0);
22376         assert(d.bar_fg_bold == 0);
22377         assert(io.in == 0);
22378         assert(io.out == 1);
22379         assert(io.in_ready == 0);
22380         assert(io.out_ready == 0);
22381         assert(io.eof_in == 0);
22382         assert(io.eof_out == 0);
22383         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22384         /* assert(io.cbuf == 0x0); */
22385         assert(io.last_read == 0);
22386         assert(io.last_write == 0);
22387         assert(io.total_read == 0);
22388         assert(io.total_write == 0);
22389         assert(io.total_size == 0);
22390         assert(io.total_size_known == 0);
22391         assert(io.timeout == 250000);
22392 
22393         tmp_rcfile = fopen("test-rcfile.txt", "w");
22394         assert(tmp_rcfile != 0);
22395         fprintf(tmp_rcfile, "display-bar: no");
22396         fclose(tmp_rcfile);
22397 
22398         assert(test_parse_rc(out,0));
22399 
22400 #ifdef PRINT_DEBUG
22401         print();
22402 #endif
22403         assert(d.start_time == 0);
22404         assert(d.total_time == 0);
22405         assert(d.current_time == 0);
22406         assert(d.elapsed_time == 0);
22407         assert(d.percent_complete == 0);
22408         assert(d.display_interval == 1);
22409         assert(d.overtime_flag == 0);
22410         assert(d.k == 1024);
22411         assert(d.twiddle == '-');
22412         assert(d.manual_width == 0);
22413         assert(d.screen_width_minus_one == 0);
22414         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22415         assert(d.display_datacount == 1);
22416         assert(d.display_throughput == 1);
22417         assert(d.display_time == 1);
22418         assert(d.display_percent == 1);
22419         assert(d.display_bar == 0);
22420         assert(d.display_summary == 1);
22421         assert(d.display_ansi == 0);
22422         assert(d.twiddle_fg_color == 0);
22423         assert(d.twiddle_bg_color == 0);
22424         assert(d.twiddle_fg_bold == 0);
22425         assert(d.datacount_fg_color == 0);
22426         assert(d.datacount_bg_color == 0);
22427         assert(d.datacount_fg_bold == 0);
22428         assert(d.throughput_label_fg_color == 0);
22429         assert(d.throughput_label_bg_color == 0);
22430         assert(d.throughput_label_fg_bold == 0);
22431         assert(d.throughput_fg_color == 0);
22432         assert(d.throughput_bg_color == 0);
22433         assert(d.throughput_fg_bold == 0);
22434         assert(d.time_label_fg_color == 0);
22435         assert(d.time_label_bg_color == 0);
22436         assert(d.time_label_fg_bold == 0);
22437         assert(d.percent_fg_color == 0);
22438         assert(d.percent_bg_color == 0);
22439         assert(d.percent_fg_bold == 0);
22440         assert(d.barbrace_fg_color == 0);
22441         assert(d.barbrace_bg_color == 0);
22442         assert(d.barbrace_fg_bold == 0);
22443         assert(d.bar_fg_color == 0);
22444         assert(d.bar_bg_color == 0);
22445         assert(d.bar_fg_bold == 0);
22446         assert(io.in == 0);
22447         assert(io.out == 1);
22448         assert(io.in_ready == 0);
22449         assert(io.out_ready == 0);
22450         assert(io.eof_in == 0);
22451         assert(io.eof_out == 0);
22452         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22453         /* assert(io.cbuf == 0x0); */
22454         assert(io.last_read == 0);
22455         assert(io.last_write == 0);
22456         assert(io.total_read == 0);
22457         assert(io.total_write == 0);
22458         assert(io.total_size == 0);
22459         assert(io.total_size_known == 0);
22460         assert(io.timeout == 250000);
22461 
22462         tmp_rcfile = fopen("test-rcfile.txt", "w");
22463         assert(tmp_rcfile != 0);
22464         fprintf(tmp_rcfile, "display-bar: yes");
22465         fclose(tmp_rcfile);
22466 
22467         assert(test_parse_rc(out,0));
22468 
22469 #ifdef PRINT_DEBUG
22470         print();
22471 #endif
22472         assert(d.start_time == 0);
22473         assert(d.total_time == 0);
22474         assert(d.current_time == 0);
22475         assert(d.elapsed_time == 0);
22476         assert(d.percent_complete == 0);
22477         assert(d.display_interval == 1);
22478         assert(d.overtime_flag == 0);
22479         assert(d.k == 1024);
22480         assert(d.twiddle == '-');
22481         assert(d.manual_width == 0);
22482         assert(d.screen_width_minus_one == 0);
22483         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22484         assert(d.display_datacount == 1);
22485         assert(d.display_throughput == 1);
22486         assert(d.display_time == 1);
22487         assert(d.display_percent == 1);
22488         assert(d.display_bar == 1);
22489         assert(d.display_summary == 1);
22490         assert(d.display_ansi == 0);
22491         assert(d.twiddle_fg_color == 0);
22492         assert(d.twiddle_bg_color == 0);
22493         assert(d.twiddle_fg_bold == 0);
22494         assert(d.datacount_fg_color == 0);
22495         assert(d.datacount_bg_color == 0);
22496         assert(d.datacount_fg_bold == 0);
22497         assert(d.throughput_label_fg_color == 0);
22498         assert(d.throughput_label_bg_color == 0);
22499         assert(d.throughput_label_fg_bold == 0);
22500         assert(d.throughput_fg_color == 0);
22501         assert(d.throughput_bg_color == 0);
22502         assert(d.throughput_fg_bold == 0);
22503         assert(d.time_label_fg_color == 0);
22504         assert(d.time_label_bg_color == 0);
22505         assert(d.time_label_fg_bold == 0);
22506         assert(d.percent_fg_color == 0);
22507         assert(d.percent_bg_color == 0);
22508         assert(d.percent_fg_bold == 0);
22509         assert(d.barbrace_fg_color == 0);
22510         assert(d.barbrace_bg_color == 0);
22511         assert(d.barbrace_fg_bold == 0);
22512         assert(d.bar_fg_color == 0);
22513         assert(d.bar_bg_color == 0);
22514         assert(d.bar_fg_bold == 0);
22515         assert(io.in == 0);
22516         assert(io.out == 1);
22517         assert(io.in_ready == 0);
22518         assert(io.out_ready == 0);
22519         assert(io.eof_in == 0);
22520         assert(io.eof_out == 0);
22521         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22522         /* assert(io.cbuf == 0x0); */
22523         assert(io.last_read == 0);
22524         assert(io.last_write == 0);
22525         assert(io.total_read == 0);
22526         assert(io.total_write == 0);
22527         assert(io.total_size == 0);
22528         assert(io.total_size_known == 0);
22529         assert(io.timeout == 250000);
22530 
22531         tmp_rcfile = fopen("test-rcfile.txt", "w");
22532         assert(tmp_rcfile != 0);
22533         fprintf(tmp_rcfile, "display-bar: n");
22534         fclose(tmp_rcfile);
22535 
22536         assert(test_parse_rc(out,0));
22537 
22538 #ifdef PRINT_DEBUG
22539         print();
22540 #endif
22541         assert(d.start_time == 0);
22542         assert(d.total_time == 0);
22543         assert(d.current_time == 0);
22544         assert(d.elapsed_time == 0);
22545         assert(d.percent_complete == 0);
22546         assert(d.display_interval == 1);
22547         assert(d.overtime_flag == 0);
22548         assert(d.k == 1024);
22549         assert(d.twiddle == '-');
22550         assert(d.manual_width == 0);
22551         assert(d.screen_width_minus_one == 0);
22552         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22553         assert(d.display_datacount == 1);
22554         assert(d.display_throughput == 1);
22555         assert(d.display_time == 1);
22556         assert(d.display_percent == 1);
22557         assert(d.display_bar == 0);
22558         assert(d.display_summary == 1);
22559         assert(d.display_ansi == 0);
22560         assert(d.twiddle_fg_color == 0);
22561         assert(d.twiddle_bg_color == 0);
22562         assert(d.twiddle_fg_bold == 0);
22563         assert(d.datacount_fg_color == 0);
22564         assert(d.datacount_bg_color == 0);
22565         assert(d.datacount_fg_bold == 0);
22566         assert(d.throughput_label_fg_color == 0);
22567         assert(d.throughput_label_bg_color == 0);
22568         assert(d.throughput_label_fg_bold == 0);
22569         assert(d.throughput_fg_color == 0);
22570         assert(d.throughput_bg_color == 0);
22571         assert(d.throughput_fg_bold == 0);
22572         assert(d.time_label_fg_color == 0);
22573         assert(d.time_label_bg_color == 0);
22574         assert(d.time_label_fg_bold == 0);
22575         assert(d.percent_fg_color == 0);
22576         assert(d.percent_bg_color == 0);
22577         assert(d.percent_fg_bold == 0);
22578         assert(d.barbrace_fg_color == 0);
22579         assert(d.barbrace_bg_color == 0);
22580         assert(d.barbrace_fg_bold == 0);
22581         assert(d.bar_fg_color == 0);
22582         assert(d.bar_bg_color == 0);
22583         assert(d.bar_fg_bold == 0);
22584         assert(io.in == 0);
22585         assert(io.out == 1);
22586         assert(io.in_ready == 0);
22587         assert(io.out_ready == 0);
22588         assert(io.eof_in == 0);
22589         assert(io.eof_out == 0);
22590         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22591         /* assert(io.cbuf == 0x0); */
22592         assert(io.last_read == 0);
22593         assert(io.last_write == 0);
22594         assert(io.total_read == 0);
22595         assert(io.total_write == 0);
22596         assert(io.total_size == 0);
22597         assert(io.total_size_known == 0);
22598         assert(io.timeout == 250000);
22599 
22600         tmp_rcfile = fopen("test-rcfile.txt", "w");
22601         assert(tmp_rcfile != 0);
22602         fprintf(tmp_rcfile, "display-bar: y");
22603         fclose(tmp_rcfile);
22604 
22605         assert(test_parse_rc(out,0));
22606 
22607 #ifdef PRINT_DEBUG
22608         print();
22609 #endif
22610         assert(d.start_time == 0);
22611         assert(d.total_time == 0);
22612         assert(d.current_time == 0);
22613         assert(d.elapsed_time == 0);
22614         assert(d.percent_complete == 0);
22615         assert(d.display_interval == 1);
22616         assert(d.overtime_flag == 0);
22617         assert(d.k == 1024);
22618         assert(d.twiddle == '-');
22619         assert(d.manual_width == 0);
22620         assert(d.screen_width_minus_one == 0);
22621         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22622         assert(d.display_datacount == 1);
22623         assert(d.display_throughput == 1);
22624         assert(d.display_time == 1);
22625         assert(d.display_percent == 1);
22626         assert(d.display_bar == 1);
22627         assert(d.display_summary == 1);
22628         assert(d.display_ansi == 0);
22629         assert(d.twiddle_fg_color == 0);
22630         assert(d.twiddle_bg_color == 0);
22631         assert(d.twiddle_fg_bold == 0);
22632         assert(d.datacount_fg_color == 0);
22633         assert(d.datacount_bg_color == 0);
22634         assert(d.datacount_fg_bold == 0);
22635         assert(d.throughput_label_fg_color == 0);
22636         assert(d.throughput_label_bg_color == 0);
22637         assert(d.throughput_label_fg_bold == 0);
22638         assert(d.throughput_fg_color == 0);
22639         assert(d.throughput_bg_color == 0);
22640         assert(d.throughput_fg_bold == 0);
22641         assert(d.time_label_fg_color == 0);
22642         assert(d.time_label_bg_color == 0);
22643         assert(d.time_label_fg_bold == 0);
22644         assert(d.percent_fg_color == 0);
22645         assert(d.percent_bg_color == 0);
22646         assert(d.percent_fg_bold == 0);
22647         assert(d.barbrace_fg_color == 0);
22648         assert(d.barbrace_bg_color == 0);
22649         assert(d.barbrace_fg_bold == 0);
22650         assert(d.bar_fg_color == 0);
22651         assert(d.bar_bg_color == 0);
22652         assert(d.bar_fg_bold == 0);
22653         assert(io.in == 0);
22654         assert(io.out == 1);
22655         assert(io.in_ready == 0);
22656         assert(io.out_ready == 0);
22657         assert(io.eof_in == 0);
22658         assert(io.eof_out == 0);
22659         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22660         /* assert(io.cbuf == 0x0); */
22661         assert(io.last_read == 0);
22662         assert(io.last_write == 0);
22663         assert(io.total_read == 0);
22664         assert(io.total_write == 0);
22665         assert(io.total_size == 0);
22666         assert(io.total_size_known == 0);
22667         assert(io.timeout == 250000);
22668 
22669         tmp_rcfile = fopen("test-rcfile.txt", "w");
22670         assert(tmp_rcfile != 0);
22671         fprintf(tmp_rcfile, "display-bar: false");
22672         fclose(tmp_rcfile);
22673 
22674         assert(test_parse_rc(out,0));
22675 
22676 #ifdef PRINT_DEBUG
22677         print();
22678 #endif
22679         assert(d.start_time == 0);
22680         assert(d.total_time == 0);
22681         assert(d.current_time == 0);
22682         assert(d.elapsed_time == 0);
22683         assert(d.percent_complete == 0);
22684         assert(d.display_interval == 1);
22685         assert(d.overtime_flag == 0);
22686         assert(d.k == 1024);
22687         assert(d.twiddle == '-');
22688         assert(d.manual_width == 0);
22689         assert(d.screen_width_minus_one == 0);
22690         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22691         assert(d.display_datacount == 1);
22692         assert(d.display_throughput == 1);
22693         assert(d.display_time == 1);
22694         assert(d.display_percent == 1);
22695         assert(d.display_bar == 0);
22696         assert(d.display_summary == 1);
22697         assert(d.display_ansi == 0);
22698         assert(d.twiddle_fg_color == 0);
22699         assert(d.twiddle_bg_color == 0);
22700         assert(d.twiddle_fg_bold == 0);
22701         assert(d.datacount_fg_color == 0);
22702         assert(d.datacount_bg_color == 0);
22703         assert(d.datacount_fg_bold == 0);
22704         assert(d.throughput_label_fg_color == 0);
22705         assert(d.throughput_label_bg_color == 0);
22706         assert(d.throughput_label_fg_bold == 0);
22707         assert(d.throughput_fg_color == 0);
22708         assert(d.throughput_bg_color == 0);
22709         assert(d.throughput_fg_bold == 0);
22710         assert(d.time_label_fg_color == 0);
22711         assert(d.time_label_bg_color == 0);
22712         assert(d.time_label_fg_bold == 0);
22713         assert(d.percent_fg_color == 0);
22714         assert(d.percent_bg_color == 0);
22715         assert(d.percent_fg_bold == 0);
22716         assert(d.barbrace_fg_color == 0);
22717         assert(d.barbrace_bg_color == 0);
22718         assert(d.barbrace_fg_bold == 0);
22719         assert(d.bar_fg_color == 0);
22720         assert(d.bar_bg_color == 0);
22721         assert(d.bar_fg_bold == 0);
22722         assert(io.in == 0);
22723         assert(io.out == 1);
22724         assert(io.in_ready == 0);
22725         assert(io.out_ready == 0);
22726         assert(io.eof_in == 0);
22727         assert(io.eof_out == 0);
22728         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22729         /* assert(io.cbuf == 0x0); */
22730         assert(io.last_read == 0);
22731         assert(io.last_write == 0);
22732         assert(io.total_read == 0);
22733         assert(io.total_write == 0);
22734         assert(io.total_size == 0);
22735         assert(io.total_size_known == 0);
22736         assert(io.timeout == 250000);
22737 
22738         tmp_rcfile = fopen("test-rcfile.txt", "w");
22739         assert(tmp_rcfile != 0);
22740         fprintf(tmp_rcfile, "display-bar: true");
22741         fclose(tmp_rcfile);
22742 
22743         assert(test_parse_rc(out,0));
22744 
22745 #ifdef PRINT_DEBUG
22746         print();
22747 #endif
22748         assert(d.start_time == 0);
22749         assert(d.total_time == 0);
22750         assert(d.current_time == 0);
22751         assert(d.elapsed_time == 0);
22752         assert(d.percent_complete == 0);
22753         assert(d.display_interval == 1);
22754         assert(d.overtime_flag == 0);
22755         assert(d.k == 1024);
22756         assert(d.twiddle == '-');
22757         assert(d.manual_width == 0);
22758         assert(d.screen_width_minus_one == 0);
22759         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22760         assert(d.display_datacount == 1);
22761         assert(d.display_throughput == 1);
22762         assert(d.display_time == 1);
22763         assert(d.display_percent == 1);
22764         assert(d.display_bar == 1);
22765         assert(d.display_summary == 1);
22766         assert(d.display_ansi == 0);
22767         assert(d.twiddle_fg_color == 0);
22768         assert(d.twiddle_bg_color == 0);
22769         assert(d.twiddle_fg_bold == 0);
22770         assert(d.datacount_fg_color == 0);
22771         assert(d.datacount_bg_color == 0);
22772         assert(d.datacount_fg_bold == 0);
22773         assert(d.throughput_label_fg_color == 0);
22774         assert(d.throughput_label_bg_color == 0);
22775         assert(d.throughput_label_fg_bold == 0);
22776         assert(d.throughput_fg_color == 0);
22777         assert(d.throughput_bg_color == 0);
22778         assert(d.throughput_fg_bold == 0);
22779         assert(d.time_label_fg_color == 0);
22780         assert(d.time_label_bg_color == 0);
22781         assert(d.time_label_fg_bold == 0);
22782         assert(d.percent_fg_color == 0);
22783         assert(d.percent_bg_color == 0);
22784         assert(d.percent_fg_bold == 0);
22785         assert(d.barbrace_fg_color == 0);
22786         assert(d.barbrace_bg_color == 0);
22787         assert(d.barbrace_fg_bold == 0);
22788         assert(d.bar_fg_color == 0);
22789         assert(d.bar_bg_color == 0);
22790         assert(d.bar_fg_bold == 0);
22791         assert(io.in == 0);
22792         assert(io.out == 1);
22793         assert(io.in_ready == 0);
22794         assert(io.out_ready == 0);
22795         assert(io.eof_in == 0);
22796         assert(io.eof_out == 0);
22797         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22798         /* assert(io.cbuf == 0x0); */
22799         assert(io.last_read == 0);
22800         assert(io.last_write == 0);
22801         assert(io.total_read == 0);
22802         assert(io.total_write == 0);
22803         assert(io.total_size == 0);
22804         assert(io.total_size_known == 0);
22805         assert(io.timeout == 250000);
22806 
22807         tmp_rcfile = fopen("test-rcfile.txt", "w");
22808         assert(tmp_rcfile != 0);
22809         fprintf(tmp_rcfile, "display-bar: f");
22810         fclose(tmp_rcfile);
22811 
22812         assert(test_parse_rc(out,0));
22813 
22814 #ifdef PRINT_DEBUG
22815         print();
22816 #endif
22817         assert(d.start_time == 0);
22818         assert(d.total_time == 0);
22819         assert(d.current_time == 0);
22820         assert(d.elapsed_time == 0);
22821         assert(d.percent_complete == 0);
22822         assert(d.display_interval == 1);
22823         assert(d.overtime_flag == 0);
22824         assert(d.k == 1024);
22825         assert(d.twiddle == '-');
22826         assert(d.manual_width == 0);
22827         assert(d.screen_width_minus_one == 0);
22828         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22829         assert(d.display_datacount == 1);
22830         assert(d.display_throughput == 1);
22831         assert(d.display_time == 1);
22832         assert(d.display_percent == 1);
22833         assert(d.display_bar == 0);
22834         assert(d.display_summary == 1);
22835         assert(d.display_ansi == 0);
22836         assert(d.twiddle_fg_color == 0);
22837         assert(d.twiddle_bg_color == 0);
22838         assert(d.twiddle_fg_bold == 0);
22839         assert(d.datacount_fg_color == 0);
22840         assert(d.datacount_bg_color == 0);
22841         assert(d.datacount_fg_bold == 0);
22842         assert(d.throughput_label_fg_color == 0);
22843         assert(d.throughput_label_bg_color == 0);
22844         assert(d.throughput_label_fg_bold == 0);
22845         assert(d.throughput_fg_color == 0);
22846         assert(d.throughput_bg_color == 0);
22847         assert(d.throughput_fg_bold == 0);
22848         assert(d.time_label_fg_color == 0);
22849         assert(d.time_label_bg_color == 0);
22850         assert(d.time_label_fg_bold == 0);
22851         assert(d.percent_fg_color == 0);
22852         assert(d.percent_bg_color == 0);
22853         assert(d.percent_fg_bold == 0);
22854         assert(d.barbrace_fg_color == 0);
22855         assert(d.barbrace_bg_color == 0);
22856         assert(d.barbrace_fg_bold == 0);
22857         assert(d.bar_fg_color == 0);
22858         assert(d.bar_bg_color == 0);
22859         assert(d.bar_fg_bold == 0);
22860         assert(io.in == 0);
22861         assert(io.out == 1);
22862         assert(io.in_ready == 0);
22863         assert(io.out_ready == 0);
22864         assert(io.eof_in == 0);
22865         assert(io.eof_out == 0);
22866         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22867         /* assert(io.cbuf == 0x0); */
22868         assert(io.last_read == 0);
22869         assert(io.last_write == 0);
22870         assert(io.total_read == 0);
22871         assert(io.total_write == 0);
22872         assert(io.total_size == 0);
22873         assert(io.total_size_known == 0);
22874         assert(io.timeout == 250000);
22875 
22876         tmp_rcfile = fopen("test-rcfile.txt", "w");
22877         assert(tmp_rcfile != 0);
22878         fprintf(tmp_rcfile, "display-bar: t");
22879         fclose(tmp_rcfile);
22880 
22881         assert(test_parse_rc(out,0));
22882 
22883 #ifdef PRINT_DEBUG
22884         print();
22885 #endif
22886         assert(d.start_time == 0);
22887         assert(d.total_time == 0);
22888         assert(d.current_time == 0);
22889         assert(d.elapsed_time == 0);
22890         assert(d.percent_complete == 0);
22891         assert(d.display_interval == 1);
22892         assert(d.overtime_flag == 0);
22893         assert(d.k == 1024);
22894         assert(d.twiddle == '-');
22895         assert(d.manual_width == 0);
22896         assert(d.screen_width_minus_one == 0);
22897         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22898         assert(d.display_datacount == 1);
22899         assert(d.display_throughput == 1);
22900         assert(d.display_time == 1);
22901         assert(d.display_percent == 1);
22902         assert(d.display_bar == 1);
22903         assert(d.display_summary == 1);
22904         assert(d.display_ansi == 0);
22905         assert(d.twiddle_fg_color == 0);
22906         assert(d.twiddle_bg_color == 0);
22907         assert(d.twiddle_fg_bold == 0);
22908         assert(d.datacount_fg_color == 0);
22909         assert(d.datacount_bg_color == 0);
22910         assert(d.datacount_fg_bold == 0);
22911         assert(d.throughput_label_fg_color == 0);
22912         assert(d.throughput_label_bg_color == 0);
22913         assert(d.throughput_label_fg_bold == 0);
22914         assert(d.throughput_fg_color == 0);
22915         assert(d.throughput_bg_color == 0);
22916         assert(d.throughput_fg_bold == 0);
22917         assert(d.time_label_fg_color == 0);
22918         assert(d.time_label_bg_color == 0);
22919         assert(d.time_label_fg_bold == 0);
22920         assert(d.percent_fg_color == 0);
22921         assert(d.percent_bg_color == 0);
22922         assert(d.percent_fg_bold == 0);
22923         assert(d.barbrace_fg_color == 0);
22924         assert(d.barbrace_bg_color == 0);
22925         assert(d.barbrace_fg_bold == 0);
22926         assert(d.bar_fg_color == 0);
22927         assert(d.bar_bg_color == 0);
22928         assert(d.bar_fg_bold == 0);
22929         assert(io.in == 0);
22930         assert(io.out == 1);
22931         assert(io.in_ready == 0);
22932         assert(io.out_ready == 0);
22933         assert(io.eof_in == 0);
22934         assert(io.eof_out == 0);
22935         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
22936         /* assert(io.cbuf == 0x0); */
22937         assert(io.last_read == 0);
22938         assert(io.last_write == 0);
22939         assert(io.total_read == 0);
22940         assert(io.total_write == 0);
22941         assert(io.total_size == 0);
22942         assert(io.total_size_known == 0);
22943         assert(io.timeout == 250000);
22944 
22945         tmp_rcfile = fopen("test-rcfile.txt", "w");
22946         assert(tmp_rcfile != 0);
22947         fprintf(tmp_rcfile, "display-bar: 0");
22948         fclose(tmp_rcfile);
22949 
22950         assert(test_parse_rc(out,0));
22951 
22952 #ifdef PRINT_DEBUG
22953         print();
22954 #endif
22955         assert(d.start_time == 0);
22956         assert(d.total_time == 0);
22957         assert(d.current_time == 0);
22958         assert(d.elapsed_time == 0);
22959         assert(d.percent_complete == 0);
22960         assert(d.display_interval == 1);
22961         assert(d.overtime_flag == 0);
22962         assert(d.k == 1024);
22963         assert(d.twiddle == '-');
22964         assert(d.manual_width == 0);
22965         assert(d.screen_width_minus_one == 0);
22966         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
22967         assert(d.display_datacount == 1);
22968         assert(d.display_throughput == 1);
22969         assert(d.display_time == 1);
22970         assert(d.display_percent == 1);
22971         assert(d.display_bar == 0);
22972         assert(d.display_summary == 1);
22973         assert(d.display_ansi == 0);
22974         assert(d.twiddle_fg_color == 0);
22975         assert(d.twiddle_bg_color == 0);
22976         assert(d.twiddle_fg_bold == 0);
22977         assert(d.datacount_fg_color == 0);
22978         assert(d.datacount_bg_color == 0);
22979         assert(d.datacount_fg_bold == 0);
22980         assert(d.throughput_label_fg_color == 0);
22981         assert(d.throughput_label_bg_color == 0);
22982         assert(d.throughput_label_fg_bold == 0);
22983         assert(d.throughput_fg_color == 0);
22984         assert(d.throughput_bg_color == 0);
22985         assert(d.throughput_fg_bold == 0);
22986         assert(d.time_label_fg_color == 0);
22987         assert(d.time_label_bg_color == 0);
22988         assert(d.time_label_fg_bold == 0);
22989         assert(d.percent_fg_color == 0);
22990         assert(d.percent_bg_color == 0);
22991         assert(d.percent_fg_bold == 0);
22992         assert(d.barbrace_fg_color == 0);
22993         assert(d.barbrace_bg_color == 0);
22994         assert(d.barbrace_fg_bold == 0);
22995         assert(d.bar_fg_color == 0);
22996         assert(d.bar_bg_color == 0);
22997         assert(d.bar_fg_bold == 0);
22998         assert(io.in == 0);
22999         assert(io.out == 1);
23000         assert(io.in_ready == 0);
23001         assert(io.out_ready == 0);
23002         assert(io.eof_in == 0);
23003         assert(io.eof_out == 0);
23004         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23005         /* assert(io.cbuf == 0x0); */
23006         assert(io.last_read == 0);
23007         assert(io.last_write == 0);
23008         assert(io.total_read == 0);
23009         assert(io.total_write == 0);
23010         assert(io.total_size == 0);
23011         assert(io.total_size_known == 0);
23012         assert(io.timeout == 250000);
23013 
23014         tmp_rcfile = fopen("test-rcfile.txt", "w");
23015         assert(tmp_rcfile != 0);
23016         fprintf(tmp_rcfile, "display-bar: 1");
23017         fclose(tmp_rcfile);
23018 
23019         assert(test_parse_rc(out,0));
23020 
23021 #ifdef PRINT_DEBUG
23022         print();
23023 #endif
23024         assert(d.start_time == 0);
23025         assert(d.total_time == 0);
23026         assert(d.current_time == 0);
23027         assert(d.elapsed_time == 0);
23028         assert(d.percent_complete == 0);
23029         assert(d.display_interval == 1);
23030         assert(d.overtime_flag == 0);
23031         assert(d.k == 1024);
23032         assert(d.twiddle == '-');
23033         assert(d.manual_width == 0);
23034         assert(d.screen_width_minus_one == 0);
23035         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23036         assert(d.display_datacount == 1);
23037         assert(d.display_throughput == 1);
23038         assert(d.display_time == 1);
23039         assert(d.display_percent == 1);
23040         assert(d.display_bar == 1);
23041         assert(d.display_summary == 1);
23042         assert(d.display_ansi == 0);
23043         assert(d.twiddle_fg_color == 0);
23044         assert(d.twiddle_bg_color == 0);
23045         assert(d.twiddle_fg_bold == 0);
23046         assert(d.datacount_fg_color == 0);
23047         assert(d.datacount_bg_color == 0);
23048         assert(d.datacount_fg_bold == 0);
23049         assert(d.throughput_label_fg_color == 0);
23050         assert(d.throughput_label_bg_color == 0);
23051         assert(d.throughput_label_fg_bold == 0);
23052         assert(d.throughput_fg_color == 0);
23053         assert(d.throughput_bg_color == 0);
23054         assert(d.throughput_fg_bold == 0);
23055         assert(d.time_label_fg_color == 0);
23056         assert(d.time_label_bg_color == 0);
23057         assert(d.time_label_fg_bold == 0);
23058         assert(d.percent_fg_color == 0);
23059         assert(d.percent_bg_color == 0);
23060         assert(d.percent_fg_bold == 0);
23061         assert(d.barbrace_fg_color == 0);
23062         assert(d.barbrace_bg_color == 0);
23063         assert(d.barbrace_fg_bold == 0);
23064         assert(d.bar_fg_color == 0);
23065         assert(d.bar_bg_color == 0);
23066         assert(d.bar_fg_bold == 0);
23067         assert(io.in == 0);
23068         assert(io.out == 1);
23069         assert(io.in_ready == 0);
23070         assert(io.out_ready == 0);
23071         assert(io.eof_in == 0);
23072         assert(io.eof_out == 0);
23073         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23074         /* assert(io.cbuf == 0x0); */
23075         assert(io.last_read == 0);
23076         assert(io.last_write == 0);
23077         assert(io.total_read == 0);
23078         assert(io.total_write == 0);
23079         assert(io.total_size == 0);
23080         assert(io.total_size_known == 0);
23081         assert(io.timeout == 250000);
23082 
23083         tmp_rcfile = fopen("test-rcfile.txt", "w");
23084         assert(tmp_rcfile != 0);
23085         fprintf(tmp_rcfile, "display-bar: off");
23086         fclose(tmp_rcfile);
23087 
23088         assert(test_parse_rc(out,0));
23089 
23090 #ifdef PRINT_DEBUG
23091         print();
23092 #endif
23093         assert(d.start_time == 0);
23094         assert(d.total_time == 0);
23095         assert(d.current_time == 0);
23096         assert(d.elapsed_time == 0);
23097         assert(d.percent_complete == 0);
23098         assert(d.display_interval == 1);
23099         assert(d.overtime_flag == 0);
23100         assert(d.k == 1024);
23101         assert(d.twiddle == '-');
23102         assert(d.manual_width == 0);
23103         assert(d.screen_width_minus_one == 0);
23104         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23105         assert(d.display_datacount == 1);
23106         assert(d.display_throughput == 1);
23107         assert(d.display_time == 1);
23108         assert(d.display_percent == 1);
23109         assert(d.display_bar == 0);
23110         assert(d.display_summary == 1);
23111         assert(d.display_ansi == 0);
23112         assert(d.twiddle_fg_color == 0);
23113         assert(d.twiddle_bg_color == 0);
23114         assert(d.twiddle_fg_bold == 0);
23115         assert(d.datacount_fg_color == 0);
23116         assert(d.datacount_bg_color == 0);
23117         assert(d.datacount_fg_bold == 0);
23118         assert(d.throughput_label_fg_color == 0);
23119         assert(d.throughput_label_bg_color == 0);
23120         assert(d.throughput_label_fg_bold == 0);
23121         assert(d.throughput_fg_color == 0);
23122         assert(d.throughput_bg_color == 0);
23123         assert(d.throughput_fg_bold == 0);
23124         assert(d.time_label_fg_color == 0);
23125         assert(d.time_label_bg_color == 0);
23126         assert(d.time_label_fg_bold == 0);
23127         assert(d.percent_fg_color == 0);
23128         assert(d.percent_bg_color == 0);
23129         assert(d.percent_fg_bold == 0);
23130         assert(d.barbrace_fg_color == 0);
23131         assert(d.barbrace_bg_color == 0);
23132         assert(d.barbrace_fg_bold == 0);
23133         assert(d.bar_fg_color == 0);
23134         assert(d.bar_bg_color == 0);
23135         assert(d.bar_fg_bold == 0);
23136         assert(io.in == 0);
23137         assert(io.out == 1);
23138         assert(io.in_ready == 0);
23139         assert(io.out_ready == 0);
23140         assert(io.eof_in == 0);
23141         assert(io.eof_out == 0);
23142         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23143         /* assert(io.cbuf == 0x0); */
23144         assert(io.last_read == 0);
23145         assert(io.last_write == 0);
23146         assert(io.total_read == 0);
23147         assert(io.total_write == 0);
23148         assert(io.total_size == 0);
23149         assert(io.total_size_known == 0);
23150         assert(io.timeout == 250000);
23151 
23152         tmp_rcfile = fopen("test-rcfile.txt", "w");
23153         assert(tmp_rcfile != 0);
23154         fprintf(tmp_rcfile, "display-bar: on");
23155         fclose(tmp_rcfile);
23156 
23157         assert(test_parse_rc(out,0));
23158 
23159 #ifdef PRINT_DEBUG
23160         print();
23161 #endif
23162         assert(d.start_time == 0);
23163         assert(d.total_time == 0);
23164         assert(d.current_time == 0);
23165         assert(d.elapsed_time == 0);
23166         assert(d.percent_complete == 0);
23167         assert(d.display_interval == 1);
23168         assert(d.overtime_flag == 0);
23169         assert(d.k == 1024);
23170         assert(d.twiddle == '-');
23171         assert(d.manual_width == 0);
23172         assert(d.screen_width_minus_one == 0);
23173         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23174         assert(d.display_datacount == 1);
23175         assert(d.display_throughput == 1);
23176         assert(d.display_time == 1);
23177         assert(d.display_percent == 1);
23178         assert(d.display_bar == 1);
23179         assert(d.display_summary == 1);
23180         assert(d.display_ansi == 0);
23181         assert(d.twiddle_fg_color == 0);
23182         assert(d.twiddle_bg_color == 0);
23183         assert(d.twiddle_fg_bold == 0);
23184         assert(d.datacount_fg_color == 0);
23185         assert(d.datacount_bg_color == 0);
23186         assert(d.datacount_fg_bold == 0);
23187         assert(d.throughput_label_fg_color == 0);
23188         assert(d.throughput_label_bg_color == 0);
23189         assert(d.throughput_label_fg_bold == 0);
23190         assert(d.throughput_fg_color == 0);
23191         assert(d.throughput_bg_color == 0);
23192         assert(d.throughput_fg_bold == 0);
23193         assert(d.time_label_fg_color == 0);
23194         assert(d.time_label_bg_color == 0);
23195         assert(d.time_label_fg_bold == 0);
23196         assert(d.percent_fg_color == 0);
23197         assert(d.percent_bg_color == 0);
23198         assert(d.percent_fg_bold == 0);
23199         assert(d.barbrace_fg_color == 0);
23200         assert(d.barbrace_bg_color == 0);
23201         assert(d.barbrace_fg_bold == 0);
23202         assert(d.bar_fg_color == 0);
23203         assert(d.bar_bg_color == 0);
23204         assert(d.bar_fg_bold == 0);
23205         assert(io.in == 0);
23206         assert(io.out == 1);
23207         assert(io.in_ready == 0);
23208         assert(io.out_ready == 0);
23209         assert(io.eof_in == 0);
23210         assert(io.eof_out == 0);
23211         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23212         /* assert(io.cbuf == 0x0); */
23213         assert(io.last_read == 0);
23214         assert(io.last_write == 0);
23215         assert(io.total_read == 0);
23216         assert(io.total_write == 0);
23217         assert(io.total_size == 0);
23218         assert(io.total_size_known == 0);
23219         assert(io.timeout == 250000);
23220 
23221         assert(unlink("./test-rcfile.txt") == 0);
23222 }
23223 
23224 void test133(FILE *out)
23225 {
23226         FILE *tmp_rcfile = 0;
23227         
23228         tmp_rcfile = fopen("test-rcfile.txt", "w");
23229         assert(tmp_rcfile != 0);
23230         fprintf(tmp_rcfile, "display-summary: Sjkhg");
23231         fclose(tmp_rcfile);
23232 
23233         clear_errno();
23234         ioInit();
23235         displayInit();
23236 
23237 #ifdef PRINT_DEBUG
23238         print();
23239 #endif
23240         assert(d.start_time == 0);
23241         assert(d.total_time == 0);
23242         assert(d.current_time == 0);
23243         assert(d.elapsed_time == 0);
23244         assert(d.percent_complete == 0);
23245         assert(d.display_interval == 1);
23246         assert(d.overtime_flag == 0);
23247         assert(d.k == 1024);
23248         assert(d.twiddle == '-');
23249         assert(d.manual_width == 0);
23250         assert(d.screen_width_minus_one == 0);
23251         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23252         assert(d.display_datacount == 1);
23253         assert(d.display_throughput == 1);
23254         assert(d.display_time == 1);
23255         assert(d.display_percent == 1);
23256         assert(d.display_bar == 1);
23257         assert(d.display_summary == 1);
23258         assert(d.display_ansi == 0);
23259         assert(d.twiddle_fg_color == 0);
23260         assert(d.twiddle_bg_color == 0);
23261         assert(d.twiddle_fg_bold == 0);
23262         assert(d.datacount_fg_color == 0);
23263         assert(d.datacount_bg_color == 0);
23264         assert(d.datacount_fg_bold == 0);
23265         assert(d.throughput_label_fg_color == 0);
23266         assert(d.throughput_label_bg_color == 0);
23267         assert(d.throughput_label_fg_bold == 0);
23268         assert(d.throughput_fg_color == 0);
23269         assert(d.throughput_bg_color == 0);
23270         assert(d.throughput_fg_bold == 0);
23271         assert(d.time_label_fg_color == 0);
23272         assert(d.time_label_bg_color == 0);
23273         assert(d.time_label_fg_bold == 0);
23274         assert(d.percent_fg_color == 0);
23275         assert(d.percent_bg_color == 0);
23276         assert(d.percent_fg_bold == 0);
23277         assert(d.barbrace_fg_color == 0);
23278         assert(d.barbrace_bg_color == 0);
23279         assert(d.barbrace_fg_bold == 0);
23280         assert(d.bar_fg_color == 0);
23281         assert(d.bar_bg_color == 0);
23282         assert(d.bar_fg_bold == 0);
23283         assert(io.in == 0);
23284         assert(io.out == 1);
23285         assert(io.in_ready == 0);
23286         assert(io.out_ready == 0);
23287         assert(io.eof_in == 0);
23288         assert(io.eof_out == 0);
23289         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23290         /* assert(io.cbuf == 0x0); */
23291         assert(io.last_read == 0);
23292         assert(io.last_write == 0);
23293         assert(io.total_read == 0);
23294         assert(io.total_write == 0);
23295         assert(io.total_size == 0);
23296         assert(io.total_size_known == 0);
23297         assert(io.timeout == 250000);
23298 
23299         assert(test_parse_rc(out,1));
23300 
23301 #ifdef PRINT_DEBUG
23302         print();
23303 #endif
23304         assert(d.start_time == 0);
23305         assert(d.total_time == 0);
23306         assert(d.current_time == 0);
23307         assert(d.elapsed_time == 0);
23308         assert(d.percent_complete == 0);
23309         assert(d.display_interval == 1);
23310         assert(d.overtime_flag == 0);
23311         assert(d.k == 1024);
23312         assert(d.twiddle == '-');
23313         assert(d.manual_width == 0);
23314         assert(d.screen_width_minus_one == 0);
23315         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23316         assert(d.display_datacount == 1);
23317         assert(d.display_throughput == 1);
23318         assert(d.display_time == 1);
23319         assert(d.display_percent == 1);
23320         assert(d.display_bar == 1);
23321         assert(d.display_summary == 1);
23322         assert(d.display_ansi == 0);
23323         assert(d.twiddle_fg_color == 0);
23324         assert(d.twiddle_bg_color == 0);
23325         assert(d.twiddle_fg_bold == 0);
23326         assert(d.datacount_fg_color == 0);
23327         assert(d.datacount_bg_color == 0);
23328         assert(d.datacount_fg_bold == 0);
23329         assert(d.throughput_label_fg_color == 0);
23330         assert(d.throughput_label_bg_color == 0);
23331         assert(d.throughput_label_fg_bold == 0);
23332         assert(d.throughput_fg_color == 0);
23333         assert(d.throughput_bg_color == 0);
23334         assert(d.throughput_fg_bold == 0);
23335         assert(d.time_label_fg_color == 0);
23336         assert(d.time_label_bg_color == 0);
23337         assert(d.time_label_fg_bold == 0);
23338         assert(d.percent_fg_color == 0);
23339         assert(d.percent_bg_color == 0);
23340         assert(d.percent_fg_bold == 0);
23341         assert(d.barbrace_fg_color == 0);
23342         assert(d.barbrace_bg_color == 0);
23343         assert(d.barbrace_fg_bold == 0);
23344         assert(d.bar_fg_color == 0);
23345         assert(d.bar_bg_color == 0);
23346         assert(d.bar_fg_bold == 0);
23347         assert(io.in == 0);
23348         assert(io.out == 1);
23349         assert(io.in_ready == 0);
23350         assert(io.out_ready == 0);
23351         assert(io.eof_in == 0);
23352         assert(io.eof_out == 0);
23353         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23354         /* assert(io.cbuf == 0x0); */
23355         assert(io.last_read == 0);
23356         assert(io.last_write == 0);
23357         assert(io.total_read == 0);
23358         assert(io.total_write == 0);
23359         assert(io.total_size == 0);
23360         assert(io.total_size_known == 0);
23361         assert(io.timeout == 250000);
23362 
23363         tmp_rcfile = fopen("test-rcfile.txt", "w");
23364         assert(tmp_rcfile != 0);
23365         fprintf(tmp_rcfile, "display-summary: no");
23366         fclose(tmp_rcfile);
23367 
23368         assert(test_parse_rc(out,0));
23369 
23370 #ifdef PRINT_DEBUG
23371         print();
23372 #endif
23373         assert(d.start_time == 0);
23374         assert(d.total_time == 0);
23375         assert(d.current_time == 0);
23376         assert(d.elapsed_time == 0);
23377         assert(d.percent_complete == 0);
23378         assert(d.display_interval == 1);
23379         assert(d.overtime_flag == 0);
23380         assert(d.k == 1024);
23381         assert(d.twiddle == '-');
23382         assert(d.manual_width == 0);
23383         assert(d.screen_width_minus_one == 0);
23384         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23385         assert(d.display_datacount == 1);
23386         assert(d.display_throughput == 1);
23387         assert(d.display_time == 1);
23388         assert(d.display_percent == 1);
23389         assert(d.display_bar == 1);
23390         assert(d.display_summary == 0);
23391         assert(d.display_ansi == 0);
23392         assert(d.twiddle_fg_color == 0);
23393         assert(d.twiddle_bg_color == 0);
23394         assert(d.twiddle_fg_bold == 0);
23395         assert(d.datacount_fg_color == 0);
23396         assert(d.datacount_bg_color == 0);
23397         assert(d.datacount_fg_bold == 0);
23398         assert(d.throughput_label_fg_color == 0);
23399         assert(d.throughput_label_bg_color == 0);
23400         assert(d.throughput_label_fg_bold == 0);
23401         assert(d.throughput_fg_color == 0);
23402         assert(d.throughput_bg_color == 0);
23403         assert(d.throughput_fg_bold == 0);
23404         assert(d.time_label_fg_color == 0);
23405         assert(d.time_label_bg_color == 0);
23406         assert(d.time_label_fg_bold == 0);
23407         assert(d.percent_fg_color == 0);
23408         assert(d.percent_bg_color == 0);
23409         assert(d.percent_fg_bold == 0);
23410         assert(d.barbrace_fg_color == 0);
23411         assert(d.barbrace_bg_color == 0);
23412         assert(d.barbrace_fg_bold == 0);
23413         assert(d.bar_fg_color == 0);
23414         assert(d.bar_bg_color == 0);
23415         assert(d.bar_fg_bold == 0);
23416         assert(io.in == 0);
23417         assert(io.out == 1);
23418         assert(io.in_ready == 0);
23419         assert(io.out_ready == 0);
23420         assert(io.eof_in == 0);
23421         assert(io.eof_out == 0);
23422         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23423         /* assert(io.cbuf == 0x0); */
23424         assert(io.last_read == 0);
23425         assert(io.last_write == 0);
23426         assert(io.total_read == 0);
23427         assert(io.total_write == 0);
23428         assert(io.total_size == 0);
23429         assert(io.total_size_known == 0);
23430         assert(io.timeout == 250000);
23431 
23432         tmp_rcfile = fopen("test-rcfile.txt", "w");
23433         assert(tmp_rcfile != 0);
23434         fprintf(tmp_rcfile, "display-summary: yes");
23435         fclose(tmp_rcfile);
23436 
23437         assert(test_parse_rc(out,0));
23438 
23439 #ifdef PRINT_DEBUG
23440         print();
23441 #endif
23442         assert(d.start_time == 0);
23443         assert(d.total_time == 0);
23444         assert(d.current_time == 0);
23445         assert(d.elapsed_time == 0);
23446         assert(d.percent_complete == 0);
23447         assert(d.display_interval == 1);
23448         assert(d.overtime_flag == 0);
23449         assert(d.k == 1024);
23450         assert(d.twiddle == '-');
23451         assert(d.manual_width == 0);
23452         assert(d.screen_width_minus_one == 0);
23453         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23454         assert(d.display_datacount == 1);
23455         assert(d.display_throughput == 1);
23456         assert(d.display_time == 1);
23457         assert(d.display_percent == 1);
23458         assert(d.display_bar == 1);
23459         assert(d.display_summary == 1);
23460         assert(d.display_ansi == 0);
23461         assert(d.twiddle_fg_color == 0);
23462         assert(d.twiddle_bg_color == 0);
23463         assert(d.twiddle_fg_bold == 0);
23464         assert(d.datacount_fg_color == 0);
23465         assert(d.datacount_bg_color == 0);
23466         assert(d.datacount_fg_bold == 0);
23467         assert(d.throughput_label_fg_color == 0);
23468         assert(d.throughput_label_bg_color == 0);
23469         assert(d.throughput_label_fg_bold == 0);
23470         assert(d.throughput_fg_color == 0);
23471         assert(d.throughput_bg_color == 0);
23472         assert(d.throughput_fg_bold == 0);
23473         assert(d.time_label_fg_color == 0);
23474         assert(d.time_label_bg_color == 0);
23475         assert(d.time_label_fg_bold == 0);
23476         assert(d.percent_fg_color == 0);
23477         assert(d.percent_bg_color == 0);
23478         assert(d.percent_fg_bold == 0);
23479         assert(d.barbrace_fg_color == 0);
23480         assert(d.barbrace_bg_color == 0);
23481         assert(d.barbrace_fg_bold == 0);
23482         assert(d.bar_fg_color == 0);
23483         assert(d.bar_bg_color == 0);
23484         assert(d.bar_fg_bold == 0);
23485         assert(io.in == 0);
23486         assert(io.out == 1);
23487         assert(io.in_ready == 0);
23488         assert(io.out_ready == 0);
23489         assert(io.eof_in == 0);
23490         assert(io.eof_out == 0);
23491         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23492         /* assert(io.cbuf == 0x0); */
23493         assert(io.last_read == 0);
23494         assert(io.last_write == 0);
23495         assert(io.total_read == 0);
23496         assert(io.total_write == 0);
23497         assert(io.total_size == 0);
23498         assert(io.total_size_known == 0);
23499         assert(io.timeout == 250000);
23500 
23501         tmp_rcfile = fopen("test-rcfile.txt", "w");
23502         assert(tmp_rcfile != 0);
23503         fprintf(tmp_rcfile, "display-summary: n");
23504         fclose(tmp_rcfile);
23505 
23506         assert(test_parse_rc(out,0));
23507 
23508 #ifdef PRINT_DEBUG
23509         print();
23510 #endif
23511         assert(d.start_time == 0);
23512         assert(d.total_time == 0);
23513         assert(d.current_time == 0);
23514         assert(d.elapsed_time == 0);
23515         assert(d.percent_complete == 0);
23516         assert(d.display_interval == 1);
23517         assert(d.overtime_flag == 0);
23518         assert(d.k == 1024);
23519         assert(d.twiddle == '-');
23520         assert(d.manual_width == 0);
23521         assert(d.screen_width_minus_one == 0);
23522         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23523         assert(d.display_datacount == 1);
23524         assert(d.display_throughput == 1);
23525         assert(d.display_time == 1);
23526         assert(d.display_percent == 1);
23527         assert(d.display_bar == 1);
23528         assert(d.display_summary == 0);
23529         assert(d.display_ansi == 0);
23530         assert(d.twiddle_fg_color == 0);
23531         assert(d.twiddle_bg_color == 0);
23532         assert(d.twiddle_fg_bold == 0);
23533         assert(d.datacount_fg_color == 0);
23534         assert(d.datacount_bg_color == 0);
23535         assert(d.datacount_fg_bold == 0);
23536         assert(d.throughput_label_fg_color == 0);
23537         assert(d.throughput_label_bg_color == 0);
23538         assert(d.throughput_label_fg_bold == 0);
23539         assert(d.throughput_fg_color == 0);
23540         assert(d.throughput_bg_color == 0);
23541         assert(d.throughput_fg_bold == 0);
23542         assert(d.time_label_fg_color == 0);
23543         assert(d.time_label_bg_color == 0);
23544         assert(d.time_label_fg_bold == 0);
23545         assert(d.percent_fg_color == 0);
23546         assert(d.percent_bg_color == 0);
23547         assert(d.percent_fg_bold == 0);
23548         assert(d.barbrace_fg_color == 0);
23549         assert(d.barbrace_bg_color == 0);
23550         assert(d.barbrace_fg_bold == 0);
23551         assert(d.bar_fg_color == 0);
23552         assert(d.bar_bg_color == 0);
23553         assert(d.bar_fg_bold == 0);
23554         assert(io.in == 0);
23555         assert(io.out == 1);
23556         assert(io.in_ready == 0);
23557         assert(io.out_ready == 0);
23558         assert(io.eof_in == 0);
23559         assert(io.eof_out == 0);
23560         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23561         /* assert(io.cbuf == 0x0); */
23562         assert(io.last_read == 0);
23563         assert(io.last_write == 0);
23564         assert(io.total_read == 0);
23565         assert(io.total_write == 0);
23566         assert(io.total_size == 0);
23567         assert(io.total_size_known == 0);
23568         assert(io.timeout == 250000);
23569 
23570         tmp_rcfile = fopen("test-rcfile.txt", "w");
23571         assert(tmp_rcfile != 0);
23572         fprintf(tmp_rcfile, "display-summary: y");
23573         fclose(tmp_rcfile);
23574 
23575         assert(test_parse_rc(out,0));
23576 
23577 #ifdef PRINT_DEBUG
23578         print();
23579 #endif
23580         assert(d.start_time == 0);
23581         assert(d.total_time == 0);
23582         assert(d.current_time == 0);
23583         assert(d.elapsed_time == 0);
23584         assert(d.percent_complete == 0);
23585         assert(d.display_interval == 1);
23586         assert(d.overtime_flag == 0);
23587         assert(d.k == 1024);
23588         assert(d.twiddle == '-');
23589         assert(d.manual_width == 0);
23590         assert(d.screen_width_minus_one == 0);
23591         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23592         assert(d.display_datacount == 1);
23593         assert(d.display_throughput == 1);
23594         assert(d.display_time == 1);
23595         assert(d.display_percent == 1);
23596         assert(d.display_bar == 1);
23597         assert(d.display_summary == 1);
23598         assert(d.display_ansi == 0);
23599         assert(d.twiddle_fg_color == 0);
23600         assert(d.twiddle_bg_color == 0);
23601         assert(d.twiddle_fg_bold == 0);
23602         assert(d.datacount_fg_color == 0);
23603         assert(d.datacount_bg_color == 0);
23604         assert(d.datacount_fg_bold == 0);
23605         assert(d.throughput_label_fg_color == 0);
23606         assert(d.throughput_label_bg_color == 0);
23607         assert(d.throughput_label_fg_bold == 0);
23608         assert(d.throughput_fg_color == 0);
23609         assert(d.throughput_bg_color == 0);
23610         assert(d.throughput_fg_bold == 0);
23611         assert(d.time_label_fg_color == 0);
23612         assert(d.time_label_bg_color == 0);
23613         assert(d.time_label_fg_bold == 0);
23614         assert(d.percent_fg_color == 0);
23615         assert(d.percent_bg_color == 0);
23616         assert(d.percent_fg_bold == 0);
23617         assert(d.barbrace_fg_color == 0);
23618         assert(d.barbrace_bg_color == 0);
23619         assert(d.barbrace_fg_bold == 0);
23620         assert(d.bar_fg_color == 0);
23621         assert(d.bar_bg_color == 0);
23622         assert(d.bar_fg_bold == 0);
23623         assert(io.in == 0);
23624         assert(io.out == 1);
23625         assert(io.in_ready == 0);
23626         assert(io.out_ready == 0);
23627         assert(io.eof_in == 0);
23628         assert(io.eof_out == 0);
23629         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23630         /* assert(io.cbuf == 0x0); */
23631         assert(io.last_read == 0);
23632         assert(io.last_write == 0);
23633         assert(io.total_read == 0);
23634         assert(io.total_write == 0);
23635         assert(io.total_size == 0);
23636         assert(io.total_size_known == 0);
23637         assert(io.timeout == 250000);
23638 
23639         tmp_rcfile = fopen("test-rcfile.txt", "w");
23640         assert(tmp_rcfile != 0);
23641         fprintf(tmp_rcfile, "display-summary: false");
23642         fclose(tmp_rcfile);
23643 
23644         assert(test_parse_rc(out,0));
23645 
23646 #ifdef PRINT_DEBUG
23647         print();
23648 #endif
23649         assert(d.start_time == 0);
23650         assert(d.total_time == 0);
23651         assert(d.current_time == 0);
23652         assert(d.elapsed_time == 0);
23653         assert(d.percent_complete == 0);
23654         assert(d.display_interval == 1);
23655         assert(d.overtime_flag == 0);
23656         assert(d.k == 1024);
23657         assert(d.twiddle == '-');
23658         assert(d.manual_width == 0);
23659         assert(d.screen_width_minus_one == 0);
23660         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23661         assert(d.display_datacount == 1);
23662         assert(d.display_throughput == 1);
23663         assert(d.display_time == 1);
23664         assert(d.display_percent == 1);
23665         assert(d.display_bar == 1);
23666         assert(d.display_summary == 0);
23667         assert(d.display_ansi == 0);
23668         assert(d.twiddle_fg_color == 0);
23669         assert(d.twiddle_bg_color == 0);
23670         assert(d.twiddle_fg_bold == 0);
23671         assert(d.datacount_fg_color == 0);
23672         assert(d.datacount_bg_color == 0);
23673         assert(d.datacount_fg_bold == 0);
23674         assert(d.throughput_label_fg_color == 0);
23675         assert(d.throughput_label_bg_color == 0);
23676         assert(d.throughput_label_fg_bold == 0);
23677         assert(d.throughput_fg_color == 0);
23678         assert(d.throughput_bg_color == 0);
23679         assert(d.throughput_fg_bold == 0);
23680         assert(d.time_label_fg_color == 0);
23681         assert(d.time_label_bg_color == 0);
23682         assert(d.time_label_fg_bold == 0);
23683         assert(d.percent_fg_color == 0);
23684         assert(d.percent_bg_color == 0);
23685         assert(d.percent_fg_bold == 0);
23686         assert(d.barbrace_fg_color == 0);
23687         assert(d.barbrace_bg_color == 0);
23688         assert(d.barbrace_fg_bold == 0);
23689         assert(d.bar_fg_color == 0);
23690         assert(d.bar_bg_color == 0);
23691         assert(d.bar_fg_bold == 0);
23692         assert(io.in == 0);
23693         assert(io.out == 1);
23694         assert(io.in_ready == 0);
23695         assert(io.out_ready == 0);
23696         assert(io.eof_in == 0);
23697         assert(io.eof_out == 0);
23698         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23699         /* assert(io.cbuf == 0x0); */
23700         assert(io.last_read == 0);
23701         assert(io.last_write == 0);
23702         assert(io.total_read == 0);
23703         assert(io.total_write == 0);
23704         assert(io.total_size == 0);
23705         assert(io.total_size_known == 0);
23706         assert(io.timeout == 250000);
23707 
23708         tmp_rcfile = fopen("test-rcfile.txt", "w");
23709         assert(tmp_rcfile != 0);
23710         fprintf(tmp_rcfile, "display-summary: true");
23711         fclose(tmp_rcfile);
23712 
23713         assert(test_parse_rc(out,0));
23714 
23715 #ifdef PRINT_DEBUG
23716         print();
23717 #endif
23718         assert(d.start_time == 0);
23719         assert(d.total_time == 0);
23720         assert(d.current_time == 0);
23721         assert(d.elapsed_time == 0);
23722         assert(d.percent_complete == 0);
23723         assert(d.display_interval == 1);
23724         assert(d.overtime_flag == 0);
23725         assert(d.k == 1024);
23726         assert(d.twiddle == '-');
23727         assert(d.manual_width == 0);
23728         assert(d.screen_width_minus_one == 0);
23729         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23730         assert(d.display_datacount == 1);
23731         assert(d.display_throughput == 1);
23732         assert(d.display_time == 1);
23733         assert(d.display_percent == 1);
23734         assert(d.display_bar == 1);
23735         assert(d.display_summary == 1);
23736         assert(d.display_ansi == 0);
23737         assert(d.twiddle_fg_color == 0);
23738         assert(d.twiddle_bg_color == 0);
23739         assert(d.twiddle_fg_bold == 0);
23740         assert(d.datacount_fg_color == 0);
23741         assert(d.datacount_bg_color == 0);
23742         assert(d.datacount_fg_bold == 0);
23743         assert(d.throughput_label_fg_color == 0);
23744         assert(d.throughput_label_bg_color == 0);
23745         assert(d.throughput_label_fg_bold == 0);
23746         assert(d.throughput_fg_color == 0);
23747         assert(d.throughput_bg_color == 0);
23748         assert(d.throughput_fg_bold == 0);
23749         assert(d.time_label_fg_color == 0);
23750         assert(d.time_label_bg_color == 0);
23751         assert(d.time_label_fg_bold == 0);
23752         assert(d.percent_fg_color == 0);
23753         assert(d.percent_bg_color == 0);
23754         assert(d.percent_fg_bold == 0);
23755         assert(d.barbrace_fg_color == 0);
23756         assert(d.barbrace_bg_color == 0);
23757         assert(d.barbrace_fg_bold == 0);
23758         assert(d.bar_fg_color == 0);
23759         assert(d.bar_bg_color == 0);
23760         assert(d.bar_fg_bold == 0);
23761         assert(io.in == 0);
23762         assert(io.out == 1);
23763         assert(io.in_ready == 0);
23764         assert(io.out_ready == 0);
23765         assert(io.eof_in == 0);
23766         assert(io.eof_out == 0);
23767         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23768         /* assert(io.cbuf == 0x0); */
23769         assert(io.last_read == 0);
23770         assert(io.last_write == 0);
23771         assert(io.total_read == 0);
23772         assert(io.total_write == 0);
23773         assert(io.total_size == 0);
23774         assert(io.total_size_known == 0);
23775         assert(io.timeout == 250000);
23776 
23777         tmp_rcfile = fopen("test-rcfile.txt", "w");
23778         assert(tmp_rcfile != 0);
23779         fprintf(tmp_rcfile, "display-summary: f");
23780         fclose(tmp_rcfile);
23781 
23782         assert(test_parse_rc(out,0));
23783 
23784 #ifdef PRINT_DEBUG
23785         print();
23786 #endif
23787         assert(d.start_time == 0);
23788         assert(d.total_time == 0);
23789         assert(d.current_time == 0);
23790         assert(d.elapsed_time == 0);
23791         assert(d.percent_complete == 0);
23792         assert(d.display_interval == 1);
23793         assert(d.overtime_flag == 0);
23794         assert(d.k == 1024);
23795         assert(d.twiddle == '-');
23796         assert(d.manual_width == 0);
23797         assert(d.screen_width_minus_one == 0);
23798         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23799         assert(d.display_datacount == 1);
23800         assert(d.display_throughput == 1);
23801         assert(d.display_time == 1);
23802         assert(d.display_percent == 1);
23803         assert(d.display_bar == 1);
23804         assert(d.display_summary == 0);
23805         assert(d.display_ansi == 0);
23806         assert(d.twiddle_fg_color == 0);
23807         assert(d.twiddle_bg_color == 0);
23808         assert(d.twiddle_fg_bold == 0);
23809         assert(d.datacount_fg_color == 0);
23810         assert(d.datacount_bg_color == 0);
23811         assert(d.datacount_fg_bold == 0);
23812         assert(d.throughput_label_fg_color == 0);
23813         assert(d.throughput_label_bg_color == 0);
23814         assert(d.throughput_label_fg_bold == 0);
23815         assert(d.throughput_fg_color == 0);
23816         assert(d.throughput_bg_color == 0);
23817         assert(d.throughput_fg_bold == 0);
23818         assert(d.time_label_fg_color == 0);
23819         assert(d.time_label_bg_color == 0);
23820         assert(d.time_label_fg_bold == 0);
23821         assert(d.percent_fg_color == 0);
23822         assert(d.percent_bg_color == 0);
23823         assert(d.percent_fg_bold == 0);
23824         assert(d.barbrace_fg_color == 0);
23825         assert(d.barbrace_bg_color == 0);
23826         assert(d.barbrace_fg_bold == 0);
23827         assert(d.bar_fg_color == 0);
23828         assert(d.bar_bg_color == 0);
23829         assert(d.bar_fg_bold == 0);
23830         assert(io.in == 0);
23831         assert(io.out == 1);
23832         assert(io.in_ready == 0);
23833         assert(io.out_ready == 0);
23834         assert(io.eof_in == 0);
23835         assert(io.eof_out == 0);
23836         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23837         /* assert(io.cbuf == 0x0); */
23838         assert(io.last_read == 0);
23839         assert(io.last_write == 0);
23840         assert(io.total_read == 0);
23841         assert(io.total_write == 0);
23842         assert(io.total_size == 0);
23843         assert(io.total_size_known == 0);
23844         assert(io.timeout == 250000);
23845 
23846         tmp_rcfile = fopen("test-rcfile.txt", "w");
23847         assert(tmp_rcfile != 0);
23848         fprintf(tmp_rcfile, "display-summary: t");
23849         fclose(tmp_rcfile);
23850 
23851         assert(test_parse_rc(out,0));
23852 
23853 #ifdef PRINT_DEBUG
23854         print();
23855 #endif
23856         assert(d.start_time == 0);
23857         assert(d.total_time == 0);
23858         assert(d.current_time == 0);
23859         assert(d.elapsed_time == 0);
23860         assert(d.percent_complete == 0);
23861         assert(d.display_interval == 1);
23862         assert(d.overtime_flag == 0);
23863         assert(d.k == 1024);
23864         assert(d.twiddle == '-');
23865         assert(d.manual_width == 0);
23866         assert(d.screen_width_minus_one == 0);
23867         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23868         assert(d.display_datacount == 1);
23869         assert(d.display_throughput == 1);
23870         assert(d.display_time == 1);
23871         assert(d.display_percent == 1);
23872         assert(d.display_bar == 1);
23873         assert(d.display_summary == 1);
23874         assert(d.display_ansi == 0);
23875         assert(d.twiddle_fg_color == 0);
23876         assert(d.twiddle_bg_color == 0);
23877         assert(d.twiddle_fg_bold == 0);
23878         assert(d.datacount_fg_color == 0);
23879         assert(d.datacount_bg_color == 0);
23880         assert(d.datacount_fg_bold == 0);
23881         assert(d.throughput_label_fg_color == 0);
23882         assert(d.throughput_label_bg_color == 0);
23883         assert(d.throughput_label_fg_bold == 0);
23884         assert(d.throughput_fg_color == 0);
23885         assert(d.throughput_bg_color == 0);
23886         assert(d.throughput_fg_bold == 0);
23887         assert(d.time_label_fg_color == 0);
23888         assert(d.time_label_bg_color == 0);
23889         assert(d.time_label_fg_bold == 0);
23890         assert(d.percent_fg_color == 0);
23891         assert(d.percent_bg_color == 0);
23892         assert(d.percent_fg_bold == 0);
23893         assert(d.barbrace_fg_color == 0);
23894         assert(d.barbrace_bg_color == 0);
23895         assert(d.barbrace_fg_bold == 0);
23896         assert(d.bar_fg_color == 0);
23897         assert(d.bar_bg_color == 0);
23898         assert(d.bar_fg_bold == 0);
23899         assert(io.in == 0);
23900         assert(io.out == 1);
23901         assert(io.in_ready == 0);
23902         assert(io.out_ready == 0);
23903         assert(io.eof_in == 0);
23904         assert(io.eof_out == 0);
23905         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23906         /* assert(io.cbuf == 0x0); */
23907         assert(io.last_read == 0);
23908         assert(io.last_write == 0);
23909         assert(io.total_read == 0);
23910         assert(io.total_write == 0);
23911         assert(io.total_size == 0);
23912         assert(io.total_size_known == 0);
23913         assert(io.timeout == 250000);
23914 
23915         tmp_rcfile = fopen("test-rcfile.txt", "w");
23916         assert(tmp_rcfile != 0);
23917         fprintf(tmp_rcfile, "display-summary: 0");
23918         fclose(tmp_rcfile);
23919 
23920         assert(test_parse_rc(out,0));
23921 
23922 #ifdef PRINT_DEBUG
23923         print();
23924 #endif
23925         assert(d.start_time == 0);
23926         assert(d.total_time == 0);
23927         assert(d.current_time == 0);
23928         assert(d.elapsed_time == 0);
23929         assert(d.percent_complete == 0);
23930         assert(d.display_interval == 1);
23931         assert(d.overtime_flag == 0);
23932         assert(d.k == 1024);
23933         assert(d.twiddle == '-');
23934         assert(d.manual_width == 0);
23935         assert(d.screen_width_minus_one == 0);
23936         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
23937         assert(d.display_datacount == 1);
23938         assert(d.display_throughput == 1);
23939         assert(d.display_time == 1);
23940         assert(d.display_percent == 1);
23941         assert(d.display_bar == 1);
23942         assert(d.display_summary == 0);
23943         assert(d.display_ansi == 0);
23944         assert(d.twiddle_fg_color == 0);
23945         assert(d.twiddle_bg_color == 0);
23946         assert(d.twiddle_fg_bold == 0);
23947         assert(d.datacount_fg_color == 0);
23948         assert(d.datacount_bg_color == 0);
23949         assert(d.datacount_fg_bold == 0);
23950         assert(d.throughput_label_fg_color == 0);
23951         assert(d.throughput_label_bg_color == 0);
23952         assert(d.throughput_label_fg_bold == 0);
23953         assert(d.throughput_fg_color == 0);
23954         assert(d.throughput_bg_color == 0);
23955         assert(d.throughput_fg_bold == 0);
23956         assert(d.time_label_fg_color == 0);
23957         assert(d.time_label_bg_color == 0);
23958         assert(d.time_label_fg_bold == 0);
23959         assert(d.percent_fg_color == 0);
23960         assert(d.percent_bg_color == 0);
23961         assert(d.percent_fg_bold == 0);
23962         assert(d.barbrace_fg_color == 0);
23963         assert(d.barbrace_bg_color == 0);
23964         assert(d.barbrace_fg_bold == 0);
23965         assert(d.bar_fg_color == 0);
23966         assert(d.bar_bg_color == 0);
23967         assert(d.bar_fg_bold == 0);
23968         assert(io.in == 0);
23969         assert(io.out == 1);
23970         assert(io.in_ready == 0);
23971         assert(io.out_ready == 0);
23972         assert(io.eof_in == 0);
23973         assert(io.eof_out == 0);
23974         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
23975         /* assert(io.cbuf == 0x0); */
23976         assert(io.last_read == 0);
23977         assert(io.last_write == 0);
23978         assert(io.total_read == 0);
23979         assert(io.total_write == 0);
23980         assert(io.total_size == 0);
23981         assert(io.total_size_known == 0);
23982         assert(io.timeout == 250000);
23983 
23984         tmp_rcfile = fopen("test-rcfile.txt", "w");
23985         assert(tmp_rcfile != 0);
23986         fprintf(tmp_rcfile, "display-summary: 1");
23987         fclose(tmp_rcfile);
23988 
23989         assert(test_parse_rc(out,0));
23990 
23991 #ifdef PRINT_DEBUG
23992         print();
23993 #endif
23994         assert(d.start_time == 0);
23995         assert(d.total_time == 0);
23996         assert(d.current_time == 0);
23997         assert(d.elapsed_time == 0);
23998         assert(d.percent_complete == 0);
23999         assert(d.display_interval == 1);
24000         assert(d.overtime_flag == 0);
24001         assert(d.k == 1024);
24002         assert(d.twiddle == '-');
24003         assert(d.manual_width == 0);
24004         assert(d.screen_width_minus_one == 0);
24005         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24006         assert(d.display_datacount == 1);
24007         assert(d.display_throughput == 1);
24008         assert(d.display_time == 1);
24009         assert(d.display_percent == 1);
24010         assert(d.display_bar == 1);
24011         assert(d.display_summary == 1);
24012         assert(d.display_ansi == 0);
24013         assert(d.twiddle_fg_color == 0);
24014         assert(d.twiddle_bg_color == 0);
24015         assert(d.twiddle_fg_bold == 0);
24016         assert(d.datacount_fg_color == 0);
24017         assert(d.datacount_bg_color == 0);
24018         assert(d.datacount_fg_bold == 0);
24019         assert(d.throughput_label_fg_color == 0);
24020         assert(d.throughput_label_bg_color == 0);
24021         assert(d.throughput_label_fg_bold == 0);
24022         assert(d.throughput_fg_color == 0);
24023         assert(d.throughput_bg_color == 0);
24024         assert(d.throughput_fg_bold == 0);
24025         assert(d.time_label_fg_color == 0);
24026         assert(d.time_label_bg_color == 0);
24027         assert(d.time_label_fg_bold == 0);
24028         assert(d.percent_fg_color == 0);
24029         assert(d.percent_bg_color == 0);
24030         assert(d.percent_fg_bold == 0);
24031         assert(d.barbrace_fg_color == 0);
24032         assert(d.barbrace_bg_color == 0);
24033         assert(d.barbrace_fg_bold == 0);
24034         assert(d.bar_fg_color == 0);
24035         assert(d.bar_bg_color == 0);
24036         assert(d.bar_fg_bold == 0);
24037         assert(io.in == 0);
24038         assert(io.out == 1);
24039         assert(io.in_ready == 0);
24040         assert(io.out_ready == 0);
24041         assert(io.eof_in == 0);
24042         assert(io.eof_out == 0);
24043         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24044         /* assert(io.cbuf == 0x0); */
24045         assert(io.last_read == 0);
24046         assert(io.last_write == 0);
24047         assert(io.total_read == 0);
24048         assert(io.total_write == 0);
24049         assert(io.total_size == 0);
24050         assert(io.total_size_known == 0);
24051         assert(io.timeout == 250000);
24052 
24053         tmp_rcfile = fopen("test-rcfile.txt", "w");
24054         assert(tmp_rcfile != 0);
24055         fprintf(tmp_rcfile, "display-summary: off");
24056         fclose(tmp_rcfile);
24057 
24058         assert(test_parse_rc(out,0));
24059 
24060 #ifdef PRINT_DEBUG
24061         print();
24062 #endif
24063         assert(d.start_time == 0);
24064         assert(d.total_time == 0);
24065         assert(d.current_time == 0);
24066         assert(d.elapsed_time == 0);
24067         assert(d.percent_complete == 0);
24068         assert(d.display_interval == 1);
24069         assert(d.overtime_flag == 0);
24070         assert(d.k == 1024);
24071         assert(d.twiddle == '-');
24072         assert(d.manual_width == 0);
24073         assert(d.screen_width_minus_one == 0);
24074         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24075         assert(d.display_datacount == 1);
24076         assert(d.display_throughput == 1);
24077         assert(d.display_time == 1);
24078         assert(d.display_percent == 1);
24079         assert(d.display_bar == 1);
24080         assert(d.display_summary == 0);
24081         assert(d.display_ansi == 0);
24082         assert(d.twiddle_fg_color == 0);
24083         assert(d.twiddle_bg_color == 0);
24084         assert(d.twiddle_fg_bold == 0);
24085         assert(d.datacount_fg_color == 0);
24086         assert(d.datacount_bg_color == 0);
24087         assert(d.datacount_fg_bold == 0);
24088         assert(d.throughput_label_fg_color == 0);
24089         assert(d.throughput_label_bg_color == 0);
24090         assert(d.throughput_label_fg_bold == 0);
24091         assert(d.throughput_fg_color == 0);
24092         assert(d.throughput_bg_color == 0);
24093         assert(d.throughput_fg_bold == 0);
24094         assert(d.time_label_fg_color == 0);
24095         assert(d.time_label_bg_color == 0);
24096         assert(d.time_label_fg_bold == 0);
24097         assert(d.percent_fg_color == 0);
24098         assert(d.percent_bg_color == 0);
24099         assert(d.percent_fg_bold == 0);
24100         assert(d.barbrace_fg_color == 0);
24101         assert(d.barbrace_bg_color == 0);
24102         assert(d.barbrace_fg_bold == 0);
24103         assert(d.bar_fg_color == 0);
24104         assert(d.bar_bg_color == 0);
24105         assert(d.bar_fg_bold == 0);
24106         assert(io.in == 0);
24107         assert(io.out == 1);
24108         assert(io.in_ready == 0);
24109         assert(io.out_ready == 0);
24110         assert(io.eof_in == 0);
24111         assert(io.eof_out == 0);
24112         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24113         /* assert(io.cbuf == 0x0); */
24114         assert(io.last_read == 0);
24115         assert(io.last_write == 0);
24116         assert(io.total_read == 0);
24117         assert(io.total_write == 0);
24118         assert(io.total_size == 0);
24119         assert(io.total_size_known == 0);
24120         assert(io.timeout == 250000);
24121 
24122         tmp_rcfile = fopen("test-rcfile.txt", "w");
24123         assert(tmp_rcfile != 0);
24124         fprintf(tmp_rcfile, "display-summary: on");
24125         fclose(tmp_rcfile);
24126 
24127         assert(test_parse_rc(out,0));
24128 
24129 #ifdef PRINT_DEBUG
24130         print();
24131 #endif
24132         assert(d.start_time == 0);
24133         assert(d.total_time == 0);
24134         assert(d.current_time == 0);
24135         assert(d.elapsed_time == 0);
24136         assert(d.percent_complete == 0);
24137         assert(d.display_interval == 1);
24138         assert(d.overtime_flag == 0);
24139         assert(d.k == 1024);
24140         assert(d.twiddle == '-');
24141         assert(d.manual_width == 0);
24142         assert(d.screen_width_minus_one == 0);
24143         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24144         assert(d.display_datacount == 1);
24145         assert(d.display_throughput == 1);
24146         assert(d.display_time == 1);
24147         assert(d.display_percent == 1);
24148         assert(d.display_bar == 1);
24149         assert(d.display_summary == 1);
24150         assert(d.display_ansi == 0);
24151         assert(d.twiddle_fg_color == 0);
24152         assert(d.twiddle_bg_color == 0);
24153         assert(d.twiddle_fg_bold == 0);
24154         assert(d.datacount_fg_color == 0);
24155         assert(d.datacount_bg_color == 0);
24156         assert(d.datacount_fg_bold == 0);
24157         assert(d.throughput_label_fg_color == 0);
24158         assert(d.throughput_label_bg_color == 0);
24159         assert(d.throughput_label_fg_bold == 0);
24160         assert(d.throughput_fg_color == 0);
24161         assert(d.throughput_bg_color == 0);
24162         assert(d.throughput_fg_bold == 0);
24163         assert(d.time_label_fg_color == 0);
24164         assert(d.time_label_bg_color == 0);
24165         assert(d.time_label_fg_bold == 0);
24166         assert(d.percent_fg_color == 0);
24167         assert(d.percent_bg_color == 0);
24168         assert(d.percent_fg_bold == 0);
24169         assert(d.barbrace_fg_color == 0);
24170         assert(d.barbrace_bg_color == 0);
24171         assert(d.barbrace_fg_bold == 0);
24172         assert(d.bar_fg_color == 0);
24173         assert(d.bar_bg_color == 0);
24174         assert(d.bar_fg_bold == 0);
24175         assert(io.in == 0);
24176         assert(io.out == 1);
24177         assert(io.in_ready == 0);
24178         assert(io.out_ready == 0);
24179         assert(io.eof_in == 0);
24180         assert(io.eof_out == 0);
24181         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24182         /* assert(io.cbuf == 0x0); */
24183         assert(io.last_read == 0);
24184         assert(io.last_write == 0);
24185         assert(io.total_read == 0);
24186         assert(io.total_write == 0);
24187         assert(io.total_size == 0);
24188         assert(io.total_size_known == 0);
24189         assert(io.timeout == 250000);
24190 
24191         assert(unlink("./test-rcfile.txt") == 0);
24192 }
24193 
24194 void test134(FILE *out)
24195 {
24196         FILE *tmp_rcfile = 0;
24197         
24198         tmp_rcfile = fopen("test-rcfile.txt", "w");
24199         assert(tmp_rcfile != 0);
24200         fprintf(tmp_rcfile, "screen-width-minus-one: Sjkhg");
24201         fclose(tmp_rcfile);
24202 
24203         clear_errno();
24204         ioInit();
24205         displayInit();
24206 
24207 #ifdef PRINT_DEBUG
24208         print();
24209 #endif
24210         assert(d.start_time == 0);
24211         assert(d.total_time == 0);
24212         assert(d.current_time == 0);
24213         assert(d.elapsed_time == 0);
24214         assert(d.percent_complete == 0);
24215         assert(d.display_interval == 1);
24216         assert(d.overtime_flag == 0);
24217         assert(d.k == 1024);
24218         assert(d.twiddle == '-');
24219         assert(d.manual_width == 0);
24220         assert(d.screen_width_minus_one == 0);
24221         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24222         assert(d.display_datacount == 1);
24223         assert(d.display_throughput == 1);
24224         assert(d.display_time == 1);
24225         assert(d.display_percent == 1);
24226         assert(d.display_bar == 1);
24227         assert(d.display_summary == 1);
24228         assert(d.display_ansi == 0);
24229         assert(d.twiddle_fg_color == 0);
24230         assert(d.twiddle_bg_color == 0);
24231         assert(d.twiddle_fg_bold == 0);
24232         assert(d.datacount_fg_color == 0);
24233         assert(d.datacount_bg_color == 0);
24234         assert(d.datacount_fg_bold == 0);
24235         assert(d.throughput_label_fg_color == 0);
24236         assert(d.throughput_label_bg_color == 0);
24237         assert(d.throughput_label_fg_bold == 0);
24238         assert(d.throughput_fg_color == 0);
24239         assert(d.throughput_bg_color == 0);
24240         assert(d.throughput_fg_bold == 0);
24241         assert(d.time_label_fg_color == 0);
24242         assert(d.time_label_bg_color == 0);
24243         assert(d.time_label_fg_bold == 0);
24244         assert(d.percent_fg_color == 0);
24245         assert(d.percent_bg_color == 0);
24246         assert(d.percent_fg_bold == 0);
24247         assert(d.barbrace_fg_color == 0);
24248         assert(d.barbrace_bg_color == 0);
24249         assert(d.barbrace_fg_bold == 0);
24250         assert(d.bar_fg_color == 0);
24251         assert(d.bar_bg_color == 0);
24252         assert(d.bar_fg_bold == 0);
24253         assert(io.in == 0);
24254         assert(io.out == 1);
24255         assert(io.in_ready == 0);
24256         assert(io.out_ready == 0);
24257         assert(io.eof_in == 0);
24258         assert(io.eof_out == 0);
24259         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24260         /* assert(io.cbuf == 0x0); */
24261         assert(io.last_read == 0);
24262         assert(io.last_write == 0);
24263         assert(io.total_read == 0);
24264         assert(io.total_write == 0);
24265         assert(io.total_size == 0);
24266         assert(io.total_size_known == 0);
24267         assert(io.timeout == 250000);
24268 
24269         assert(test_parse_rc(out,1));
24270 
24271 #ifdef PRINT_DEBUG
24272         print();
24273 #endif
24274         assert(d.start_time == 0);
24275         assert(d.total_time == 0);
24276         assert(d.current_time == 0);
24277         assert(d.elapsed_time == 0);
24278         assert(d.percent_complete == 0);
24279         assert(d.display_interval == 1);
24280         assert(d.overtime_flag == 0);
24281         assert(d.k == 1024);
24282         assert(d.twiddle == '-');
24283         assert(d.manual_width == 0);
24284         assert(d.screen_width_minus_one == 0);
24285         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24286         assert(d.display_datacount == 1);
24287         assert(d.display_throughput == 1);
24288         assert(d.display_time == 1);
24289         assert(d.display_percent == 1);
24290         assert(d.display_bar == 1);
24291         assert(d.display_summary == 1);
24292         assert(d.display_ansi == 0);
24293         assert(d.twiddle_fg_color == 0);
24294         assert(d.twiddle_bg_color == 0);
24295         assert(d.twiddle_fg_bold == 0);
24296         assert(d.datacount_fg_color == 0);
24297         assert(d.datacount_bg_color == 0);
24298         assert(d.datacount_fg_bold == 0);
24299         assert(d.throughput_label_fg_color == 0);
24300         assert(d.throughput_label_bg_color == 0);
24301         assert(d.throughput_label_fg_bold == 0);
24302         assert(d.throughput_fg_color == 0);
24303         assert(d.throughput_bg_color == 0);
24304         assert(d.throughput_fg_bold == 0);
24305         assert(d.time_label_fg_color == 0);
24306         assert(d.time_label_bg_color == 0);
24307         assert(d.time_label_fg_bold == 0);
24308         assert(d.percent_fg_color == 0);
24309         assert(d.percent_bg_color == 0);
24310         assert(d.percent_fg_bold == 0);
24311         assert(d.barbrace_fg_color == 0);
24312         assert(d.barbrace_bg_color == 0);
24313         assert(d.barbrace_fg_bold == 0);
24314         assert(d.bar_fg_color == 0);
24315         assert(d.bar_bg_color == 0);
24316         assert(d.bar_fg_bold == 0);
24317         assert(io.in == 0);
24318         assert(io.out == 1);
24319         assert(io.in_ready == 0);
24320         assert(io.out_ready == 0);
24321         assert(io.eof_in == 0);
24322         assert(io.eof_out == 0);
24323         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24324         /* assert(io.cbuf == 0x0); */
24325         assert(io.last_read == 0);
24326         assert(io.last_write == 0);
24327         assert(io.total_read == 0);
24328         assert(io.total_write == 0);
24329         assert(io.total_size == 0);
24330         assert(io.total_size_known == 0);
24331         assert(io.timeout == 250000);
24332 
24333         tmp_rcfile = fopen("test-rcfile.txt", "w");
24334         assert(tmp_rcfile != 0);
24335         fprintf(tmp_rcfile, "screen-width-minus-one: no");
24336         fclose(tmp_rcfile);
24337 
24338         assert(test_parse_rc(out,0));
24339 
24340 #ifdef PRINT_DEBUG
24341         print();
24342 #endif
24343         assert(d.start_time == 0);
24344         assert(d.total_time == 0);
24345         assert(d.current_time == 0);
24346         assert(d.elapsed_time == 0);
24347         assert(d.percent_complete == 0);
24348         assert(d.display_interval == 1);
24349         assert(d.overtime_flag == 0);
24350         assert(d.k == 1024);
24351         assert(d.twiddle == '-');
24352         assert(d.manual_width == 0);
24353         assert(d.screen_width_minus_one == 0);
24354         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24355         assert(d.display_datacount == 1);
24356         assert(d.display_throughput == 1);
24357         assert(d.display_time == 1);
24358         assert(d.display_percent == 1);
24359         assert(d.display_bar == 1);
24360         assert(d.display_summary == 1);
24361         assert(d.display_ansi == 0);
24362         assert(d.twiddle_fg_color == 0);
24363         assert(d.twiddle_bg_color == 0);
24364         assert(d.twiddle_fg_bold == 0);
24365         assert(d.datacount_fg_color == 0);
24366         assert(d.datacount_bg_color == 0);
24367         assert(d.datacount_fg_bold == 0);
24368         assert(d.throughput_label_fg_color == 0);
24369         assert(d.throughput_label_bg_color == 0);
24370         assert(d.throughput_label_fg_bold == 0);
24371         assert(d.throughput_fg_color == 0);
24372         assert(d.throughput_bg_color == 0);
24373         assert(d.throughput_fg_bold == 0);
24374         assert(d.time_label_fg_color == 0);
24375         assert(d.time_label_bg_color == 0);
24376         assert(d.time_label_fg_bold == 0);
24377         assert(d.percent_fg_color == 0);
24378         assert(d.percent_bg_color == 0);
24379         assert(d.percent_fg_bold == 0);
24380         assert(d.barbrace_fg_color == 0);
24381         assert(d.barbrace_bg_color == 0);
24382         assert(d.barbrace_fg_bold == 0);
24383         assert(d.bar_fg_color == 0);
24384         assert(d.bar_bg_color == 0);
24385         assert(d.bar_fg_bold == 0);
24386         assert(io.in == 0);
24387         assert(io.out == 1);
24388         assert(io.in_ready == 0);
24389         assert(io.out_ready == 0);
24390         assert(io.eof_in == 0);
24391         assert(io.eof_out == 0);
24392         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24393         /* assert(io.cbuf == 0x0); */
24394         assert(io.last_read == 0);
24395         assert(io.last_write == 0);
24396         assert(io.total_read == 0);
24397         assert(io.total_write == 0);
24398         assert(io.total_size == 0);
24399         assert(io.total_size_known == 0);
24400         assert(io.timeout == 250000);
24401 
24402         tmp_rcfile = fopen("test-rcfile.txt", "w");
24403         assert(tmp_rcfile != 0);
24404         fprintf(tmp_rcfile, "screen-width-minus-one: yes");
24405         fclose(tmp_rcfile);
24406 
24407         assert(test_parse_rc(out,0));
24408 
24409 #ifdef PRINT_DEBUG
24410         print();
24411 #endif
24412         assert(d.start_time == 0);
24413         assert(d.total_time == 0);
24414         assert(d.current_time == 0);
24415         assert(d.elapsed_time == 0);
24416         assert(d.percent_complete == 0);
24417         assert(d.display_interval == 1);
24418         assert(d.overtime_flag == 0);
24419         assert(d.k == 1024);
24420         assert(d.twiddle == '-');
24421         assert(d.manual_width == 0);
24422         assert(d.screen_width_minus_one == 1);
24423         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24424         assert(d.display_datacount == 1);
24425         assert(d.display_throughput == 1);
24426         assert(d.display_time == 1);
24427         assert(d.display_percent == 1);
24428         assert(d.display_bar == 1);
24429         assert(d.display_summary == 1);
24430         assert(d.display_ansi == 0);
24431         assert(d.twiddle_fg_color == 0);
24432         assert(d.twiddle_bg_color == 0);
24433         assert(d.twiddle_fg_bold == 0);
24434         assert(d.datacount_fg_color == 0);
24435         assert(d.datacount_bg_color == 0);
24436         assert(d.datacount_fg_bold == 0);
24437         assert(d.throughput_label_fg_color == 0);
24438         assert(d.throughput_label_bg_color == 0);
24439         assert(d.throughput_label_fg_bold == 0);
24440         assert(d.throughput_fg_color == 0);
24441         assert(d.throughput_bg_color == 0);
24442         assert(d.throughput_fg_bold == 0);
24443         assert(d.time_label_fg_color == 0);
24444         assert(d.time_label_bg_color == 0);
24445         assert(d.time_label_fg_bold == 0);
24446         assert(d.percent_fg_color == 0);
24447         assert(d.percent_bg_color == 0);
24448         assert(d.percent_fg_bold == 0);
24449         assert(d.barbrace_fg_color == 0);
24450         assert(d.barbrace_bg_color == 0);
24451         assert(d.barbrace_fg_bold == 0);
24452         assert(d.bar_fg_color == 0);
24453         assert(d.bar_bg_color == 0);
24454         assert(d.bar_fg_bold == 0);
24455         assert(io.in == 0);
24456         assert(io.out == 1);
24457         assert(io.in_ready == 0);
24458         assert(io.out_ready == 0);
24459         assert(io.eof_in == 0);
24460         assert(io.eof_out == 0);
24461         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24462         /* assert(io.cbuf == 0x0); */
24463         assert(io.last_read == 0);
24464         assert(io.last_write == 0);
24465         assert(io.total_read == 0);
24466         assert(io.total_write == 0);
24467         assert(io.total_size == 0);
24468         assert(io.total_size_known == 0);
24469         assert(io.timeout == 250000);
24470 
24471         tmp_rcfile = fopen("test-rcfile.txt", "w");
24472         assert(tmp_rcfile != 0);
24473         fprintf(tmp_rcfile, "screen-width-minus-one: n");
24474         fclose(tmp_rcfile);
24475 
24476         assert(test_parse_rc(out,0));
24477 
24478 #ifdef PRINT_DEBUG
24479         print();
24480 #endif
24481         assert(d.start_time == 0);
24482         assert(d.total_time == 0);
24483         assert(d.current_time == 0);
24484         assert(d.elapsed_time == 0);
24485         assert(d.percent_complete == 0);
24486         assert(d.display_interval == 1);
24487         assert(d.overtime_flag == 0);
24488         assert(d.k == 1024);
24489         assert(d.twiddle == '-');
24490         assert(d.manual_width == 0);
24491         assert(d.screen_width_minus_one == 0);
24492         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24493         assert(d.display_datacount == 1);
24494         assert(d.display_throughput == 1);
24495         assert(d.display_time == 1);
24496         assert(d.display_percent == 1);
24497         assert(d.display_bar == 1);
24498         assert(d.display_summary == 1);
24499         assert(d.display_ansi == 0);
24500         assert(d.twiddle_fg_color == 0);
24501         assert(d.twiddle_bg_color == 0);
24502         assert(d.twiddle_fg_bold == 0);
24503         assert(d.datacount_fg_color == 0);
24504         assert(d.datacount_bg_color == 0);
24505         assert(d.datacount_fg_bold == 0);
24506         assert(d.throughput_label_fg_color == 0);
24507         assert(d.throughput_label_bg_color == 0);
24508         assert(d.throughput_label_fg_bold == 0);
24509         assert(d.throughput_fg_color == 0);
24510         assert(d.throughput_bg_color == 0);
24511         assert(d.throughput_fg_bold == 0);
24512         assert(d.time_label_fg_color == 0);
24513         assert(d.time_label_bg_color == 0);
24514         assert(d.time_label_fg_bold == 0);
24515         assert(d.percent_fg_color == 0);
24516         assert(d.percent_bg_color == 0);
24517         assert(d.percent_fg_bold == 0);
24518         assert(d.barbrace_fg_color == 0);
24519         assert(d.barbrace_bg_color == 0);
24520         assert(d.barbrace_fg_bold == 0);
24521         assert(d.bar_fg_color == 0);
24522         assert(d.bar_bg_color == 0);
24523         assert(d.bar_fg_bold == 0);
24524         assert(io.in == 0);
24525         assert(io.out == 1);
24526         assert(io.in_ready == 0);
24527         assert(io.out_ready == 0);
24528         assert(io.eof_in == 0);
24529         assert(io.eof_out == 0);
24530         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24531         /* assert(io.cbuf == 0x0); */
24532         assert(io.last_read == 0);
24533         assert(io.last_write == 0);
24534         assert(io.total_read == 0);
24535         assert(io.total_write == 0);
24536         assert(io.total_size == 0);
24537         assert(io.total_size_known == 0);
24538         assert(io.timeout == 250000);
24539 
24540         tmp_rcfile = fopen("test-rcfile.txt", "w");
24541         assert(tmp_rcfile != 0);
24542         fprintf(tmp_rcfile, "screen-width-minus-one: y");
24543         fclose(tmp_rcfile);
24544 
24545         assert(test_parse_rc(out,0));
24546 
24547 #ifdef PRINT_DEBUG
24548         print();
24549 #endif
24550         assert(d.start_time == 0);
24551         assert(d.total_time == 0);
24552         assert(d.current_time == 0);
24553         assert(d.elapsed_time == 0);
24554         assert(d.percent_complete == 0);
24555         assert(d.display_interval == 1);
24556         assert(d.overtime_flag == 0);
24557         assert(d.k == 1024);
24558         assert(d.twiddle == '-');
24559         assert(d.manual_width == 0);
24560         assert(d.screen_width_minus_one == 1);
24561         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24562         assert(d.display_datacount == 1);
24563         assert(d.display_throughput == 1);
24564         assert(d.display_time == 1);
24565         assert(d.display_percent == 1);
24566         assert(d.display_bar == 1);
24567         assert(d.display_summary == 1);
24568         assert(d.display_ansi == 0);
24569         assert(d.twiddle_fg_color == 0);
24570         assert(d.twiddle_bg_color == 0);
24571         assert(d.twiddle_fg_bold == 0);
24572         assert(d.datacount_fg_color == 0);
24573         assert(d.datacount_bg_color == 0);
24574         assert(d.datacount_fg_bold == 0);
24575         assert(d.throughput_label_fg_color == 0);
24576         assert(d.throughput_label_bg_color == 0);
24577         assert(d.throughput_label_fg_bold == 0);
24578         assert(d.throughput_fg_color == 0);
24579         assert(d.throughput_bg_color == 0);
24580         assert(d.throughput_fg_bold == 0);
24581         assert(d.time_label_fg_color == 0);
24582         assert(d.time_label_bg_color == 0);
24583         assert(d.time_label_fg_bold == 0);
24584         assert(d.percent_fg_color == 0);
24585         assert(d.percent_bg_color == 0);
24586         assert(d.percent_fg_bold == 0);
24587         assert(d.barbrace_fg_color == 0);
24588         assert(d.barbrace_bg_color == 0);
24589         assert(d.barbrace_fg_bold == 0);
24590         assert(d.bar_fg_color == 0);
24591         assert(d.bar_bg_color == 0);
24592         assert(d.bar_fg_bold == 0);
24593         assert(io.in == 0);
24594         assert(io.out == 1);
24595         assert(io.in_ready == 0);
24596         assert(io.out_ready == 0);
24597         assert(io.eof_in == 0);
24598         assert(io.eof_out == 0);
24599         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24600         /* assert(io.cbuf == 0x0); */
24601         assert(io.last_read == 0);
24602         assert(io.last_write == 0);
24603         assert(io.total_read == 0);
24604         assert(io.total_write == 0);
24605         assert(io.total_size == 0);
24606         assert(io.total_size_known == 0);
24607         assert(io.timeout == 250000);
24608 
24609         tmp_rcfile = fopen("test-rcfile.txt", "w");
24610         assert(tmp_rcfile != 0);
24611         fprintf(tmp_rcfile, "screen-width-minus-one: false");
24612         fclose(tmp_rcfile);
24613 
24614         assert(test_parse_rc(out,0));
24615 
24616 #ifdef PRINT_DEBUG
24617         print();
24618 #endif
24619         assert(d.start_time == 0);
24620         assert(d.total_time == 0);
24621         assert(d.current_time == 0);
24622         assert(d.elapsed_time == 0);
24623         assert(d.percent_complete == 0);
24624         assert(d.display_interval == 1);
24625         assert(d.overtime_flag == 0);
24626         assert(d.k == 1024);
24627         assert(d.twiddle == '-');
24628         assert(d.manual_width == 0);
24629         assert(d.screen_width_minus_one == 0);
24630         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24631         assert(d.display_datacount == 1);
24632         assert(d.display_throughput == 1);
24633         assert(d.display_time == 1);
24634         assert(d.display_percent == 1);
24635         assert(d.display_bar == 1);
24636         assert(d.display_summary == 1);
24637         assert(d.display_ansi == 0);
24638         assert(d.twiddle_fg_color == 0);
24639         assert(d.twiddle_bg_color == 0);
24640         assert(d.twiddle_fg_bold == 0);
24641         assert(d.datacount_fg_color == 0);
24642         assert(d.datacount_bg_color == 0);
24643         assert(d.datacount_fg_bold == 0);
24644         assert(d.throughput_label_fg_color == 0);
24645         assert(d.throughput_label_bg_color == 0);
24646         assert(d.throughput_label_fg_bold == 0);
24647         assert(d.throughput_fg_color == 0);
24648         assert(d.throughput_bg_color == 0);
24649         assert(d.throughput_fg_bold == 0);
24650         assert(d.time_label_fg_color == 0);
24651         assert(d.time_label_bg_color == 0);
24652         assert(d.time_label_fg_bold == 0);
24653         assert(d.percent_fg_color == 0);
24654         assert(d.percent_bg_color == 0);
24655         assert(d.percent_fg_bold == 0);
24656         assert(d.barbrace_fg_color == 0);
24657         assert(d.barbrace_bg_color == 0);
24658         assert(d.barbrace_fg_bold == 0);
24659         assert(d.bar_fg_color == 0);
24660         assert(d.bar_bg_color == 0);
24661         assert(d.bar_fg_bold == 0);
24662         assert(io.in == 0);
24663         assert(io.out == 1);
24664         assert(io.in_ready == 0);
24665         assert(io.out_ready == 0);
24666         assert(io.eof_in == 0);
24667         assert(io.eof_out == 0);
24668         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24669         /* assert(io.cbuf == 0x0); */
24670         assert(io.last_read == 0);
24671         assert(io.last_write == 0);
24672         assert(io.total_read == 0);
24673         assert(io.total_write == 0);
24674         assert(io.total_size == 0);
24675         assert(io.total_size_known == 0);
24676         assert(io.timeout == 250000);
24677 
24678         tmp_rcfile = fopen("test-rcfile.txt", "w");
24679         assert(tmp_rcfile != 0);
24680         fprintf(tmp_rcfile, "screen-width-minus-one: true");
24681         fclose(tmp_rcfile);
24682 
24683         assert(test_parse_rc(out,0));
24684 
24685 #ifdef PRINT_DEBUG
24686         print();
24687 #endif
24688         assert(d.start_time == 0);
24689         assert(d.total_time == 0);
24690         assert(d.current_time == 0);
24691         assert(d.elapsed_time == 0);
24692         assert(d.percent_complete == 0);
24693         assert(d.display_interval == 1);
24694         assert(d.overtime_flag == 0);
24695         assert(d.k == 1024);
24696         assert(d.twiddle == '-');
24697         assert(d.manual_width == 0);
24698         assert(d.screen_width_minus_one == 1);
24699         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24700         assert(d.display_datacount == 1);
24701         assert(d.display_throughput == 1);
24702         assert(d.display_time == 1);
24703         assert(d.display_percent == 1);
24704         assert(d.display_bar == 1);
24705         assert(d.display_summary == 1);
24706         assert(d.display_ansi == 0);
24707         assert(d.twiddle_fg_color == 0);
24708         assert(d.twiddle_bg_color == 0);
24709         assert(d.twiddle_fg_bold == 0);
24710         assert(d.datacount_fg_color == 0);
24711         assert(d.datacount_bg_color == 0);
24712         assert(d.datacount_fg_bold == 0);
24713         assert(d.throughput_label_fg_color == 0);
24714         assert(d.throughput_label_bg_color == 0);
24715         assert(d.throughput_label_fg_bold == 0);
24716         assert(d.throughput_fg_color == 0);
24717         assert(d.throughput_bg_color == 0);
24718         assert(d.throughput_fg_bold == 0);
24719         assert(d.time_label_fg_color == 0);
24720         assert(d.time_label_bg_color == 0);
24721         assert(d.time_label_fg_bold == 0);
24722         assert(d.percent_fg_color == 0);
24723         assert(d.percent_bg_color == 0);
24724         assert(d.percent_fg_bold == 0);
24725         assert(d.barbrace_fg_color == 0);
24726         assert(d.barbrace_bg_color == 0);
24727         assert(d.barbrace_fg_bold == 0);
24728         assert(d.bar_fg_color == 0);
24729         assert(d.bar_bg_color == 0);
24730         assert(d.bar_fg_bold == 0);
24731         assert(io.in == 0);
24732         assert(io.out == 1);
24733         assert(io.in_ready == 0);
24734         assert(io.out_ready == 0);
24735         assert(io.eof_in == 0);
24736         assert(io.eof_out == 0);
24737         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24738         /* assert(io.cbuf == 0x0); */
24739         assert(io.last_read == 0);
24740         assert(io.last_write == 0);
24741         assert(io.total_read == 0);
24742         assert(io.total_write == 0);
24743         assert(io.total_size == 0);
24744         assert(io.total_size_known == 0);
24745         assert(io.timeout == 250000);
24746 
24747         tmp_rcfile = fopen("test-rcfile.txt", "w");
24748         assert(tmp_rcfile != 0);
24749         fprintf(tmp_rcfile, "screen-width-minus-one: f");
24750         fclose(tmp_rcfile);
24751 
24752         assert(test_parse_rc(out,0));
24753 
24754 #ifdef PRINT_DEBUG
24755         print();
24756 #endif
24757         assert(d.start_time == 0);
24758         assert(d.total_time == 0);
24759         assert(d.current_time == 0);
24760         assert(d.elapsed_time == 0);
24761         assert(d.percent_complete == 0);
24762         assert(d.display_interval == 1);
24763         assert(d.overtime_flag == 0);
24764         assert(d.k == 1024);
24765         assert(d.twiddle == '-');
24766         assert(d.manual_width == 0);
24767         assert(d.screen_width_minus_one == 0);
24768         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24769         assert(d.display_datacount == 1);
24770         assert(d.display_throughput == 1);
24771         assert(d.display_time == 1);
24772         assert(d.display_percent == 1);
24773         assert(d.display_bar == 1);
24774         assert(d.display_summary == 1);
24775         assert(d.display_ansi == 0);
24776         assert(d.twiddle_fg_color == 0);
24777         assert(d.twiddle_bg_color == 0);
24778         assert(d.twiddle_fg_bold == 0);
24779         assert(d.datacount_fg_color == 0);
24780         assert(d.datacount_bg_color == 0);
24781         assert(d.datacount_fg_bold == 0);
24782         assert(d.throughput_label_fg_color == 0);
24783         assert(d.throughput_label_bg_color == 0);
24784         assert(d.throughput_label_fg_bold == 0);
24785         assert(d.throughput_fg_color == 0);
24786         assert(d.throughput_bg_color == 0);
24787         assert(d.throughput_fg_bold == 0);
24788         assert(d.time_label_fg_color == 0);
24789         assert(d.time_label_bg_color == 0);
24790         assert(d.time_label_fg_bold == 0);
24791         assert(d.percent_fg_color == 0);
24792         assert(d.percent_bg_color == 0);
24793         assert(d.percent_fg_bold == 0);
24794         assert(d.barbrace_fg_color == 0);
24795         assert(d.barbrace_bg_color == 0);
24796         assert(d.barbrace_fg_bold == 0);
24797         assert(d.bar_fg_color == 0);
24798         assert(d.bar_bg_color == 0);
24799         assert(d.bar_fg_bold == 0);
24800         assert(io.in == 0);
24801         assert(io.out == 1);
24802         assert(io.in_ready == 0);
24803         assert(io.out_ready == 0);
24804         assert(io.eof_in == 0);
24805         assert(io.eof_out == 0);
24806         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24807         /* assert(io.cbuf == 0x0); */
24808         assert(io.last_read == 0);
24809         assert(io.last_write == 0);
24810         assert(io.total_read == 0);
24811         assert(io.total_write == 0);
24812         assert(io.total_size == 0);
24813         assert(io.total_size_known == 0);
24814         assert(io.timeout == 250000);
24815 
24816         tmp_rcfile = fopen("test-rcfile.txt", "w");
24817         assert(tmp_rcfile != 0);
24818         fprintf(tmp_rcfile, "screen-width-minus-one: t");
24819         fclose(tmp_rcfile);
24820 
24821         assert(test_parse_rc(out,0));
24822 
24823 #ifdef PRINT_DEBUG
24824         print();
24825 #endif
24826         assert(d.start_time == 0);
24827         assert(d.total_time == 0);
24828         assert(d.current_time == 0);
24829         assert(d.elapsed_time == 0);
24830         assert(d.percent_complete == 0);
24831         assert(d.display_interval == 1);
24832         assert(d.overtime_flag == 0);
24833         assert(d.k == 1024);
24834         assert(d.twiddle == '-');
24835         assert(d.manual_width == 0);
24836         assert(d.screen_width_minus_one == 1);
24837         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24838         assert(d.display_datacount == 1);
24839         assert(d.display_throughput == 1);
24840         assert(d.display_time == 1);
24841         assert(d.display_percent == 1);
24842         assert(d.display_bar == 1);
24843         assert(d.display_summary == 1);
24844         assert(d.display_ansi == 0);
24845         assert(d.twiddle_fg_color == 0);
24846         assert(d.twiddle_bg_color == 0);
24847         assert(d.twiddle_fg_bold == 0);
24848         assert(d.datacount_fg_color == 0);
24849         assert(d.datacount_bg_color == 0);
24850         assert(d.datacount_fg_bold == 0);
24851         assert(d.throughput_label_fg_color == 0);
24852         assert(d.throughput_label_bg_color == 0);
24853         assert(d.throughput_label_fg_bold == 0);
24854         assert(d.throughput_fg_color == 0);
24855         assert(d.throughput_bg_color == 0);
24856         assert(d.throughput_fg_bold == 0);
24857         assert(d.time_label_fg_color == 0);
24858         assert(d.time_label_bg_color == 0);
24859         assert(d.time_label_fg_bold == 0);
24860         assert(d.percent_fg_color == 0);
24861         assert(d.percent_bg_color == 0);
24862         assert(d.percent_fg_bold == 0);
24863         assert(d.barbrace_fg_color == 0);
24864         assert(d.barbrace_bg_color == 0);
24865         assert(d.barbrace_fg_bold == 0);
24866         assert(d.bar_fg_color == 0);
24867         assert(d.bar_bg_color == 0);
24868         assert(d.bar_fg_bold == 0);
24869         assert(io.in == 0);
24870         assert(io.out == 1);
24871         assert(io.in_ready == 0);
24872         assert(io.out_ready == 0);
24873         assert(io.eof_in == 0);
24874         assert(io.eof_out == 0);
24875         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24876         /* assert(io.cbuf == 0x0); */
24877         assert(io.last_read == 0);
24878         assert(io.last_write == 0);
24879         assert(io.total_read == 0);
24880         assert(io.total_write == 0);
24881         assert(io.total_size == 0);
24882         assert(io.total_size_known == 0);
24883         assert(io.timeout == 250000);
24884 
24885         tmp_rcfile = fopen("test-rcfile.txt", "w");
24886         assert(tmp_rcfile != 0);
24887         fprintf(tmp_rcfile, "screen-width-minus-one: 0");
24888         fclose(tmp_rcfile);
24889 
24890         assert(test_parse_rc(out,0));
24891 
24892 #ifdef PRINT_DEBUG
24893         print();
24894 #endif
24895         assert(d.start_time == 0);
24896         assert(d.total_time == 0);
24897         assert(d.current_time == 0);
24898         assert(d.elapsed_time == 0);
24899         assert(d.percent_complete == 0);
24900         assert(d.display_interval == 1);
24901         assert(d.overtime_flag == 0);
24902         assert(d.k == 1024);
24903         assert(d.twiddle == '-');
24904         assert(d.manual_width == 0);
24905         assert(d.screen_width_minus_one == 0);
24906         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24907         assert(d.display_datacount == 1);
24908         assert(d.display_throughput == 1);
24909         assert(d.display_time == 1);
24910         assert(d.display_percent == 1);
24911         assert(d.display_bar == 1);
24912         assert(d.display_summary == 1);
24913         assert(d.display_ansi == 0);
24914         assert(d.twiddle_fg_color == 0);
24915         assert(d.twiddle_bg_color == 0);
24916         assert(d.twiddle_fg_bold == 0);
24917         assert(d.datacount_fg_color == 0);
24918         assert(d.datacount_bg_color == 0);
24919         assert(d.datacount_fg_bold == 0);
24920         assert(d.throughput_label_fg_color == 0);
24921         assert(d.throughput_label_bg_color == 0);
24922         assert(d.throughput_label_fg_bold == 0);
24923         assert(d.throughput_fg_color == 0);
24924         assert(d.throughput_bg_color == 0);
24925         assert(d.throughput_fg_bold == 0);
24926         assert(d.time_label_fg_color == 0);
24927         assert(d.time_label_bg_color == 0);
24928         assert(d.time_label_fg_bold == 0);
24929         assert(d.percent_fg_color == 0);
24930         assert(d.percent_bg_color == 0);
24931         assert(d.percent_fg_bold == 0);
24932         assert(d.barbrace_fg_color == 0);
24933         assert(d.barbrace_bg_color == 0);
24934         assert(d.barbrace_fg_bold == 0);
24935         assert(d.bar_fg_color == 0);
24936         assert(d.bar_bg_color == 0);
24937         assert(d.bar_fg_bold == 0);
24938         assert(io.in == 0);
24939         assert(io.out == 1);
24940         assert(io.in_ready == 0);
24941         assert(io.out_ready == 0);
24942         assert(io.eof_in == 0);
24943         assert(io.eof_out == 0);
24944         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
24945         /* assert(io.cbuf == 0x0); */
24946         assert(io.last_read == 0);
24947         assert(io.last_write == 0);
24948         assert(io.total_read == 0);
24949         assert(io.total_write == 0);
24950         assert(io.total_size == 0);
24951         assert(io.total_size_known == 0);
24952         assert(io.timeout == 250000);
24953 
24954         tmp_rcfile = fopen("test-rcfile.txt", "w");
24955         assert(tmp_rcfile != 0);
24956         fprintf(tmp_rcfile, "screen-width-minus-one: 1");
24957         fclose(tmp_rcfile);
24958 
24959         assert(test_parse_rc(out,0));
24960 
24961 #ifdef PRINT_DEBUG
24962         print();
24963 #endif
24964         assert(d.start_time == 0);
24965         assert(d.total_time == 0);
24966         assert(d.current_time == 0);
24967         assert(d.elapsed_time == 0);
24968         assert(d.percent_complete == 0);
24969         assert(d.display_interval == 1);
24970         assert(d.overtime_flag == 0);
24971         assert(d.k == 1024);
24972         assert(d.twiddle == '-');
24973         assert(d.manual_width == 0);
24974         assert(d.screen_width_minus_one == 1);
24975         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
24976         assert(d.display_datacount == 1);
24977         assert(d.display_throughput == 1);
24978         assert(d.display_time == 1);
24979         assert(d.display_percent == 1);
24980         assert(d.display_bar == 1);
24981         assert(d.display_summary == 1);
24982         assert(d.display_ansi == 0);
24983         assert(d.twiddle_fg_color == 0);
24984         assert(d.twiddle_bg_color == 0);
24985         assert(d.twiddle_fg_bold == 0);
24986         assert(d.datacount_fg_color == 0);
24987         assert(d.datacount_bg_color == 0);
24988         assert(d.datacount_fg_bold == 0);
24989         assert(d.throughput_label_fg_color == 0);
24990         assert(d.throughput_label_bg_color == 0);
24991         assert(d.throughput_label_fg_bold == 0);
24992         assert(d.throughput_fg_color == 0);
24993         assert(d.throughput_bg_color == 0);
24994         assert(d.throughput_fg_bold == 0);
24995         assert(d.time_label_fg_color == 0);
24996         assert(d.time_label_bg_color == 0);
24997         assert(d.time_label_fg_bold == 0);
24998         assert(d.percent_fg_color == 0);
24999         assert(d.percent_bg_color == 0);
25000         assert(d.percent_fg_bold == 0);
25001         assert(d.barbrace_fg_color == 0);
25002         assert(d.barbrace_bg_color == 0);
25003         assert(d.barbrace_fg_bold == 0);
25004         assert(d.bar_fg_color == 0);
25005         assert(d.bar_bg_color == 0);
25006         assert(d.bar_fg_bold == 0);
25007         assert(io.in == 0);
25008         assert(io.out == 1);
25009         assert(io.in_ready == 0);
25010         assert(io.out_ready == 0);
25011         assert(io.eof_in == 0);
25012         assert(io.eof_out == 0);
25013         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25014         /* assert(io.cbuf == 0x0); */
25015         assert(io.last_read == 0);
25016         assert(io.last_write == 0);
25017         assert(io.total_read == 0);
25018         assert(io.total_write == 0);
25019         assert(io.total_size == 0);
25020         assert(io.total_size_known == 0);
25021         assert(io.timeout == 250000);
25022 
25023         tmp_rcfile = fopen("test-rcfile.txt", "w");
25024         assert(tmp_rcfile != 0);
25025         fprintf(tmp_rcfile, "screen-width-minus-one: off");
25026         fclose(tmp_rcfile);
25027 
25028         assert(test_parse_rc(out,0));
25029 
25030 #ifdef PRINT_DEBUG
25031         print();
25032 #endif
25033         assert(d.start_time == 0);
25034         assert(d.total_time == 0);
25035         assert(d.current_time == 0);
25036         assert(d.elapsed_time == 0);
25037         assert(d.percent_complete == 0);
25038         assert(d.display_interval == 1);
25039         assert(d.overtime_flag == 0);
25040         assert(d.k == 1024);
25041         assert(d.twiddle == '-');
25042         assert(d.manual_width == 0);
25043         assert(d.screen_width_minus_one == 0);
25044         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25045         assert(d.display_datacount == 1);
25046         assert(d.display_throughput == 1);
25047         assert(d.display_time == 1);
25048         assert(d.display_percent == 1);
25049         assert(d.display_bar == 1);
25050         assert(d.display_summary == 1);
25051         assert(d.display_ansi == 0);
25052         assert(d.twiddle_fg_color == 0);
25053         assert(d.twiddle_bg_color == 0);
25054         assert(d.twiddle_fg_bold == 0);
25055         assert(d.datacount_fg_color == 0);
25056         assert(d.datacount_bg_color == 0);
25057         assert(d.datacount_fg_bold == 0);
25058         assert(d.throughput_label_fg_color == 0);
25059         assert(d.throughput_label_bg_color == 0);
25060         assert(d.throughput_label_fg_bold == 0);
25061         assert(d.throughput_fg_color == 0);
25062         assert(d.throughput_bg_color == 0);
25063         assert(d.throughput_fg_bold == 0);
25064         assert(d.time_label_fg_color == 0);
25065         assert(d.time_label_bg_color == 0);
25066         assert(d.time_label_fg_bold == 0);
25067         assert(d.percent_fg_color == 0);
25068         assert(d.percent_bg_color == 0);
25069         assert(d.percent_fg_bold == 0);
25070         assert(d.barbrace_fg_color == 0);
25071         assert(d.barbrace_bg_color == 0);
25072         assert(d.barbrace_fg_bold == 0);
25073         assert(d.bar_fg_color == 0);
25074         assert(d.bar_bg_color == 0);
25075         assert(d.bar_fg_bold == 0);
25076         assert(io.in == 0);
25077         assert(io.out == 1);
25078         assert(io.in_ready == 0);
25079         assert(io.out_ready == 0);
25080         assert(io.eof_in == 0);
25081         assert(io.eof_out == 0);
25082         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25083         /* assert(io.cbuf == 0x0); */
25084         assert(io.last_read == 0);
25085         assert(io.last_write == 0);
25086         assert(io.total_read == 0);
25087         assert(io.total_write == 0);
25088         assert(io.total_size == 0);
25089         assert(io.total_size_known == 0);
25090         assert(io.timeout == 250000);
25091 
25092         tmp_rcfile = fopen("test-rcfile.txt", "w");
25093         assert(tmp_rcfile != 0);
25094         fprintf(tmp_rcfile, "screen-width-minus-one: on");
25095         fclose(tmp_rcfile);
25096 
25097         assert(test_parse_rc(out,0));
25098 
25099 #ifdef PRINT_DEBUG
25100         print();
25101 #endif
25102         assert(d.start_time == 0);
25103         assert(d.total_time == 0);
25104         assert(d.current_time == 0);
25105         assert(d.elapsed_time == 0);
25106         assert(d.percent_complete == 0);
25107         assert(d.display_interval == 1);
25108         assert(d.overtime_flag == 0);
25109         assert(d.k == 1024);
25110         assert(d.twiddle == '-');
25111         assert(d.manual_width == 0);
25112         assert(d.screen_width_minus_one == 1);
25113         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25114         assert(d.display_datacount == 1);
25115         assert(d.display_throughput == 1);
25116         assert(d.display_time == 1);
25117         assert(d.display_percent == 1);
25118         assert(d.display_bar == 1);
25119         assert(d.display_summary == 1);
25120         assert(d.display_ansi == 0);
25121         assert(d.twiddle_fg_color == 0);
25122         assert(d.twiddle_bg_color == 0);
25123         assert(d.twiddle_fg_bold == 0);
25124         assert(d.datacount_fg_color == 0);
25125         assert(d.datacount_bg_color == 0);
25126         assert(d.datacount_fg_bold == 0);
25127         assert(d.throughput_label_fg_color == 0);
25128         assert(d.throughput_label_bg_color == 0);
25129         assert(d.throughput_label_fg_bold == 0);
25130         assert(d.throughput_fg_color == 0);
25131         assert(d.throughput_bg_color == 0);
25132         assert(d.throughput_fg_bold == 0);
25133         assert(d.time_label_fg_color == 0);
25134         assert(d.time_label_bg_color == 0);
25135         assert(d.time_label_fg_bold == 0);
25136         assert(d.percent_fg_color == 0);
25137         assert(d.percent_bg_color == 0);
25138         assert(d.percent_fg_bold == 0);
25139         assert(d.barbrace_fg_color == 0);
25140         assert(d.barbrace_bg_color == 0);
25141         assert(d.barbrace_fg_bold == 0);
25142         assert(d.bar_fg_color == 0);
25143         assert(d.bar_bg_color == 0);
25144         assert(d.bar_fg_bold == 0);
25145         assert(io.in == 0);
25146         assert(io.out == 1);
25147         assert(io.in_ready == 0);
25148         assert(io.out_ready == 0);
25149         assert(io.eof_in == 0);
25150         assert(io.eof_out == 0);
25151         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25152         /* assert(io.cbuf == 0x0); */
25153         assert(io.last_read == 0);
25154         assert(io.last_write == 0);
25155         assert(io.total_read == 0);
25156         assert(io.total_write == 0);
25157         assert(io.total_size == 0);
25158         assert(io.total_size_known == 0);
25159         assert(io.timeout == 250000);
25160 
25161         assert(unlink("./test-rcfile.txt") == 0);
25162 }
25163 
25164 void test135(FILE *out)
25165 {
25166         int argc = 0;
25167         char *argv[256] = { 0 };
25168 
25169         argv[argc++] = "ProgramName";
25170         argv[argc++] = "-dan";
25171 
25172         clear_errno();
25173         displayInit();
25174         ioInit();
25175 
25176 #ifdef PRINT_DEBUG
25177         print();
25178 #endif
25179         assert(d.start_time == 0);
25180         assert(d.total_time == 0);
25181         assert(d.current_time == 0);
25182         assert(d.elapsed_time == 0);
25183         assert(d.percent_complete == 0);
25184         assert(d.display_interval == 1);
25185         assert(d.overtime_flag == 0);
25186         assert(d.k == 1024);
25187         assert(d.twiddle == '-');
25188         assert(d.manual_width == 0);
25189         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25190         assert(d.display_datacount == 1);
25191         assert(d.display_throughput == 1);
25192         assert(d.display_time == 1);
25193         assert(d.display_percent == 1);
25194         assert(d.display_bar == 1);
25195         assert(d.display_summary == 1);
25196         assert(d.display_ansi == 0);
25197         assert(d.twiddle_fg_color == 0);
25198         assert(d.twiddle_bg_color == 0);
25199         assert(d.twiddle_fg_bold == 0);
25200         assert(d.datacount_fg_color == 0);
25201         assert(d.datacount_bg_color == 0);
25202         assert(d.datacount_fg_bold == 0);
25203         assert(d.throughput_label_fg_color == 0);
25204         assert(d.throughput_label_bg_color == 0);
25205         assert(d.throughput_label_fg_bold == 0);
25206         assert(d.throughput_fg_color == 0);
25207         assert(d.throughput_bg_color == 0);
25208         assert(d.throughput_fg_bold == 0);
25209         assert(d.time_label_fg_color == 0);
25210         assert(d.time_label_bg_color == 0);
25211         assert(d.time_label_fg_bold == 0);
25212         assert(d.percent_fg_color == 0);
25213         assert(d.percent_bg_color == 0);
25214         assert(d.percent_fg_bold == 0);
25215         assert(d.barbrace_fg_color == 0);
25216         assert(d.barbrace_bg_color == 0);
25217         assert(d.barbrace_fg_bold == 0);
25218         assert(d.bar_fg_color == 0);
25219         assert(d.bar_bg_color == 0);
25220         assert(d.bar_fg_bold == 0);
25221         assert(io.in == 0);
25222         assert(io.out == 1);
25223         assert(io.in_ready == 0);
25224         assert(io.out_ready == 0);
25225         assert(io.eof_in == 0);
25226         assert(io.eof_out == 0);
25227         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25228         /* assert(io.cbuf == 0x0); */
25229         assert(io.last_read == 0);
25230         assert(io.last_write == 0);
25231         assert(io.total_read == 0);
25232         assert(io.total_write == 0);
25233         assert(io.total_size == 0);
25234         assert(io.total_size_known == 0);
25235         assert(io.timeout == 250000);
25236 
25237         assert(parse_args(out, argc, argv) == 0);
25238 
25239 #ifdef PRINT_DEBUG
25240         print();
25241 #endif
25242         assert(d.start_time == 0);
25243         assert(d.total_time == 0);
25244         assert(d.current_time == 0);
25245         assert(d.elapsed_time == 0);
25246         assert(d.percent_complete == 0);
25247         assert(d.display_interval == 1);
25248         assert(d.overtime_flag == 0);
25249         assert(d.k == 1024);
25250         assert(d.twiddle == '-');
25251         assert(d.manual_width == 0);
25252         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25253         assert(d.display_datacount == 1);
25254         assert(d.display_throughput == 1);
25255         assert(d.display_time == 1);
25256         assert(d.display_percent == 1);
25257         assert(d.display_bar == 1);
25258         assert(d.display_summary == 1);
25259         assert(d.display_ansi == 1);
25260         assert(d.twiddle_fg_color == 0);
25261         assert(d.twiddle_bg_color == 0);
25262         assert(d.twiddle_fg_bold == 0);
25263         assert(d.datacount_fg_color == 0);
25264         assert(d.datacount_bg_color == 0);
25265         assert(d.datacount_fg_bold == 0);
25266         assert(d.throughput_label_fg_color == 0);
25267         assert(d.throughput_label_bg_color == 0);
25268         assert(d.throughput_label_fg_bold == 0);
25269         assert(d.throughput_fg_color == 0);
25270         assert(d.throughput_bg_color == 0);
25271         assert(d.throughput_fg_bold == 0);
25272         assert(d.time_label_fg_color == 0);
25273         assert(d.time_label_bg_color == 0);
25274         assert(d.time_label_fg_bold == 0);
25275         assert(d.percent_fg_color == 0);
25276         assert(d.percent_bg_color == 0);
25277         assert(d.percent_fg_bold == 0);
25278         assert(d.barbrace_fg_color == 0);
25279         assert(d.barbrace_bg_color == 0);
25280         assert(d.barbrace_fg_bold == 0);
25281         assert(d.bar_fg_color == 0);
25282         assert(d.bar_bg_color == 0);
25283         assert(d.bar_fg_bold == 0);
25284         assert(io.in == 0);
25285         assert(io.out == 1);
25286         assert(io.in_ready == 0);
25287         assert(io.out_ready == 0);
25288         assert(io.eof_in == 0);
25289         assert(io.eof_out == 0);
25290         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25291         /* assert(io.cbuf == 0x0); */
25292         assert(io.last_read == 0);
25293         assert(io.last_write == 0);
25294         assert(io.total_read == 0);
25295         assert(io.total_write == 0);
25296         assert(io.total_size == 0);
25297         assert(io.total_size_known == 0);
25298         assert(io.timeout == 250000);
25299 }
25300 
25301 void test136(FILE *out)
25302 {
25303         int argc = 0;
25304         char *argv[256] = { 0 };
25305 
25306         argv[argc++] = "ProgramName";
25307         argv[argc++] = "-nan";
25308 
25309         clear_errno();
25310         displayInit();
25311         ioInit();
25312 
25313 #ifdef PRINT_DEBUG
25314         print();
25315 #endif
25316         assert(d.start_time == 0);
25317         assert(d.total_time == 0);
25318         assert(d.current_time == 0);
25319         assert(d.elapsed_time == 0);
25320         assert(d.percent_complete == 0);
25321         assert(d.display_interval == 1);
25322         assert(d.overtime_flag == 0);
25323         assert(d.k == 1024);
25324         assert(d.twiddle == '-');
25325         assert(d.manual_width == 0);
25326         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25327         assert(d.display_datacount == 1);
25328         assert(d.display_throughput == 1);
25329         assert(d.display_time == 1);
25330         assert(d.display_percent == 1);
25331         assert(d.display_bar == 1);
25332         assert(d.display_summary == 1);
25333         assert(d.display_ansi == 0);
25334         assert(d.twiddle_fg_color == 0);
25335         assert(d.twiddle_bg_color == 0);
25336         assert(d.twiddle_fg_bold == 0);
25337         assert(d.datacount_fg_color == 0);
25338         assert(d.datacount_bg_color == 0);
25339         assert(d.datacount_fg_bold == 0);
25340         assert(d.throughput_label_fg_color == 0);
25341         assert(d.throughput_label_bg_color == 0);
25342         assert(d.throughput_label_fg_bold == 0);
25343         assert(d.throughput_fg_color == 0);
25344         assert(d.throughput_bg_color == 0);
25345         assert(d.throughput_fg_bold == 0);
25346         assert(d.time_label_fg_color == 0);
25347         assert(d.time_label_bg_color == 0);
25348         assert(d.time_label_fg_bold == 0);
25349         assert(d.percent_fg_color == 0);
25350         assert(d.percent_bg_color == 0);
25351         assert(d.percent_fg_bold == 0);
25352         assert(d.barbrace_fg_color == 0);
25353         assert(d.barbrace_bg_color == 0);
25354         assert(d.barbrace_fg_bold == 0);
25355         assert(d.bar_fg_color == 0);
25356         assert(d.bar_bg_color == 0);
25357         assert(d.bar_fg_bold == 0);
25358         assert(io.in == 0);
25359         assert(io.out == 1);
25360         assert(io.in_ready == 0);
25361         assert(io.out_ready == 0);
25362         assert(io.eof_in == 0);
25363         assert(io.eof_out == 0);
25364         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25365         /* assert(io.cbuf == 0x0); */
25366         assert(io.last_read == 0);
25367         assert(io.last_write == 0);
25368         assert(io.total_read == 0);
25369         assert(io.total_write == 0);
25370         assert(io.total_size == 0);
25371         assert(io.total_size_known == 0);
25372         assert(io.timeout == 250000);
25373 
25374         d.display_ansi = 1;
25375         assert(parse_args(out, argc, argv) == 0);
25376 
25377 #ifdef PRINT_DEBUG
25378         print();
25379 #endif
25380         assert(d.start_time == 0);
25381         assert(d.total_time == 0);
25382         assert(d.current_time == 0);
25383         assert(d.elapsed_time == 0);
25384         assert(d.percent_complete == 0);
25385         assert(d.display_interval == 1);
25386         assert(d.overtime_flag == 0);
25387         assert(d.k == 1024);
25388         assert(d.twiddle == '-');
25389         assert(d.manual_width == 0);
25390         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25391         assert(d.display_datacount == 1);
25392         assert(d.display_throughput == 1);
25393         assert(d.display_time == 1);
25394         assert(d.display_percent == 1);
25395         assert(d.display_bar == 1);
25396         assert(d.display_summary == 1);
25397         assert(d.display_ansi == 0);
25398         assert(d.twiddle_fg_color == 0);
25399         assert(d.twiddle_bg_color == 0);
25400         assert(d.twiddle_fg_bold == 0);
25401         assert(d.datacount_fg_color == 0);
25402         assert(d.datacount_bg_color == 0);
25403         assert(d.datacount_fg_bold == 0);
25404         assert(d.throughput_label_fg_color == 0);
25405         assert(d.throughput_label_bg_color == 0);
25406         assert(d.throughput_label_fg_bold == 0);
25407         assert(d.throughput_fg_color == 0);
25408         assert(d.throughput_bg_color == 0);
25409         assert(d.throughput_fg_bold == 0);
25410         assert(d.time_label_fg_color == 0);
25411         assert(d.time_label_bg_color == 0);
25412         assert(d.time_label_fg_bold == 0);
25413         assert(d.percent_fg_color == 0);
25414         assert(d.percent_bg_color == 0);
25415         assert(d.percent_fg_bold == 0);
25416         assert(d.barbrace_fg_color == 0);
25417         assert(d.barbrace_bg_color == 0);
25418         assert(d.barbrace_fg_bold == 0);
25419         assert(d.bar_fg_color == 0);
25420         assert(d.bar_bg_color == 0);
25421         assert(d.bar_fg_bold == 0);
25422         assert(io.in == 0);
25423         assert(io.out == 1);
25424         assert(io.in_ready == 0);
25425         assert(io.out_ready == 0);
25426         assert(io.eof_in == 0);
25427         assert(io.eof_out == 0);
25428         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25429         /* assert(io.cbuf == 0x0); */
25430         assert(io.last_read == 0);
25431         assert(io.last_write == 0);
25432         assert(io.total_read == 0);
25433         assert(io.total_write == 0);
25434         assert(io.total_size == 0);
25435         assert(io.total_size_known == 0);
25436         assert(io.timeout == 250000);
25437 }
25438 
25439 void test137(FILE *out)
25440 {
25441         int argc = 0;
25442         char *argv[256] = { 0 };
25443 
25444         argv[argc++] = "ProgramName";
25445         argv[argc++] = "--display-ansi";
25446 
25447         clear_errno();
25448         displayInit();
25449         ioInit();
25450 
25451 #ifdef PRINT_DEBUG
25452         print();
25453 #endif
25454         assert(d.start_time == 0);
25455         assert(d.total_time == 0);
25456         assert(d.current_time == 0);
25457         assert(d.elapsed_time == 0);
25458         assert(d.percent_complete == 0);
25459         assert(d.display_interval == 1);
25460         assert(d.overtime_flag == 0);
25461         assert(d.k == 1024);
25462         assert(d.twiddle == '-');
25463         assert(d.manual_width == 0);
25464         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25465         assert(d.display_datacount == 1);
25466         assert(d.display_throughput == 1);
25467         assert(d.display_time == 1);
25468         assert(d.display_percent == 1);
25469         assert(d.display_bar == 1);
25470         assert(d.display_summary == 1);
25471         assert(d.display_ansi == 0);
25472         assert(d.twiddle_fg_color == 0);
25473         assert(d.twiddle_bg_color == 0);
25474         assert(d.twiddle_fg_bold == 0);
25475         assert(d.datacount_fg_color == 0);
25476         assert(d.datacount_bg_color == 0);
25477         assert(d.datacount_fg_bold == 0);
25478         assert(d.throughput_label_fg_color == 0);
25479         assert(d.throughput_label_bg_color == 0);
25480         assert(d.throughput_label_fg_bold == 0);
25481         assert(d.throughput_fg_color == 0);
25482         assert(d.throughput_bg_color == 0);
25483         assert(d.throughput_fg_bold == 0);
25484         assert(d.time_label_fg_color == 0);
25485         assert(d.time_label_bg_color == 0);
25486         assert(d.time_label_fg_bold == 0);
25487         assert(d.percent_fg_color == 0);
25488         assert(d.percent_bg_color == 0);
25489         assert(d.percent_fg_bold == 0);
25490         assert(d.barbrace_fg_color == 0);
25491         assert(d.barbrace_bg_color == 0);
25492         assert(d.barbrace_fg_bold == 0);
25493         assert(d.bar_fg_color == 0);
25494         assert(d.bar_bg_color == 0);
25495         assert(d.bar_fg_bold == 0);
25496         assert(io.in == 0);
25497         assert(io.out == 1);
25498         assert(io.in_ready == 0);
25499         assert(io.out_ready == 0);
25500         assert(io.eof_in == 0);
25501         assert(io.eof_out == 0);
25502         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25503         /* assert(io.cbuf == 0x0); */
25504         assert(io.last_read == 0);
25505         assert(io.last_write == 0);
25506         assert(io.total_read == 0);
25507         assert(io.total_write == 0);
25508         assert(io.total_size == 0);
25509         assert(io.total_size_known == 0);
25510         assert(io.timeout == 250000);
25511 
25512         assert(parse_args(out, argc, argv) == 0);
25513 
25514 #ifdef PRINT_DEBUG
25515         print();
25516 #endif
25517         assert(d.start_time == 0);
25518         assert(d.total_time == 0);
25519         assert(d.current_time == 0);
25520         assert(d.elapsed_time == 0);
25521         assert(d.percent_complete == 0);
25522         assert(d.display_interval == 1);
25523         assert(d.overtime_flag == 0);
25524         assert(d.k == 1024);
25525         assert(d.twiddle == '-');
25526         assert(d.manual_width == 0);
25527         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25528         assert(d.display_datacount == 1);
25529         assert(d.display_throughput == 1);
25530         assert(d.display_time == 1);
25531         assert(d.display_percent == 1);
25532         assert(d.display_bar == 1);
25533         assert(d.display_summary == 1);
25534         assert(d.display_ansi == 1);
25535         assert(d.twiddle_fg_color == 0);
25536         assert(d.twiddle_bg_color == 0);
25537         assert(d.twiddle_fg_bold == 0);
25538         assert(d.datacount_fg_color == 0);
25539         assert(d.datacount_bg_color == 0);
25540         assert(d.datacount_fg_bold == 0);
25541         assert(d.throughput_label_fg_color == 0);
25542         assert(d.throughput_label_bg_color == 0);
25543         assert(d.throughput_label_fg_bold == 0);
25544         assert(d.throughput_fg_color == 0);
25545         assert(d.throughput_bg_color == 0);
25546         assert(d.throughput_fg_bold == 0);
25547         assert(d.time_label_fg_color == 0);
25548         assert(d.time_label_bg_color == 0);
25549         assert(d.time_label_fg_bold == 0);
25550         assert(d.percent_fg_color == 0);
25551         assert(d.percent_bg_color == 0);
25552         assert(d.percent_fg_bold == 0);
25553         assert(d.barbrace_fg_color == 0);
25554         assert(d.barbrace_bg_color == 0);
25555         assert(d.barbrace_fg_bold == 0);
25556         assert(d.bar_fg_color == 0);
25557         assert(d.bar_bg_color == 0);
25558         assert(d.bar_fg_bold == 0);
25559         assert(io.in == 0);
25560         assert(io.out == 1);
25561         assert(io.in_ready == 0);
25562         assert(io.out_ready == 0);
25563         assert(io.eof_in == 0);
25564         assert(io.eof_out == 0);
25565         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25566         /* assert(io.cbuf == 0x0); */
25567         assert(io.last_read == 0);
25568         assert(io.last_write == 0);
25569         assert(io.total_read == 0);
25570         assert(io.total_write == 0);
25571         assert(io.total_size == 0);
25572         assert(io.total_size_known == 0);
25573         assert(io.timeout == 250000);
25574 }
25575 
25576 void test138(FILE *out)
25577 {
25578         int argc = 0;
25579         char *argv[256] = { 0 };
25580 
25581         argv[argc++] = "ProgramName";
25582         argv[argc++] = "--no-ansi";
25583 
25584         clear_errno();
25585         displayInit();
25586         ioInit();
25587 
25588 #ifdef PRINT_DEBUG
25589         print();
25590 #endif
25591         assert(d.start_time == 0);
25592         assert(d.total_time == 0);
25593         assert(d.current_time == 0);
25594         assert(d.elapsed_time == 0);
25595         assert(d.percent_complete == 0);
25596         assert(d.display_interval == 1);
25597         assert(d.overtime_flag == 0);
25598         assert(d.k == 1024);
25599         assert(d.twiddle == '-');
25600         assert(d.manual_width == 0);
25601         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25602         assert(d.display_datacount == 1);
25603         assert(d.display_throughput == 1);
25604         assert(d.display_time == 1);
25605         assert(d.display_percent == 1);
25606         assert(d.display_bar == 1);
25607         assert(d.display_summary == 1);
25608         assert(d.display_ansi == 0);
25609         assert(d.twiddle_fg_color == 0);
25610         assert(d.twiddle_bg_color == 0);
25611         assert(d.twiddle_fg_bold == 0);
25612         assert(d.datacount_fg_color == 0);
25613         assert(d.datacount_bg_color == 0);
25614         assert(d.datacount_fg_bold == 0);
25615         assert(d.throughput_label_fg_color == 0);
25616         assert(d.throughput_label_bg_color == 0);
25617         assert(d.throughput_label_fg_bold == 0);
25618         assert(d.throughput_fg_color == 0);
25619         assert(d.throughput_bg_color == 0);
25620         assert(d.throughput_fg_bold == 0);
25621         assert(d.time_label_fg_color == 0);
25622         assert(d.time_label_bg_color == 0);
25623         assert(d.time_label_fg_bold == 0);
25624         assert(d.percent_fg_color == 0);
25625         assert(d.percent_bg_color == 0);
25626         assert(d.percent_fg_bold == 0);
25627         assert(d.barbrace_fg_color == 0);
25628         assert(d.barbrace_bg_color == 0);
25629         assert(d.barbrace_fg_bold == 0);
25630         assert(d.bar_fg_color == 0);
25631         assert(d.bar_bg_color == 0);
25632         assert(d.bar_fg_bold == 0);
25633         assert(io.in == 0);
25634         assert(io.out == 1);
25635         assert(io.in_ready == 0);
25636         assert(io.out_ready == 0);
25637         assert(io.eof_in == 0);
25638         assert(io.eof_out == 0);
25639         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25640         /* assert(io.cbuf == 0x0); */
25641         assert(io.last_read == 0);
25642         assert(io.last_write == 0);
25643         assert(io.total_read == 0);
25644         assert(io.total_write == 0);
25645         assert(io.total_size == 0);
25646         assert(io.total_size_known == 0);
25647         assert(io.timeout == 250000);
25648 
25649         d.display_ansi = 1;
25650         assert(parse_args(out, argc, argv) == 0);
25651 
25652 #ifdef PRINT_DEBUG
25653         print();
25654 #endif
25655         assert(d.start_time == 0);
25656         assert(d.total_time == 0);
25657         assert(d.current_time == 0);
25658         assert(d.elapsed_time == 0);
25659         assert(d.percent_complete == 0);
25660         assert(d.display_interval == 1);
25661         assert(d.overtime_flag == 0);
25662         assert(d.k == 1024);
25663         assert(d.twiddle == '-');
25664         assert(d.manual_width == 0);
25665         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25666         assert(d.display_datacount == 1);
25667         assert(d.display_throughput == 1);
25668         assert(d.display_time == 1);
25669         assert(d.display_percent == 1);
25670         assert(d.display_bar == 1);
25671         assert(d.display_summary == 1);
25672         assert(d.display_ansi == 0);
25673         assert(d.twiddle_fg_color == 0);
25674         assert(d.twiddle_bg_color == 0);
25675         assert(d.twiddle_fg_bold == 0);
25676         assert(d.datacount_fg_color == 0);
25677         assert(d.datacount_bg_color == 0);
25678         assert(d.datacount_fg_bold == 0);
25679         assert(d.throughput_label_fg_color == 0);
25680         assert(d.throughput_label_bg_color == 0);
25681         assert(d.throughput_label_fg_bold == 0);
25682         assert(d.throughput_fg_color == 0);
25683         assert(d.throughput_bg_color == 0);
25684         assert(d.throughput_fg_bold == 0);
25685         assert(d.time_label_fg_color == 0);
25686         assert(d.time_label_bg_color == 0);
25687         assert(d.time_label_fg_bold == 0);
25688         assert(d.percent_fg_color == 0);
25689         assert(d.percent_bg_color == 0);
25690         assert(d.percent_fg_bold == 0);
25691         assert(d.barbrace_fg_color == 0);
25692         assert(d.barbrace_bg_color == 0);
25693         assert(d.barbrace_fg_bold == 0);
25694         assert(d.bar_fg_color == 0);
25695         assert(d.bar_bg_color == 0);
25696         assert(d.bar_fg_bold == 0);
25697         assert(io.in == 0);
25698         assert(io.out == 1);
25699         assert(io.in_ready == 0);
25700         assert(io.out_ready == 0);
25701         assert(io.eof_in == 0);
25702         assert(io.eof_out == 0);
25703         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25704         /* assert(io.cbuf == 0x0); */
25705         assert(io.last_read == 0);
25706         assert(io.last_write == 0);
25707         assert(io.total_read == 0);
25708         assert(io.total_write == 0);
25709         assert(io.total_size == 0);
25710         assert(io.total_size_known == 0);
25711         assert(io.timeout == 250000);
25712 }
25713 
25714 void test139(FILE *out)
25715 {
25716         FILE *tmp_rcfile = 0;
25717         
25718         tmp_rcfile = fopen("test-rcfile.txt", "w");
25719         assert(tmp_rcfile != 0);
25720         fprintf(tmp_rcfile, "display-ansi: Sjkhg");
25721         fclose(tmp_rcfile);
25722 
25723         clear_errno();
25724         ioInit();
25725         displayInit();
25726 
25727 #ifdef PRINT_DEBUG
25728         print();
25729 #endif
25730         assert(d.start_time == 0);
25731         assert(d.total_time == 0);
25732         assert(d.current_time == 0);
25733         assert(d.elapsed_time == 0);
25734         assert(d.percent_complete == 0);
25735         assert(d.display_interval == 1);
25736         assert(d.overtime_flag == 0);
25737         assert(d.k == 1024);
25738         assert(d.twiddle == '-');
25739         assert(d.manual_width == 0);
25740         assert(d.screen_width_minus_one == 0);
25741         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25742         assert(d.display_datacount == 1);
25743         assert(d.display_throughput == 1);
25744         assert(d.display_time == 1);
25745         assert(d.display_percent == 1);
25746         assert(d.display_bar == 1);
25747         assert(d.display_summary == 1);
25748         assert(d.display_ansi == 0);
25749         assert(d.twiddle_fg_color == 0);
25750         assert(d.twiddle_bg_color == 0);
25751         assert(d.twiddle_fg_bold == 0);
25752         assert(d.datacount_fg_color == 0);
25753         assert(d.datacount_bg_color == 0);
25754         assert(d.datacount_fg_bold == 0);
25755         assert(d.throughput_label_fg_color == 0);
25756         assert(d.throughput_label_bg_color == 0);
25757         assert(d.throughput_label_fg_bold == 0);
25758         assert(d.throughput_fg_color == 0);
25759         assert(d.throughput_bg_color == 0);
25760         assert(d.throughput_fg_bold == 0);
25761         assert(d.time_label_fg_color == 0);
25762         assert(d.time_label_bg_color == 0);
25763         assert(d.time_label_fg_bold == 0);
25764         assert(d.percent_fg_color == 0);
25765         assert(d.percent_bg_color == 0);
25766         assert(d.percent_fg_bold == 0);
25767         assert(d.barbrace_fg_color == 0);
25768         assert(d.barbrace_bg_color == 0);
25769         assert(d.barbrace_fg_bold == 0);
25770         assert(d.bar_fg_color == 0);
25771         assert(d.bar_bg_color == 0);
25772         assert(d.bar_fg_bold == 0);
25773         assert(io.in == 0);
25774         assert(io.out == 1);
25775         assert(io.in_ready == 0);
25776         assert(io.out_ready == 0);
25777         assert(io.eof_in == 0);
25778         assert(io.eof_out == 0);
25779         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25780         /* assert(io.cbuf == 0x0); */
25781         assert(io.last_read == 0);
25782         assert(io.last_write == 0);
25783         assert(io.total_read == 0);
25784         assert(io.total_write == 0);
25785         assert(io.total_size == 0);
25786         assert(io.total_size_known == 0);
25787         assert(io.timeout == 250000);
25788 
25789         assert(test_parse_rc(out,1));
25790 
25791 #ifdef PRINT_DEBUG
25792         print();
25793 #endif
25794         assert(d.start_time == 0);
25795         assert(d.total_time == 0);
25796         assert(d.current_time == 0);
25797         assert(d.elapsed_time == 0);
25798         assert(d.percent_complete == 0);
25799         assert(d.display_interval == 1);
25800         assert(d.overtime_flag == 0);
25801         assert(d.k == 1024);
25802         assert(d.twiddle == '-');
25803         assert(d.manual_width == 0);
25804         assert(d.screen_width_minus_one == 0);
25805         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25806         assert(d.display_datacount == 1);
25807         assert(d.display_throughput == 1);
25808         assert(d.display_time == 1);
25809         assert(d.display_percent == 1);
25810         assert(d.display_bar == 1);
25811         assert(d.display_summary == 1);
25812         assert(d.display_ansi == 0);
25813         assert(d.twiddle_fg_color == 0);
25814         assert(d.twiddle_bg_color == 0);
25815         assert(d.twiddle_fg_bold == 0);
25816         assert(d.datacount_fg_color == 0);
25817         assert(d.datacount_bg_color == 0);
25818         assert(d.datacount_fg_bold == 0);
25819         assert(d.throughput_label_fg_color == 0);
25820         assert(d.throughput_label_bg_color == 0);
25821         assert(d.throughput_label_fg_bold == 0);
25822         assert(d.throughput_fg_color == 0);
25823         assert(d.throughput_bg_color == 0);
25824         assert(d.throughput_fg_bold == 0);
25825         assert(d.time_label_fg_color == 0);
25826         assert(d.time_label_bg_color == 0);
25827         assert(d.time_label_fg_bold == 0);
25828         assert(d.percent_fg_color == 0);
25829         assert(d.percent_bg_color == 0);
25830         assert(d.percent_fg_bold == 0);
25831         assert(d.barbrace_fg_color == 0);
25832         assert(d.barbrace_bg_color == 0);
25833         assert(d.barbrace_fg_bold == 0);
25834         assert(d.bar_fg_color == 0);
25835         assert(d.bar_bg_color == 0);
25836         assert(d.bar_fg_bold == 0);
25837         assert(io.in == 0);
25838         assert(io.out == 1);
25839         assert(io.in_ready == 0);
25840         assert(io.out_ready == 0);
25841         assert(io.eof_in == 0);
25842         assert(io.eof_out == 0);
25843         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25844         /* assert(io.cbuf == 0x0); */
25845         assert(io.last_read == 0);
25846         assert(io.last_write == 0);
25847         assert(io.total_read == 0);
25848         assert(io.total_write == 0);
25849         assert(io.total_size == 0);
25850         assert(io.total_size_known == 0);
25851         assert(io.timeout == 250000);
25852 
25853         tmp_rcfile = fopen("test-rcfile.txt", "w");
25854         assert(tmp_rcfile != 0);
25855         fprintf(tmp_rcfile, "display-ansi: no");
25856         fclose(tmp_rcfile);
25857 
25858         assert(test_parse_rc(out,0));
25859 
25860 #ifdef PRINT_DEBUG
25861         print();
25862 #endif
25863         assert(d.start_time == 0);
25864         assert(d.total_time == 0);
25865         assert(d.current_time == 0);
25866         assert(d.elapsed_time == 0);
25867         assert(d.percent_complete == 0);
25868         assert(d.display_interval == 1);
25869         assert(d.overtime_flag == 0);
25870         assert(d.k == 1024);
25871         assert(d.twiddle == '-');
25872         assert(d.manual_width == 0);
25873         assert(d.screen_width_minus_one == 0);
25874         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25875         assert(d.display_datacount == 1);
25876         assert(d.display_throughput == 1);
25877         assert(d.display_time == 1);
25878         assert(d.display_percent == 1);
25879         assert(d.display_bar == 1);
25880         assert(d.display_summary == 1);
25881         assert(d.display_ansi == 0);
25882         assert(d.twiddle_fg_color == 0);
25883         assert(d.twiddle_bg_color == 0);
25884         assert(d.twiddle_fg_bold == 0);
25885         assert(d.datacount_fg_color == 0);
25886         assert(d.datacount_bg_color == 0);
25887         assert(d.datacount_fg_bold == 0);
25888         assert(d.throughput_label_fg_color == 0);
25889         assert(d.throughput_label_bg_color == 0);
25890         assert(d.throughput_label_fg_bold == 0);
25891         assert(d.throughput_fg_color == 0);
25892         assert(d.throughput_bg_color == 0);
25893         assert(d.throughput_fg_bold == 0);
25894         assert(d.time_label_fg_color == 0);
25895         assert(d.time_label_bg_color == 0);
25896         assert(d.time_label_fg_bold == 0);
25897         assert(d.percent_fg_color == 0);
25898         assert(d.percent_bg_color == 0);
25899         assert(d.percent_fg_bold == 0);
25900         assert(d.barbrace_fg_color == 0);
25901         assert(d.barbrace_bg_color == 0);
25902         assert(d.barbrace_fg_bold == 0);
25903         assert(d.bar_fg_color == 0);
25904         assert(d.bar_bg_color == 0);
25905         assert(d.bar_fg_bold == 0);
25906         assert(io.in == 0);
25907         assert(io.out == 1);
25908         assert(io.in_ready == 0);
25909         assert(io.out_ready == 0);
25910         assert(io.eof_in == 0);
25911         assert(io.eof_out == 0);
25912         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25913         /* assert(io.cbuf == 0x0); */
25914         assert(io.last_read == 0);
25915         assert(io.last_write == 0);
25916         assert(io.total_read == 0);
25917         assert(io.total_write == 0);
25918         assert(io.total_size == 0);
25919         assert(io.total_size_known == 0);
25920         assert(io.timeout == 250000);
25921 
25922         tmp_rcfile = fopen("test-rcfile.txt", "w");
25923         assert(tmp_rcfile != 0);
25924         fprintf(tmp_rcfile, "display-ansi: yes");
25925         fclose(tmp_rcfile);
25926 
25927         assert(test_parse_rc(out,0));
25928 
25929 #ifdef PRINT_DEBUG
25930         print();
25931 #endif
25932         assert(d.start_time == 0);
25933         assert(d.total_time == 0);
25934         assert(d.current_time == 0);
25935         assert(d.elapsed_time == 0);
25936         assert(d.percent_complete == 0);
25937         assert(d.display_interval == 1);
25938         assert(d.overtime_flag == 0);
25939         assert(d.k == 1024);
25940         assert(d.twiddle == '-');
25941         assert(d.manual_width == 0);
25942         assert(d.screen_width_minus_one == 0);
25943         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
25944         assert(d.display_datacount == 1);
25945         assert(d.display_throughput == 1);
25946         assert(d.display_time == 1);
25947         assert(d.display_percent == 1);
25948         assert(d.display_bar == 1);
25949         assert(d.display_summary == 1);
25950         assert(d.display_ansi == 1);
25951         assert(d.twiddle_fg_color == 0);
25952         assert(d.twiddle_bg_color == 0);
25953         assert(d.twiddle_fg_bold == 0);
25954         assert(d.datacount_fg_color == 0);
25955         assert(d.datacount_bg_color == 0);
25956         assert(d.datacount_fg_bold == 0);
25957         assert(d.throughput_label_fg_color == 0);
25958         assert(d.throughput_label_bg_color == 0);
25959         assert(d.throughput_label_fg_bold == 0);
25960         assert(d.throughput_fg_color == 0);
25961         assert(d.throughput_bg_color == 0);
25962         assert(d.throughput_fg_bold == 0);
25963         assert(d.time_label_fg_color == 0);
25964         assert(d.time_label_bg_color == 0);
25965         assert(d.time_label_fg_bold == 0);
25966         assert(d.percent_fg_color == 0);
25967         assert(d.percent_bg_color == 0);
25968         assert(d.percent_fg_bold == 0);
25969         assert(d.barbrace_fg_color == 0);
25970         assert(d.barbrace_bg_color == 0);
25971         assert(d.barbrace_fg_bold == 0);
25972         assert(d.bar_fg_color == 0);
25973         assert(d.bar_bg_color == 0);
25974         assert(d.bar_fg_bold == 0);
25975         assert(io.in == 0);
25976         assert(io.out == 1);
25977         assert(io.in_ready == 0);
25978         assert(io.out_ready == 0);
25979         assert(io.eof_in == 0);
25980         assert(io.eof_out == 0);
25981         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
25982         /* assert(io.cbuf == 0x0); */
25983         assert(io.last_read == 0);
25984         assert(io.last_write == 0);
25985         assert(io.total_read == 0);
25986         assert(io.total_write == 0);
25987         assert(io.total_size == 0);
25988         assert(io.total_size_known == 0);
25989         assert(io.timeout == 250000);
25990 
25991         tmp_rcfile = fopen("test-rcfile.txt", "w");
25992         assert(tmp_rcfile != 0);
25993         fprintf(tmp_rcfile, "display-ansi: n");
25994         fclose(tmp_rcfile);
25995 
25996         assert(test_parse_rc(out,0));
25997 
25998 #ifdef PRINT_DEBUG
25999         print();
26000 #endif
26001         assert(d.start_time == 0);
26002         assert(d.total_time == 0);
26003         assert(d.current_time == 0);
26004         assert(d.elapsed_time == 0);
26005         assert(d.percent_complete == 0);
26006         assert(d.display_interval == 1);
26007         assert(d.overtime_flag == 0);
26008         assert(d.k == 1024);
26009         assert(d.twiddle == '-');
26010         assert(d.manual_width == 0);
26011         assert(d.screen_width_minus_one == 0);
26012         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26013         assert(d.display_datacount == 1);
26014         assert(d.display_throughput == 1);
26015         assert(d.display_time == 1);
26016         assert(d.display_percent == 1);
26017         assert(d.display_bar == 1);
26018         assert(d.display_summary == 1);
26019         assert(d.display_ansi == 0);
26020         assert(d.twiddle_fg_color == 0);
26021         assert(d.twiddle_bg_color == 0);
26022         assert(d.twiddle_fg_bold == 0);
26023         assert(d.datacount_fg_color == 0);
26024         assert(d.datacount_bg_color == 0);
26025         assert(d.datacount_fg_bold == 0);
26026         assert(d.throughput_label_fg_color == 0);
26027         assert(d.throughput_label_bg_color == 0);
26028         assert(d.throughput_label_fg_bold == 0);
26029         assert(d.throughput_fg_color == 0);
26030         assert(d.throughput_bg_color == 0);
26031         assert(d.throughput_fg_bold == 0);
26032         assert(d.time_label_fg_color == 0);
26033         assert(d.time_label_bg_color == 0);
26034         assert(d.time_label_fg_bold == 0);
26035         assert(d.percent_fg_color == 0);
26036         assert(d.percent_bg_color == 0);
26037         assert(d.percent_fg_bold == 0);
26038         assert(d.barbrace_fg_color == 0);
26039         assert(d.barbrace_bg_color == 0);
26040         assert(d.barbrace_fg_bold == 0);
26041         assert(d.bar_fg_color == 0);
26042         assert(d.bar_bg_color == 0);
26043         assert(d.bar_fg_bold == 0);
26044         assert(io.in == 0);
26045         assert(io.out == 1);
26046         assert(io.in_ready == 0);
26047         assert(io.out_ready == 0);
26048         assert(io.eof_in == 0);
26049         assert(io.eof_out == 0);
26050         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26051         /* assert(io.cbuf == 0x0); */
26052         assert(io.last_read == 0);
26053         assert(io.last_write == 0);
26054         assert(io.total_read == 0);
26055         assert(io.total_write == 0);
26056         assert(io.total_size == 0);
26057         assert(io.total_size_known == 0);
26058         assert(io.timeout == 250000);
26059 
26060         tmp_rcfile = fopen("test-rcfile.txt", "w");
26061         assert(tmp_rcfile != 0);
26062         fprintf(tmp_rcfile, "display-ansi: y");
26063         fclose(tmp_rcfile);
26064 
26065         assert(test_parse_rc(out,0));
26066 
26067 #ifdef PRINT_DEBUG
26068         print();
26069 #endif
26070         assert(d.start_time == 0);
26071         assert(d.total_time == 0);
26072         assert(d.current_time == 0);
26073         assert(d.elapsed_time == 0);
26074         assert(d.percent_complete == 0);
26075         assert(d.display_interval == 1);
26076         assert(d.overtime_flag == 0);
26077         assert(d.k == 1024);
26078         assert(d.twiddle == '-');
26079         assert(d.manual_width == 0);
26080         assert(d.screen_width_minus_one == 0);
26081         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26082         assert(d.display_datacount == 1);
26083         assert(d.display_throughput == 1);
26084         assert(d.display_time == 1);
26085         assert(d.display_percent == 1);
26086         assert(d.display_bar == 1);
26087         assert(d.display_summary == 1);
26088         assert(d.display_ansi == 1);
26089         assert(d.twiddle_fg_color == 0);
26090         assert(d.twiddle_bg_color == 0);
26091         assert(d.twiddle_fg_bold == 0);
26092         assert(d.datacount_fg_color == 0);
26093         assert(d.datacount_bg_color == 0);
26094         assert(d.datacount_fg_bold == 0);
26095         assert(d.throughput_label_fg_color == 0);
26096         assert(d.throughput_label_bg_color == 0);
26097         assert(d.throughput_label_fg_bold == 0);
26098         assert(d.throughput_fg_color == 0);
26099         assert(d.throughput_bg_color == 0);
26100         assert(d.throughput_fg_bold == 0);
26101         assert(d.time_label_fg_color == 0);
26102         assert(d.time_label_bg_color == 0);
26103         assert(d.time_label_fg_bold == 0);
26104         assert(d.percent_fg_color == 0);
26105         assert(d.percent_bg_color == 0);
26106         assert(d.percent_fg_bold == 0);
26107         assert(d.barbrace_fg_color == 0);
26108         assert(d.barbrace_bg_color == 0);
26109         assert(d.barbrace_fg_bold == 0);
26110         assert(d.bar_fg_color == 0);
26111         assert(d.bar_bg_color == 0);
26112         assert(d.bar_fg_bold == 0);
26113         assert(io.in == 0);
26114         assert(io.out == 1);
26115         assert(io.in_ready == 0);
26116         assert(io.out_ready == 0);
26117         assert(io.eof_in == 0);
26118         assert(io.eof_out == 0);
26119         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26120         /* assert(io.cbuf == 0x0); */
26121         assert(io.last_read == 0);
26122         assert(io.last_write == 0);
26123         assert(io.total_read == 0);
26124         assert(io.total_write == 0);
26125         assert(io.total_size == 0);
26126         assert(io.total_size_known == 0);
26127         assert(io.timeout == 250000);
26128 
26129         tmp_rcfile = fopen("test-rcfile.txt", "w");
26130         assert(tmp_rcfile != 0);
26131         fprintf(tmp_rcfile, "display-ansi: false");
26132         fclose(tmp_rcfile);
26133 
26134         assert(test_parse_rc(out,0));
26135 
26136 #ifdef PRINT_DEBUG
26137         print();
26138 #endif
26139         assert(d.start_time == 0);
26140         assert(d.total_time == 0);
26141         assert(d.current_time == 0);
26142         assert(d.elapsed_time == 0);
26143         assert(d.percent_complete == 0);
26144         assert(d.display_interval == 1);
26145         assert(d.overtime_flag == 0);
26146         assert(d.k == 1024);
26147         assert(d.twiddle == '-');
26148         assert(d.manual_width == 0);
26149         assert(d.screen_width_minus_one == 0);
26150         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26151         assert(d.display_datacount == 1);
26152         assert(d.display_throughput == 1);
26153         assert(d.display_time == 1);
26154         assert(d.display_percent == 1);
26155         assert(d.display_bar == 1);
26156         assert(d.display_summary == 1);
26157         assert(d.display_ansi == 0);
26158         assert(d.twiddle_fg_color == 0);
26159         assert(d.twiddle_bg_color == 0);
26160         assert(d.twiddle_fg_bold == 0);
26161         assert(d.datacount_fg_color == 0);
26162         assert(d.datacount_bg_color == 0);
26163         assert(d.datacount_fg_bold == 0);
26164         assert(d.throughput_label_fg_color == 0);
26165         assert(d.throughput_label_bg_color == 0);
26166         assert(d.throughput_label_fg_bold == 0);
26167         assert(d.throughput_fg_color == 0);
26168         assert(d.throughput_bg_color == 0);
26169         assert(d.throughput_fg_bold == 0);
26170         assert(d.time_label_fg_color == 0);
26171         assert(d.time_label_bg_color == 0);
26172         assert(d.time_label_fg_bold == 0);
26173         assert(d.percent_fg_color == 0);
26174         assert(d.percent_bg_color == 0);
26175         assert(d.percent_fg_bold == 0);
26176         assert(d.barbrace_fg_color == 0);
26177         assert(d.barbrace_bg_color == 0);
26178         assert(d.barbrace_fg_bold == 0);
26179         assert(d.bar_fg_color == 0);
26180         assert(d.bar_bg_color == 0);
26181         assert(d.bar_fg_bold == 0);
26182         assert(io.in == 0);
26183         assert(io.out == 1);
26184         assert(io.in_ready == 0);
26185         assert(io.out_ready == 0);
26186         assert(io.eof_in == 0);
26187         assert(io.eof_out == 0);
26188         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26189         /* assert(io.cbuf == 0x0); */
26190         assert(io.last_read == 0);
26191         assert(io.last_write == 0);
26192         assert(io.total_read == 0);
26193         assert(io.total_write == 0);
26194         assert(io.total_size == 0);
26195         assert(io.total_size_known == 0);
26196         assert(io.timeout == 250000);
26197 
26198         tmp_rcfile = fopen("test-rcfile.txt", "w");
26199         assert(tmp_rcfile != 0);
26200         fprintf(tmp_rcfile, "display-ansi: true");
26201         fclose(tmp_rcfile);
26202 
26203         assert(test_parse_rc(out,0));
26204 
26205 #ifdef PRINT_DEBUG
26206         print();
26207 #endif
26208         assert(d.start_time == 0);
26209         assert(d.total_time == 0);
26210         assert(d.current_time == 0);
26211         assert(d.elapsed_time == 0);
26212         assert(d.percent_complete == 0);
26213         assert(d.display_interval == 1);
26214         assert(d.overtime_flag == 0);
26215         assert(d.k == 1024);
26216         assert(d.twiddle == '-');
26217         assert(d.manual_width == 0);
26218         assert(d.screen_width_minus_one == 0);
26219         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26220         assert(d.display_datacount == 1);
26221         assert(d.display_throughput == 1);
26222         assert(d.display_time == 1);
26223         assert(d.display_percent == 1);
26224         assert(d.display_bar == 1);
26225         assert(d.display_summary == 1);
26226         assert(d.display_ansi == 1);
26227         assert(d.twiddle_fg_color == 0);
26228         assert(d.twiddle_bg_color == 0);
26229         assert(d.twiddle_fg_bold == 0);
26230         assert(d.datacount_fg_color == 0);
26231         assert(d.datacount_bg_color == 0);
26232         assert(d.datacount_fg_bold == 0);
26233         assert(d.throughput_label_fg_color == 0);
26234         assert(d.throughput_label_bg_color == 0);
26235         assert(d.throughput_label_fg_bold == 0);
26236         assert(d.throughput_fg_color == 0);
26237         assert(d.throughput_bg_color == 0);
26238         assert(d.throughput_fg_bold == 0);
26239         assert(d.time_label_fg_color == 0);
26240         assert(d.time_label_bg_color == 0);
26241         assert(d.time_label_fg_bold == 0);
26242         assert(d.percent_fg_color == 0);
26243         assert(d.percent_bg_color == 0);
26244         assert(d.percent_fg_bold == 0);
26245         assert(d.barbrace_fg_color == 0);
26246         assert(d.barbrace_bg_color == 0);
26247         assert(d.barbrace_fg_bold == 0);
26248         assert(d.bar_fg_color == 0);
26249         assert(d.bar_bg_color == 0);
26250         assert(d.bar_fg_bold == 0);
26251         assert(io.in == 0);
26252         assert(io.out == 1);
26253         assert(io.in_ready == 0);
26254         assert(io.out_ready == 0);
26255         assert(io.eof_in == 0);
26256         assert(io.eof_out == 0);
26257         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26258         /* assert(io.cbuf == 0x0); */
26259         assert(io.last_read == 0);
26260         assert(io.last_write == 0);
26261         assert(io.total_read == 0);
26262         assert(io.total_write == 0);
26263         assert(io.total_size == 0);
26264         assert(io.total_size_known == 0);
26265         assert(io.timeout == 250000);
26266 
26267         tmp_rcfile = fopen("test-rcfile.txt", "w");
26268         assert(tmp_rcfile != 0);
26269         fprintf(tmp_rcfile, "display-ansi: f");
26270         fclose(tmp_rcfile);
26271 
26272         assert(test_parse_rc(out,0));
26273 
26274 #ifdef PRINT_DEBUG
26275         print();
26276 #endif
26277         assert(d.start_time == 0);
26278         assert(d.total_time == 0);
26279         assert(d.current_time == 0);
26280         assert(d.elapsed_time == 0);
26281         assert(d.percent_complete == 0);
26282         assert(d.display_interval == 1);
26283         assert(d.overtime_flag == 0);
26284         assert(d.k == 1024);
26285         assert(d.twiddle == '-');
26286         assert(d.manual_width == 0);
26287         assert(d.screen_width_minus_one == 0);
26288         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26289         assert(d.display_datacount == 1);
26290         assert(d.display_throughput == 1);
26291         assert(d.display_time == 1);
26292         assert(d.display_percent == 1);
26293         assert(d.display_bar == 1);
26294         assert(d.display_summary == 1);
26295         assert(d.display_ansi == 0);
26296         assert(d.twiddle_fg_color == 0);
26297         assert(d.twiddle_bg_color == 0);
26298         assert(d.twiddle_fg_bold == 0);
26299         assert(d.datacount_fg_color == 0);
26300         assert(d.datacount_bg_color == 0);
26301         assert(d.datacount_fg_bold == 0);
26302         assert(d.throughput_label_fg_color == 0);
26303         assert(d.throughput_label_bg_color == 0);
26304         assert(d.throughput_label_fg_bold == 0);
26305         assert(d.throughput_fg_color == 0);
26306         assert(d.throughput_bg_color == 0);
26307         assert(d.throughput_fg_bold == 0);
26308         assert(d.time_label_fg_color == 0);
26309         assert(d.time_label_bg_color == 0);
26310         assert(d.time_label_fg_bold == 0);
26311         assert(d.percent_fg_color == 0);
26312         assert(d.percent_bg_color == 0);
26313         assert(d.percent_fg_bold == 0);
26314         assert(d.barbrace_fg_color == 0);
26315         assert(d.barbrace_bg_color == 0);
26316         assert(d.barbrace_fg_bold == 0);
26317         assert(d.bar_fg_color == 0);
26318         assert(d.bar_bg_color == 0);
26319         assert(d.bar_fg_bold == 0);
26320         assert(io.in == 0);
26321         assert(io.out == 1);
26322         assert(io.in_ready == 0);
26323         assert(io.out_ready == 0);
26324         assert(io.eof_in == 0);
26325         assert(io.eof_out == 0);
26326         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26327         /* assert(io.cbuf == 0x0); */
26328         assert(io.last_read == 0);
26329         assert(io.last_write == 0);
26330         assert(io.total_read == 0);
26331         assert(io.total_write == 0);
26332         assert(io.total_size == 0);
26333         assert(io.total_size_known == 0);
26334         assert(io.timeout == 250000);
26335 
26336         tmp_rcfile = fopen("test-rcfile.txt", "w");
26337         assert(tmp_rcfile != 0);
26338         fprintf(tmp_rcfile, "display-ansi: t");
26339         fclose(tmp_rcfile);
26340 
26341         assert(test_parse_rc(out,0));
26342 
26343 #ifdef PRINT_DEBUG
26344         print();
26345 #endif
26346         assert(d.start_time == 0);
26347         assert(d.total_time == 0);
26348         assert(d.current_time == 0);
26349         assert(d.elapsed_time == 0);
26350         assert(d.percent_complete == 0);
26351         assert(d.display_interval == 1);
26352         assert(d.overtime_flag == 0);
26353         assert(d.k == 1024);
26354         assert(d.twiddle == '-');
26355         assert(d.manual_width == 0);
26356         assert(d.screen_width_minus_one == 0);
26357         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26358         assert(d.display_datacount == 1);
26359         assert(d.display_throughput == 1);
26360         assert(d.display_time == 1);
26361         assert(d.display_percent == 1);
26362         assert(d.display_bar == 1);
26363         assert(d.display_summary == 1);
26364         assert(d.display_ansi == 1);
26365         assert(d.twiddle_fg_color == 0);
26366         assert(d.twiddle_bg_color == 0);
26367         assert(d.twiddle_fg_bold == 0);
26368         assert(d.datacount_fg_color == 0);
26369         assert(d.datacount_bg_color == 0);
26370         assert(d.datacount_fg_bold == 0);
26371         assert(d.throughput_label_fg_color == 0);
26372         assert(d.throughput_label_bg_color == 0);
26373         assert(d.throughput_label_fg_bold == 0);
26374         assert(d.throughput_fg_color == 0);
26375         assert(d.throughput_bg_color == 0);
26376         assert(d.throughput_fg_bold == 0);
26377         assert(d.time_label_fg_color == 0);
26378         assert(d.time_label_bg_color == 0);
26379         assert(d.time_label_fg_bold == 0);
26380         assert(d.percent_fg_color == 0);
26381         assert(d.percent_bg_color == 0);
26382         assert(d.percent_fg_bold == 0);
26383         assert(d.barbrace_fg_color == 0);
26384         assert(d.barbrace_bg_color == 0);
26385         assert(d.barbrace_fg_bold == 0);
26386         assert(d.bar_fg_color == 0);
26387         assert(d.bar_bg_color == 0);
26388         assert(d.bar_fg_bold == 0);
26389         assert(io.in == 0);
26390         assert(io.out == 1);
26391         assert(io.in_ready == 0);
26392         assert(io.out_ready == 0);
26393         assert(io.eof_in == 0);
26394         assert(io.eof_out == 0);
26395         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26396         /* assert(io.cbuf == 0x0); */
26397         assert(io.last_read == 0);
26398         assert(io.last_write == 0);
26399         assert(io.total_read == 0);
26400         assert(io.total_write == 0);
26401         assert(io.total_size == 0);
26402         assert(io.total_size_known == 0);
26403         assert(io.timeout == 250000);
26404 
26405         tmp_rcfile = fopen("test-rcfile.txt", "w");
26406         assert(tmp_rcfile != 0);
26407         fprintf(tmp_rcfile, "display-ansi: 0");
26408         fclose(tmp_rcfile);
26409 
26410         assert(test_parse_rc(out,0));
26411 
26412 #ifdef PRINT_DEBUG
26413         print();
26414 #endif
26415         assert(d.start_time == 0);
26416         assert(d.total_time == 0);
26417         assert(d.current_time == 0);
26418         assert(d.elapsed_time == 0);
26419         assert(d.percent_complete == 0);
26420         assert(d.display_interval == 1);
26421         assert(d.overtime_flag == 0);
26422         assert(d.k == 1024);
26423         assert(d.twiddle == '-');
26424         assert(d.manual_width == 0);
26425         assert(d.screen_width_minus_one == 0);
26426         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26427         assert(d.display_datacount == 1);
26428         assert(d.display_throughput == 1);
26429         assert(d.display_time == 1);
26430         assert(d.display_percent == 1);
26431         assert(d.display_bar == 1);
26432         assert(d.display_summary == 1);
26433         assert(d.display_ansi == 0);
26434         assert(d.twiddle_fg_color == 0);
26435         assert(d.twiddle_bg_color == 0);
26436         assert(d.twiddle_fg_bold == 0);
26437         assert(d.datacount_fg_color == 0);
26438         assert(d.datacount_bg_color == 0);
26439         assert(d.datacount_fg_bold == 0);
26440         assert(d.throughput_label_fg_color == 0);
26441         assert(d.throughput_label_bg_color == 0);
26442         assert(d.throughput_label_fg_bold == 0);
26443         assert(d.throughput_fg_color == 0);
26444         assert(d.throughput_bg_color == 0);
26445         assert(d.throughput_fg_bold == 0);
26446         assert(d.time_label_fg_color == 0);
26447         assert(d.time_label_bg_color == 0);
26448         assert(d.time_label_fg_bold == 0);
26449         assert(d.percent_fg_color == 0);
26450         assert(d.percent_bg_color == 0);
26451         assert(d.percent_fg_bold == 0);
26452         assert(d.barbrace_fg_color == 0);
26453         assert(d.barbrace_bg_color == 0);
26454         assert(d.barbrace_fg_bold == 0);
26455         assert(d.bar_fg_color == 0);
26456         assert(d.bar_bg_color == 0);
26457         assert(d.bar_fg_bold == 0);
26458         assert(io.in == 0);
26459         assert(io.out == 1);
26460         assert(io.in_ready == 0);
26461         assert(io.out_ready == 0);
26462         assert(io.eof_in == 0);
26463         assert(io.eof_out == 0);
26464         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26465         /* assert(io.cbuf == 0x0); */
26466         assert(io.last_read == 0);
26467         assert(io.last_write == 0);
26468         assert(io.total_read == 0);
26469         assert(io.total_write == 0);
26470         assert(io.total_size == 0);
26471         assert(io.total_size_known == 0);
26472         assert(io.timeout == 250000);
26473 
26474         tmp_rcfile = fopen("test-rcfile.txt", "w");
26475         assert(tmp_rcfile != 0);
26476         fprintf(tmp_rcfile, "display-ansi: 1");
26477         fclose(tmp_rcfile);
26478 
26479         assert(test_parse_rc(out,0));
26480 
26481 #ifdef PRINT_DEBUG
26482         print();
26483 #endif
26484         assert(d.start_time == 0);
26485         assert(d.total_time == 0);
26486         assert(d.current_time == 0);
26487         assert(d.elapsed_time == 0);
26488         assert(d.percent_complete == 0);
26489         assert(d.display_interval == 1);
26490         assert(d.overtime_flag == 0);
26491         assert(d.k == 1024);
26492         assert(d.twiddle == '-');
26493         assert(d.manual_width == 0);
26494         assert(d.screen_width_minus_one == 0);
26495         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26496         assert(d.display_datacount == 1);
26497         assert(d.display_throughput == 1);
26498         assert(d.display_time == 1);
26499         assert(d.display_percent == 1);
26500         assert(d.display_bar == 1);
26501         assert(d.display_summary == 1);
26502         assert(d.display_ansi == 1);
26503         assert(d.twiddle_fg_color == 0);
26504         assert(d.twiddle_bg_color == 0);
26505         assert(d.twiddle_fg_bold == 0);
26506         assert(d.datacount_fg_color == 0);
26507         assert(d.datacount_bg_color == 0);
26508         assert(d.datacount_fg_bold == 0);
26509         assert(d.throughput_label_fg_color == 0);
26510         assert(d.throughput_label_bg_color == 0);
26511         assert(d.throughput_label_fg_bold == 0);
26512         assert(d.throughput_fg_color == 0);
26513         assert(d.throughput_bg_color == 0);
26514         assert(d.throughput_fg_bold == 0);
26515         assert(d.time_label_fg_color == 0);
26516         assert(d.time_label_bg_color == 0);
26517         assert(d.time_label_fg_bold == 0);
26518         assert(d.percent_fg_color == 0);
26519         assert(d.percent_bg_color == 0);
26520         assert(d.percent_fg_bold == 0);
26521         assert(d.barbrace_fg_color == 0);
26522         assert(d.barbrace_bg_color == 0);
26523         assert(d.barbrace_fg_bold == 0);
26524         assert(d.bar_fg_color == 0);
26525         assert(d.bar_bg_color == 0);
26526         assert(d.bar_fg_bold == 0);
26527         assert(io.in == 0);
26528         assert(io.out == 1);
26529         assert(io.in_ready == 0);
26530         assert(io.out_ready == 0);
26531         assert(io.eof_in == 0);
26532         assert(io.eof_out == 0);
26533         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26534         /* assert(io.cbuf == 0x0); */
26535         assert(io.last_read == 0);
26536         assert(io.last_write == 0);
26537         assert(io.total_read == 0);
26538         assert(io.total_write == 0);
26539         assert(io.total_size == 0);
26540         assert(io.total_size_known == 0);
26541         assert(io.timeout == 250000);
26542 
26543         tmp_rcfile = fopen("test-rcfile.txt", "w");
26544         assert(tmp_rcfile != 0);
26545         fprintf(tmp_rcfile, "display-ansi: off");
26546         fclose(tmp_rcfile);
26547 
26548         assert(test_parse_rc(out,0));
26549 
26550 #ifdef PRINT_DEBUG
26551         print();
26552 #endif
26553         assert(d.start_time == 0);
26554         assert(d.total_time == 0);
26555         assert(d.current_time == 0);
26556         assert(d.elapsed_time == 0);
26557         assert(d.percent_complete == 0);
26558         assert(d.display_interval == 1);
26559         assert(d.overtime_flag == 0);
26560         assert(d.k == 1024);
26561         assert(d.twiddle == '-');
26562         assert(d.manual_width == 0);
26563         assert(d.screen_width_minus_one == 0);
26564         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26565         assert(d.display_datacount == 1);
26566         assert(d.display_throughput == 1);
26567         assert(d.display_time == 1);
26568         assert(d.display_percent == 1);
26569         assert(d.display_bar == 1);
26570         assert(d.display_summary == 1);
26571         assert(d.display_ansi == 0);
26572         assert(d.twiddle_fg_color == 0);
26573         assert(d.twiddle_bg_color == 0);
26574         assert(d.twiddle_fg_bold == 0);
26575         assert(d.datacount_fg_color == 0);
26576         assert(d.datacount_bg_color == 0);
26577         assert(d.datacount_fg_bold == 0);
26578         assert(d.throughput_label_fg_color == 0);
26579         assert(d.throughput_label_bg_color == 0);
26580         assert(d.throughput_label_fg_bold == 0);
26581         assert(d.throughput_fg_color == 0);
26582         assert(d.throughput_bg_color == 0);
26583         assert(d.throughput_fg_bold == 0);
26584         assert(d.time_label_fg_color == 0);
26585         assert(d.time_label_bg_color == 0);
26586         assert(d.time_label_fg_bold == 0);
26587         assert(d.percent_fg_color == 0);
26588         assert(d.percent_bg_color == 0);
26589         assert(d.percent_fg_bold == 0);
26590         assert(d.barbrace_fg_color == 0);
26591         assert(d.barbrace_bg_color == 0);
26592         assert(d.barbrace_fg_bold == 0);
26593         assert(d.bar_fg_color == 0);
26594         assert(d.bar_bg_color == 0);
26595         assert(d.bar_fg_bold == 0);
26596         assert(io.in == 0);
26597         assert(io.out == 1);
26598         assert(io.in_ready == 0);
26599         assert(io.out_ready == 0);
26600         assert(io.eof_in == 0);
26601         assert(io.eof_out == 0);
26602         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26603         /* assert(io.cbuf == 0x0); */
26604         assert(io.last_read == 0);
26605         assert(io.last_write == 0);
26606         assert(io.total_read == 0);
26607         assert(io.total_write == 0);
26608         assert(io.total_size == 0);
26609         assert(io.total_size_known == 0);
26610         assert(io.timeout == 250000);
26611 
26612         tmp_rcfile = fopen("test-rcfile.txt", "w");
26613         assert(tmp_rcfile != 0);
26614         fprintf(tmp_rcfile, "display-ansi: on");
26615         fclose(tmp_rcfile);
26616 
26617         assert(test_parse_rc(out,0));
26618 
26619 #ifdef PRINT_DEBUG
26620         print();
26621 #endif
26622         assert(d.start_time == 0);
26623         assert(d.total_time == 0);
26624         assert(d.current_time == 0);
26625         assert(d.elapsed_time == 0);
26626         assert(d.percent_complete == 0);
26627         assert(d.display_interval == 1);
26628         assert(d.overtime_flag == 0);
26629         assert(d.k == 1024);
26630         assert(d.twiddle == '-');
26631         assert(d.manual_width == 0);
26632         assert(d.screen_width_minus_one == 0);
26633         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26634         assert(d.display_datacount == 1);
26635         assert(d.display_throughput == 1);
26636         assert(d.display_time == 1);
26637         assert(d.display_percent == 1);
26638         assert(d.display_bar == 1);
26639         assert(d.display_summary == 1);
26640         assert(d.display_ansi == 1);
26641         assert(d.twiddle_fg_color == 0);
26642         assert(d.twiddle_bg_color == 0);
26643         assert(d.twiddle_fg_bold == 0);
26644         assert(d.datacount_fg_color == 0);
26645         assert(d.datacount_bg_color == 0);
26646         assert(d.datacount_fg_bold == 0);
26647         assert(d.throughput_label_fg_color == 0);
26648         assert(d.throughput_label_bg_color == 0);
26649         assert(d.throughput_label_fg_bold == 0);
26650         assert(d.throughput_fg_color == 0);
26651         assert(d.throughput_bg_color == 0);
26652         assert(d.throughput_fg_bold == 0);
26653         assert(d.time_label_fg_color == 0);
26654         assert(d.time_label_bg_color == 0);
26655         assert(d.time_label_fg_bold == 0);
26656         assert(d.percent_fg_color == 0);
26657         assert(d.percent_bg_color == 0);
26658         assert(d.percent_fg_bold == 0);
26659         assert(d.barbrace_fg_color == 0);
26660         assert(d.barbrace_bg_color == 0);
26661         assert(d.barbrace_fg_bold == 0);
26662         assert(d.bar_fg_color == 0);
26663         assert(d.bar_bg_color == 0);
26664         assert(d.bar_fg_bold == 0);
26665         assert(io.in == 0);
26666         assert(io.out == 1);
26667         assert(io.in_ready == 0);
26668         assert(io.out_ready == 0);
26669         assert(io.eof_in == 0);
26670         assert(io.eof_out == 0);
26671         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26672         /* assert(io.cbuf == 0x0); */
26673         assert(io.last_read == 0);
26674         assert(io.last_write == 0);
26675         assert(io.total_read == 0);
26676         assert(io.total_write == 0);
26677         assert(io.total_size == 0);
26678         assert(io.total_size_known == 0);
26679         assert(io.timeout == 250000);
26680 
26681         assert(unlink("./test-rcfile.txt") == 0);
26682 }
26683 
26684 void test140(FILE *out)
26685 {
26686         int argc = 0;
26687         char *argv[256] = { 0 };
26688         FILE *tmp_rcfile = 0;
26689 
26690         unlink("./test-rcfile.txt");
26691 
26692         for (argc = 0; argc < 256; argc++)
26693                 argv[argc] = 0;
26694         argc = 0;
26695         argv[argc++] = "ProgramName";
26696         argv[argc++] = "-twfg";
26697 
26698         clear_errno();
26699         displayInit();
26700         ioInit();
26701 
26702 #ifdef PRINT_DEBUG
26703         print();
26704 #endif
26705         assert(d.start_time == 0);
26706         assert(d.total_time == 0);
26707         assert(d.current_time == 0);
26708         assert(d.elapsed_time == 0);
26709         assert(d.percent_complete == 0);
26710         assert(d.display_interval == 1);
26711         assert(d.overtime_flag == 0);
26712         assert(d.k == 1024);
26713         assert(d.twiddle == '-');
26714         assert(d.manual_width == 0);
26715         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26716         assert(d.display_datacount == 1);
26717         assert(d.display_throughput == 1);
26718         assert(d.display_time == 1);
26719         assert(d.display_percent == 1);
26720         assert(d.display_bar == 1);
26721         assert(d.display_summary == 1);
26722         assert(d.display_ansi == 0);
26723         assert(d.twiddle_fg_color == 0);
26724         assert(d.twiddle_bg_color == 0);
26725         assert(d.twiddle_fg_bold == 0);
26726         assert(d.datacount_fg_color == 0);
26727         assert(d.datacount_bg_color == 0);
26728         assert(d.datacount_fg_bold == 0);
26729         assert(d.throughput_label_fg_color == 0);
26730         assert(d.throughput_label_bg_color == 0);
26731         assert(d.throughput_label_fg_bold == 0);
26732         assert(d.throughput_fg_color == 0);
26733         assert(d.throughput_bg_color == 0);
26734         assert(d.throughput_fg_bold == 0);
26735         assert(d.time_label_fg_color == 0);
26736         assert(d.time_label_bg_color == 0);
26737         assert(d.time_label_fg_bold == 0);
26738         assert(d.percent_fg_color == 0);
26739         assert(d.percent_bg_color == 0);
26740         assert(d.percent_fg_bold == 0);
26741         assert(d.barbrace_fg_color == 0);
26742         assert(d.barbrace_bg_color == 0);
26743         assert(d.barbrace_fg_bold == 0);
26744         assert(d.bar_fg_color == 0);
26745         assert(d.bar_bg_color == 0);
26746         assert(d.bar_fg_bold == 0);
26747         assert(io.in == 0);
26748         assert(io.out == 1);
26749         assert(io.in_ready == 0);
26750         assert(io.out_ready == 0);
26751         assert(io.eof_in == 0);
26752         assert(io.eof_out == 0);
26753         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26754         /* assert(io.cbuf == 0x0); */
26755         assert(io.last_read == 0);
26756         assert(io.last_write == 0);
26757         assert(io.total_read == 0);
26758         assert(io.total_write == 0);
26759         assert(io.total_size == 0);
26760         assert(io.total_size_known == 0);
26761         assert(io.timeout == 250000);
26762 
26763         assert(parse_args(out, argc, argv) == 0);
26764 
26765 #ifdef PRINT_DEBUG
26766         print();
26767 #endif
26768         assert(d.start_time == 0);
26769         assert(d.total_time == 0);
26770         assert(d.current_time == 0);
26771         assert(d.elapsed_time == 0);
26772         assert(d.percent_complete == 0);
26773         assert(d.display_interval == 1);
26774         assert(d.overtime_flag == 0);
26775         assert(d.k == 1024);
26776         assert(d.twiddle == '-');
26777         assert(d.manual_width == 0);
26778         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26779         assert(d.display_datacount == 1);
26780         assert(d.display_throughput == 1);
26781         assert(d.display_time == 1);
26782         assert(d.display_percent == 1);
26783         assert(d.display_bar == 1);
26784         assert(d.display_summary == 1);
26785         assert(d.display_ansi == 0);
26786         assert(d.twiddle_fg_color == 0);
26787         assert(d.twiddle_bg_color == 0);
26788         assert(d.twiddle_fg_bold == 0);
26789         assert(d.datacount_fg_color == 0);
26790         assert(d.datacount_bg_color == 0);
26791         assert(d.datacount_fg_bold == 0);
26792         assert(d.throughput_label_fg_color == 0);
26793         assert(d.throughput_label_bg_color == 0);
26794         assert(d.throughput_label_fg_bold == 0);
26795         assert(d.throughput_fg_color == 0);
26796         assert(d.throughput_bg_color == 0);
26797         assert(d.throughput_fg_bold == 0);
26798         assert(d.time_label_fg_color == 0);
26799         assert(d.time_label_bg_color == 0);
26800         assert(d.time_label_fg_bold == 0);
26801         assert(d.percent_fg_color == 0);
26802         assert(d.percent_bg_color == 0);
26803         assert(d.percent_fg_bold == 0);
26804         assert(d.barbrace_fg_color == 0);
26805         assert(d.barbrace_bg_color == 0);
26806         assert(d.barbrace_fg_bold == 0);
26807         assert(d.bar_fg_color == 0);
26808         assert(d.bar_bg_color == 0);
26809         assert(d.bar_fg_bold == 0);
26810         assert(io.in == 0);
26811         assert(io.out == 1);
26812         assert(io.in_ready == 0);
26813         assert(io.out_ready == 0);
26814         assert(io.eof_in == 0);
26815         assert(io.eof_out == 0);
26816         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26817         /* assert(io.cbuf == 0x0); */
26818         assert(io.last_read == 0);
26819         assert(io.last_write == 0);
26820         assert(io.total_read == 0);
26821         assert(io.total_write == 0);
26822         assert(io.total_size == 0);
26823         assert(io.total_size_known == 0);
26824         assert(io.timeout == 250000);
26825 
26826         for (argc = 0; argc < 256; argc++)
26827                 argv[argc] = 0;
26828         argc = 0;
26829         argv[argc++] = "ProgramName";
26830         argv[argc++] = "-twfg";
26831         argv[argc++] = "/dev/null";
26832 
26833         assert(parse_args(out, argc, argv) == 0);
26834 
26835 #ifdef PRINT_DEBUG
26836         print();
26837 #endif
26838         assert(d.start_time == 0);
26839         assert(d.total_time == 0);
26840         assert(d.current_time == 0);
26841         assert(d.elapsed_time == 0);
26842         assert(d.percent_complete == 0);
26843         assert(d.display_interval == 1);
26844         assert(d.overtime_flag == 0);
26845         assert(d.k == 1024);
26846         assert(d.twiddle == '-');
26847         assert(d.manual_width == 0);
26848         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26849         assert(d.display_datacount == 1);
26850         assert(d.display_throughput == 1);
26851         assert(d.display_time == 1);
26852         assert(d.display_percent == 1);
26853         assert(d.display_bar == 1);
26854         assert(d.display_summary == 1);
26855         assert(d.display_ansi == 0);
26856         assert(d.twiddle_fg_color == 0);
26857         assert(d.twiddle_bg_color == 0);
26858         assert(d.twiddle_fg_bold == 0);
26859         assert(d.datacount_fg_color == 0);
26860         assert(d.datacount_bg_color == 0);
26861         assert(d.datacount_fg_bold == 0);
26862         assert(d.throughput_label_fg_color == 0);
26863         assert(d.throughput_label_bg_color == 0);
26864         assert(d.throughput_label_fg_bold == 0);
26865         assert(d.throughput_fg_color == 0);
26866         assert(d.throughput_bg_color == 0);
26867         assert(d.throughput_fg_bold == 0);
26868         assert(d.time_label_fg_color == 0);
26869         assert(d.time_label_bg_color == 0);
26870         assert(d.time_label_fg_bold == 0);
26871         assert(d.percent_fg_color == 0);
26872         assert(d.percent_bg_color == 0);
26873         assert(d.percent_fg_bold == 0);
26874         assert(d.barbrace_fg_color == 0);
26875         assert(d.barbrace_bg_color == 0);
26876         assert(d.barbrace_fg_bold == 0);
26877         assert(d.bar_fg_color == 0);
26878         assert(d.bar_bg_color == 0);
26879         assert(d.bar_fg_bold == 0);
26880         assert(io.in == 0);
26881         assert(io.out == 1);
26882         assert(io.in_ready == 0);
26883         assert(io.out_ready == 0);
26884         assert(io.eof_in == 0);
26885         assert(io.eof_out == 0);
26886         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26887         /* assert(io.cbuf == 0x0); */
26888         assert(io.last_read == 0);
26889         assert(io.last_write == 0);
26890         assert(io.total_read == 0);
26891         assert(io.total_write == 0);
26892         assert(io.total_size == 0);
26893         assert(io.total_size_known == 0);
26894         assert(io.timeout == 250000);
26895 
26896         for (argc = 0; argc < 256; argc++)
26897                 argv[argc] = 0;
26898         argc = 0;
26899         argv[argc++] = "ProgramName";
26900         argv[argc++] = "-twfg";
26901         argv[argc++] = "black";
26902 
26903         assert(parse_args(out, argc, argv) == 0);
26904 
26905 #ifdef PRINT_DEBUG
26906         print();
26907 #endif
26908         assert(d.start_time == 0);
26909         assert(d.total_time == 0);
26910         assert(d.current_time == 0);
26911         assert(d.elapsed_time == 0);
26912         assert(d.percent_complete == 0);
26913         assert(d.display_interval == 1);
26914         assert(d.overtime_flag == 0);
26915         assert(d.k == 1024);
26916         assert(d.twiddle == '-');
26917         assert(d.manual_width == 0);
26918         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26919         assert(d.display_datacount == 1);
26920         assert(d.display_throughput == 1);
26921         assert(d.display_time == 1);
26922         assert(d.display_percent == 1);
26923         assert(d.display_bar == 1);
26924         assert(d.display_summary == 1);
26925         assert(d.display_ansi == 0);
26926         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
26927         assert(d.twiddle_bg_color == 0);
26928         assert(d.twiddle_fg_bold == 0);
26929         assert(d.datacount_fg_color == 0);
26930         assert(d.datacount_bg_color == 0);
26931         assert(d.datacount_fg_bold == 0);
26932         assert(d.throughput_label_fg_color == 0);
26933         assert(d.throughput_label_bg_color == 0);
26934         assert(d.throughput_label_fg_bold == 0);
26935         assert(d.throughput_fg_color == 0);
26936         assert(d.throughput_bg_color == 0);
26937         assert(d.throughput_fg_bold == 0);
26938         assert(d.time_label_fg_color == 0);
26939         assert(d.time_label_bg_color == 0);
26940         assert(d.time_label_fg_bold == 0);
26941         assert(d.percent_fg_color == 0);
26942         assert(d.percent_bg_color == 0);
26943         assert(d.percent_fg_bold == 0);
26944         assert(d.barbrace_fg_color == 0);
26945         assert(d.barbrace_bg_color == 0);
26946         assert(d.barbrace_fg_bold == 0);
26947         assert(d.bar_fg_color == 0);
26948         assert(d.bar_bg_color == 0);
26949         assert(d.bar_fg_bold == 0);
26950         assert(io.in == 0);
26951         assert(io.out == 1);
26952         assert(io.in_ready == 0);
26953         assert(io.out_ready == 0);
26954         assert(io.eof_in == 0);
26955         assert(io.eof_out == 0);
26956         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
26957         /* assert(io.cbuf == 0x0); */
26958         assert(io.last_read == 0);
26959         assert(io.last_write == 0);
26960         assert(io.total_read == 0);
26961         assert(io.total_write == 0);
26962         assert(io.total_size == 0);
26963         assert(io.total_size_known == 0);
26964         assert(io.timeout == 250000);
26965 
26966         for (argc = 0; argc < 256; argc++)
26967                 argv[argc] = 0;
26968         argc = 0;
26969         argv[argc++] = "ProgramName";
26970         argv[argc++] = "-twfg";
26971         argv[argc++] = "red";
26972 
26973         assert(parse_args(out, argc, argv) == 0);
26974 
26975 #ifdef PRINT_DEBUG
26976         print();
26977 #endif
26978         assert(d.start_time == 0);
26979         assert(d.total_time == 0);
26980         assert(d.current_time == 0);
26981         assert(d.elapsed_time == 0);
26982         assert(d.percent_complete == 0);
26983         assert(d.display_interval == 1);
26984         assert(d.overtime_flag == 0);
26985         assert(d.k == 1024);
26986         assert(d.twiddle == '-');
26987         assert(d.manual_width == 0);
26988         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
26989         assert(d.display_datacount == 1);
26990         assert(d.display_throughput == 1);
26991         assert(d.display_time == 1);
26992         assert(d.display_percent == 1);
26993         assert(d.display_bar == 1);
26994         assert(d.display_summary == 1);
26995         assert(d.display_ansi == 0);
26996         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
26997         assert(d.twiddle_bg_color == 0);
26998         assert(d.twiddle_fg_bold == 0);
26999         assert(d.datacount_fg_color == 0);
27000         assert(d.datacount_bg_color == 0);
27001         assert(d.datacount_fg_bold == 0);
27002         assert(d.throughput_label_fg_color == 0);
27003         assert(d.throughput_label_bg_color == 0);
27004         assert(d.throughput_label_fg_bold == 0);
27005         assert(d.throughput_fg_color == 0);
27006         assert(d.throughput_bg_color == 0);
27007         assert(d.throughput_fg_bold == 0);
27008         assert(d.time_label_fg_color == 0);
27009         assert(d.time_label_bg_color == 0);
27010         assert(d.time_label_fg_bold == 0);
27011         assert(d.percent_fg_color == 0);
27012         assert(d.percent_bg_color == 0);
27013         assert(d.percent_fg_bold == 0);
27014         assert(d.barbrace_fg_color == 0);
27015         assert(d.barbrace_bg_color == 0);
27016         assert(d.barbrace_fg_bold == 0);
27017         assert(d.bar_fg_color == 0);
27018         assert(d.bar_bg_color == 0);
27019         assert(d.bar_fg_bold == 0);
27020         assert(io.in == 0);
27021         assert(io.out == 1);
27022         assert(io.in_ready == 0);
27023         assert(io.out_ready == 0);
27024         assert(io.eof_in == 0);
27025         assert(io.eof_out == 0);
27026         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27027         /* assert(io.cbuf == 0x0); */
27028         assert(io.last_read == 0);
27029         assert(io.last_write == 0);
27030         assert(io.total_read == 0);
27031         assert(io.total_write == 0);
27032         assert(io.total_size == 0);
27033         assert(io.total_size_known == 0);
27034         assert(io.timeout == 250000);
27035 
27036         for (argc = 0; argc < 256; argc++)
27037                 argv[argc] = 0;
27038         argc = 0;
27039         argv[argc++] = "ProgramName";
27040         argv[argc++] = "-twfg";
27041         argv[argc++] = "green";
27042 
27043         assert(parse_args(out, argc, argv) == 0);
27044 
27045 #ifdef PRINT_DEBUG
27046         print();
27047 #endif
27048         assert(d.start_time == 0);
27049         assert(d.total_time == 0);
27050         assert(d.current_time == 0);
27051         assert(d.elapsed_time == 0);
27052         assert(d.percent_complete == 0);
27053         assert(d.display_interval == 1);
27054         assert(d.overtime_flag == 0);
27055         assert(d.k == 1024);
27056         assert(d.twiddle == '-');
27057         assert(d.manual_width == 0);
27058         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27059         assert(d.display_datacount == 1);
27060         assert(d.display_throughput == 1);
27061         assert(d.display_time == 1);
27062         assert(d.display_percent == 1);
27063         assert(d.display_bar == 1);
27064         assert(d.display_summary == 1);
27065         assert(d.display_ansi == 0);
27066         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
27067         assert(d.twiddle_bg_color == 0);
27068         assert(d.twiddle_fg_bold == 0);
27069         assert(d.datacount_fg_color == 0);
27070         assert(d.datacount_bg_color == 0);
27071         assert(d.datacount_fg_bold == 0);
27072         assert(d.throughput_label_fg_color == 0);
27073         assert(d.throughput_label_bg_color == 0);
27074         assert(d.throughput_label_fg_bold == 0);
27075         assert(d.throughput_fg_color == 0);
27076         assert(d.throughput_bg_color == 0);
27077         assert(d.throughput_fg_bold == 0);
27078         assert(d.time_label_fg_color == 0);
27079         assert(d.time_label_bg_color == 0);
27080         assert(d.time_label_fg_bold == 0);
27081         assert(d.percent_fg_color == 0);
27082         assert(d.percent_bg_color == 0);
27083         assert(d.percent_fg_bold == 0);
27084         assert(d.barbrace_fg_color == 0);
27085         assert(d.barbrace_bg_color == 0);
27086         assert(d.barbrace_fg_bold == 0);
27087         assert(d.bar_fg_color == 0);
27088         assert(d.bar_bg_color == 0);
27089         assert(d.bar_fg_bold == 0);
27090         assert(io.in == 0);
27091         assert(io.out == 1);
27092         assert(io.in_ready == 0);
27093         assert(io.out_ready == 0);
27094         assert(io.eof_in == 0);
27095         assert(io.eof_out == 0);
27096         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27097         /* assert(io.cbuf == 0x0); */
27098         assert(io.last_read == 0);
27099         assert(io.last_write == 0);
27100         assert(io.total_read == 0);
27101         assert(io.total_write == 0);
27102         assert(io.total_size == 0);
27103         assert(io.total_size_known == 0);
27104         assert(io.timeout == 250000);
27105 
27106         for (argc = 0; argc < 256; argc++)
27107                 argv[argc] = 0;
27108         argc = 0;
27109         argv[argc++] = "ProgramName";
27110         argv[argc++] = "-twfg";
27111         argv[argc++] = "yellow";
27112 
27113         assert(parse_args(out, argc, argv) == 0);
27114 
27115 #ifdef PRINT_DEBUG
27116         print();
27117 #endif
27118         assert(d.start_time == 0);
27119         assert(d.total_time == 0);
27120         assert(d.current_time == 0);
27121         assert(d.elapsed_time == 0);
27122         assert(d.percent_complete == 0);
27123         assert(d.display_interval == 1);
27124         assert(d.overtime_flag == 0);
27125         assert(d.k == 1024);
27126         assert(d.twiddle == '-');
27127         assert(d.manual_width == 0);
27128         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27129         assert(d.display_datacount == 1);
27130         assert(d.display_throughput == 1);
27131         assert(d.display_time == 1);
27132         assert(d.display_percent == 1);
27133         assert(d.display_bar == 1);
27134         assert(d.display_summary == 1);
27135         assert(d.display_ansi == 0);
27136         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
27137         assert(d.twiddle_bg_color == 0);
27138         assert(d.twiddle_fg_bold == 0);
27139         assert(d.datacount_fg_color == 0);
27140         assert(d.datacount_bg_color == 0);
27141         assert(d.datacount_fg_bold == 0);
27142         assert(d.throughput_label_fg_color == 0);
27143         assert(d.throughput_label_bg_color == 0);
27144         assert(d.throughput_label_fg_bold == 0);
27145         assert(d.throughput_fg_color == 0);
27146         assert(d.throughput_bg_color == 0);
27147         assert(d.throughput_fg_bold == 0);
27148         assert(d.time_label_fg_color == 0);
27149         assert(d.time_label_bg_color == 0);
27150         assert(d.time_label_fg_bold == 0);
27151         assert(d.percent_fg_color == 0);
27152         assert(d.percent_bg_color == 0);
27153         assert(d.percent_fg_bold == 0);
27154         assert(d.barbrace_fg_color == 0);
27155         assert(d.barbrace_bg_color == 0);
27156         assert(d.barbrace_fg_bold == 0);
27157         assert(d.bar_fg_color == 0);
27158         assert(d.bar_bg_color == 0);
27159         assert(d.bar_fg_bold == 0);
27160         assert(io.in == 0);
27161         assert(io.out == 1);
27162         assert(io.in_ready == 0);
27163         assert(io.out_ready == 0);
27164         assert(io.eof_in == 0);
27165         assert(io.eof_out == 0);
27166         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27167         /* assert(io.cbuf == 0x0); */
27168         assert(io.last_read == 0);
27169         assert(io.last_write == 0);
27170         assert(io.total_read == 0);
27171         assert(io.total_write == 0);
27172         assert(io.total_size == 0);
27173         assert(io.total_size_known == 0);
27174         assert(io.timeout == 250000);
27175 
27176         for (argc = 0; argc < 256; argc++)
27177                 argv[argc] = 0;
27178         argc = 0;
27179         argv[argc++] = "ProgramName";
27180         argv[argc++] = "-twfg";
27181         argv[argc++] = "blue";
27182 
27183         assert(parse_args(out, argc, argv) == 0);
27184 
27185 #ifdef PRINT_DEBUG
27186         print();
27187 #endif
27188         assert(d.start_time == 0);
27189         assert(d.total_time == 0);
27190         assert(d.current_time == 0);
27191         assert(d.elapsed_time == 0);
27192         assert(d.percent_complete == 0);
27193         assert(d.display_interval == 1);
27194         assert(d.overtime_flag == 0);
27195         assert(d.k == 1024);
27196         assert(d.twiddle == '-');
27197         assert(d.manual_width == 0);
27198         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27199         assert(d.display_datacount == 1);
27200         assert(d.display_throughput == 1);
27201         assert(d.display_time == 1);
27202         assert(d.display_percent == 1);
27203         assert(d.display_bar == 1);
27204         assert(d.display_summary == 1);
27205         assert(d.display_ansi == 0);
27206         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
27207         assert(d.twiddle_bg_color == 0);
27208         assert(d.twiddle_fg_bold == 0);
27209         assert(d.datacount_fg_color == 0);
27210         assert(d.datacount_bg_color == 0);
27211         assert(d.datacount_fg_bold == 0);
27212         assert(d.throughput_label_fg_color == 0);
27213         assert(d.throughput_label_bg_color == 0);
27214         assert(d.throughput_label_fg_bold == 0);
27215         assert(d.throughput_fg_color == 0);
27216         assert(d.throughput_bg_color == 0);
27217         assert(d.throughput_fg_bold == 0);
27218         assert(d.time_label_fg_color == 0);
27219         assert(d.time_label_bg_color == 0);
27220         assert(d.time_label_fg_bold == 0);
27221         assert(d.percent_fg_color == 0);
27222         assert(d.percent_bg_color == 0);
27223         assert(d.percent_fg_bold == 0);
27224         assert(d.barbrace_fg_color == 0);
27225         assert(d.barbrace_bg_color == 0);
27226         assert(d.barbrace_fg_bold == 0);
27227         assert(d.bar_fg_color == 0);
27228         assert(d.bar_bg_color == 0);
27229         assert(d.bar_fg_bold == 0);
27230         assert(io.in == 0);
27231         assert(io.out == 1);
27232         assert(io.in_ready == 0);
27233         assert(io.out_ready == 0);
27234         assert(io.eof_in == 0);
27235         assert(io.eof_out == 0);
27236         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27237         /* assert(io.cbuf == 0x0); */
27238         assert(io.last_read == 0);
27239         assert(io.last_write == 0);
27240         assert(io.total_read == 0);
27241         assert(io.total_write == 0);
27242         assert(io.total_size == 0);
27243         assert(io.total_size_known == 0);
27244         assert(io.timeout == 250000);
27245 
27246         for (argc = 0; argc < 256; argc++)
27247                 argv[argc] = 0;
27248         argc = 0;
27249         argv[argc++] = "ProgramName";
27250         argv[argc++] = "-twfg";
27251         argv[argc++] = "magenta";
27252 
27253         assert(parse_args(out, argc, argv) == 0);
27254 
27255 #ifdef PRINT_DEBUG
27256         print();
27257 #endif
27258         assert(d.start_time == 0);
27259         assert(d.total_time == 0);
27260         assert(d.current_time == 0);
27261         assert(d.elapsed_time == 0);
27262         assert(d.percent_complete == 0);
27263         assert(d.display_interval == 1);
27264         assert(d.overtime_flag == 0);
27265         assert(d.k == 1024);
27266         assert(d.twiddle == '-');
27267         assert(d.manual_width == 0);
27268         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27269         assert(d.display_datacount == 1);
27270         assert(d.display_throughput == 1);
27271         assert(d.display_time == 1);
27272         assert(d.display_percent == 1);
27273         assert(d.display_bar == 1);
27274         assert(d.display_summary == 1);
27275         assert(d.display_ansi == 0);
27276         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
27277         assert(d.twiddle_bg_color == 0);
27278         assert(d.twiddle_fg_bold == 0);
27279         assert(d.datacount_fg_color == 0);
27280         assert(d.datacount_bg_color == 0);
27281         assert(d.datacount_fg_bold == 0);
27282         assert(d.throughput_label_fg_color == 0);
27283         assert(d.throughput_label_bg_color == 0);
27284         assert(d.throughput_label_fg_bold == 0);
27285         assert(d.throughput_fg_color == 0);
27286         assert(d.throughput_bg_color == 0);
27287         assert(d.throughput_fg_bold == 0);
27288         assert(d.time_label_fg_color == 0);
27289         assert(d.time_label_bg_color == 0);
27290         assert(d.time_label_fg_bold == 0);
27291         assert(d.percent_fg_color == 0);
27292         assert(d.percent_bg_color == 0);
27293         assert(d.percent_fg_bold == 0);
27294         assert(d.barbrace_fg_color == 0);
27295         assert(d.barbrace_bg_color == 0);
27296         assert(d.barbrace_fg_bold == 0);
27297         assert(d.bar_fg_color == 0);
27298         assert(d.bar_bg_color == 0);
27299         assert(d.bar_fg_bold == 0);
27300         assert(io.in == 0);
27301         assert(io.out == 1);
27302         assert(io.in_ready == 0);
27303         assert(io.out_ready == 0);
27304         assert(io.eof_in == 0);
27305         assert(io.eof_out == 0);
27306         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27307         /* assert(io.cbuf == 0x0); */
27308         assert(io.last_read == 0);
27309         assert(io.last_write == 0);
27310         assert(io.total_read == 0);
27311         assert(io.total_write == 0);
27312         assert(io.total_size == 0);
27313         assert(io.total_size_known == 0);
27314         assert(io.timeout == 250000);
27315 
27316         for (argc = 0; argc < 256; argc++)
27317                 argv[argc] = 0;
27318         argc = 0;
27319         argv[argc++] = "ProgramName";
27320         argv[argc++] = "-twfg";
27321         argv[argc++] = "cyan";
27322 
27323         assert(parse_args(out, argc, argv) == 0);
27324 
27325 #ifdef PRINT_DEBUG
27326         print();
27327 #endif
27328         assert(d.start_time == 0);
27329         assert(d.total_time == 0);
27330         assert(d.current_time == 0);
27331         assert(d.elapsed_time == 0);
27332         assert(d.percent_complete == 0);
27333         assert(d.display_interval == 1);
27334         assert(d.overtime_flag == 0);
27335         assert(d.k == 1024);
27336         assert(d.twiddle == '-');
27337         assert(d.manual_width == 0);
27338         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27339         assert(d.display_datacount == 1);
27340         assert(d.display_throughput == 1);
27341         assert(d.display_time == 1);
27342         assert(d.display_percent == 1);
27343         assert(d.display_bar == 1);
27344         assert(d.display_summary == 1);
27345         assert(d.display_ansi == 0);
27346         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
27347         assert(d.twiddle_bg_color == 0);
27348         assert(d.twiddle_fg_bold == 0);
27349         assert(d.datacount_fg_color == 0);
27350         assert(d.datacount_bg_color == 0);
27351         assert(d.datacount_fg_bold == 0);
27352         assert(d.throughput_label_fg_color == 0);
27353         assert(d.throughput_label_bg_color == 0);
27354         assert(d.throughput_label_fg_bold == 0);
27355         assert(d.throughput_fg_color == 0);
27356         assert(d.throughput_bg_color == 0);
27357         assert(d.throughput_fg_bold == 0);
27358         assert(d.time_label_fg_color == 0);
27359         assert(d.time_label_bg_color == 0);
27360         assert(d.time_label_fg_bold == 0);
27361         assert(d.percent_fg_color == 0);
27362         assert(d.percent_bg_color == 0);
27363         assert(d.percent_fg_bold == 0);
27364         assert(d.barbrace_fg_color == 0);
27365         assert(d.barbrace_bg_color == 0);
27366         assert(d.barbrace_fg_bold == 0);
27367         assert(d.bar_fg_color == 0);
27368         assert(d.bar_bg_color == 0);
27369         assert(d.bar_fg_bold == 0);
27370         assert(io.in == 0);
27371         assert(io.out == 1);
27372         assert(io.in_ready == 0);
27373         assert(io.out_ready == 0);
27374         assert(io.eof_in == 0);
27375         assert(io.eof_out == 0);
27376         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27377         /* assert(io.cbuf == 0x0); */
27378         assert(io.last_read == 0);
27379         assert(io.last_write == 0);
27380         assert(io.total_read == 0);
27381         assert(io.total_write == 0);
27382         assert(io.total_size == 0);
27383         assert(io.total_size_known == 0);
27384         assert(io.timeout == 250000);
27385 
27386         for (argc = 0; argc < 256; argc++)
27387                 argv[argc] = 0;
27388         argc = 0;
27389         argv[argc++] = "ProgramName";
27390         argv[argc++] = "-twfg";
27391         argv[argc++] = "white";
27392 
27393         assert(parse_args(out, argc, argv) == 0);
27394 
27395 #ifdef PRINT_DEBUG
27396         print();
27397 #endif
27398         assert(d.start_time == 0);
27399         assert(d.total_time == 0);
27400         assert(d.current_time == 0);
27401         assert(d.elapsed_time == 0);
27402         assert(d.percent_complete == 0);
27403         assert(d.display_interval == 1);
27404         assert(d.overtime_flag == 0);
27405         assert(d.k == 1024);
27406         assert(d.twiddle == '-');
27407         assert(d.manual_width == 0);
27408         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27409         assert(d.display_datacount == 1);
27410         assert(d.display_throughput == 1);
27411         assert(d.display_time == 1);
27412         assert(d.display_percent == 1);
27413         assert(d.display_bar == 1);
27414         assert(d.display_summary == 1);
27415         assert(d.display_ansi == 0);
27416         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
27417         assert(d.twiddle_bg_color == 0);
27418         assert(d.twiddle_fg_bold == 0);
27419         assert(d.datacount_fg_color == 0);
27420         assert(d.datacount_bg_color == 0);
27421         assert(d.datacount_fg_bold == 0);
27422         assert(d.throughput_label_fg_color == 0);
27423         assert(d.throughput_label_bg_color == 0);
27424         assert(d.throughput_label_fg_bold == 0);
27425         assert(d.throughput_fg_color == 0);
27426         assert(d.throughput_bg_color == 0);
27427         assert(d.throughput_fg_bold == 0);
27428         assert(d.time_label_fg_color == 0);
27429         assert(d.time_label_bg_color == 0);
27430         assert(d.time_label_fg_bold == 0);
27431         assert(d.percent_fg_color == 0);
27432         assert(d.percent_bg_color == 0);
27433         assert(d.percent_fg_bold == 0);
27434         assert(d.barbrace_fg_color == 0);
27435         assert(d.barbrace_bg_color == 0);
27436         assert(d.barbrace_fg_bold == 0);
27437         assert(d.bar_fg_color == 0);
27438         assert(d.bar_bg_color == 0);
27439         assert(d.bar_fg_bold == 0);
27440         assert(io.in == 0);
27441         assert(io.out == 1);
27442         assert(io.in_ready == 0);
27443         assert(io.out_ready == 0);
27444         assert(io.eof_in == 0);
27445         assert(io.eof_out == 0);
27446         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27447         /* assert(io.cbuf == 0x0); */
27448         assert(io.last_read == 0);
27449         assert(io.last_write == 0);
27450         assert(io.total_read == 0);
27451         assert(io.total_write == 0);
27452         assert(io.total_size == 0);
27453         assert(io.total_size_known == 0);
27454         assert(io.timeout == 250000);
27455 
27456         for (argc = 0; argc < 256; argc++)
27457                 argv[argc] = 0;
27458         argc = 0;
27459         argv[argc++] = "ProgramName";
27460         argv[argc++] = "-twfg";
27461         argv[argc++] = "normal";
27462 
27463         assert(parse_args(out, argc, argv) == 0);
27464 
27465 #ifdef PRINT_DEBUG
27466         print();
27467 #endif
27468         assert(d.start_time == 0);
27469         assert(d.total_time == 0);
27470         assert(d.current_time == 0);
27471         assert(d.elapsed_time == 0);
27472         assert(d.percent_complete == 0);
27473         assert(d.display_interval == 1);
27474         assert(d.overtime_flag == 0);
27475         assert(d.k == 1024);
27476         assert(d.twiddle == '-');
27477         assert(d.manual_width == 0);
27478         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27479         assert(d.display_datacount == 1);
27480         assert(d.display_throughput == 1);
27481         assert(d.display_time == 1);
27482         assert(d.display_percent == 1);
27483         assert(d.display_bar == 1);
27484         assert(d.display_summary == 1);
27485         assert(d.display_ansi == 0);
27486         assert(d.twiddle_fg_color == 0);
27487         assert(d.twiddle_bg_color == 0);
27488         assert(d.twiddle_fg_bold == 0);
27489         assert(d.datacount_fg_color == 0);
27490         assert(d.datacount_bg_color == 0);
27491         assert(d.datacount_fg_bold == 0);
27492         assert(d.throughput_label_fg_color == 0);
27493         assert(d.throughput_label_bg_color == 0);
27494         assert(d.throughput_label_fg_bold == 0);
27495         assert(d.throughput_fg_color == 0);
27496         assert(d.throughput_bg_color == 0);
27497         assert(d.throughput_fg_bold == 0);
27498         assert(d.time_label_fg_color == 0);
27499         assert(d.time_label_bg_color == 0);
27500         assert(d.time_label_fg_bold == 0);
27501         assert(d.percent_fg_color == 0);
27502         assert(d.percent_bg_color == 0);
27503         assert(d.percent_fg_bold == 0);
27504         assert(d.barbrace_fg_color == 0);
27505         assert(d.barbrace_bg_color == 0);
27506         assert(d.barbrace_fg_bold == 0);
27507         assert(d.bar_fg_color == 0);
27508         assert(d.bar_bg_color == 0);
27509         assert(d.bar_fg_bold == 0);
27510         assert(io.in == 0);
27511         assert(io.out == 1);
27512         assert(io.in_ready == 0);
27513         assert(io.out_ready == 0);
27514         assert(io.eof_in == 0);
27515         assert(io.eof_out == 0);
27516         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27517         /* assert(io.cbuf == 0x0); */
27518         assert(io.last_read == 0);
27519         assert(io.last_write == 0);
27520         assert(io.total_read == 0);
27521         assert(io.total_write == 0);
27522         assert(io.total_size == 0);
27523         assert(io.total_size_known == 0);
27524         assert(io.timeout == 250000);
27525 
27526         for (argc = 0; argc < 256; argc++)
27527                 argv[argc] = 0;
27528         argc = 0;
27529         argv[argc++] = "ProgramName";
27530         argv[argc++] = "-twbg";
27531 
27532         clear_errno();
27533         displayInit();
27534         ioInit();
27535 
27536 #ifdef PRINT_DEBUG
27537         print();
27538 #endif
27539         assert(d.start_time == 0);
27540         assert(d.total_time == 0);
27541         assert(d.current_time == 0);
27542         assert(d.elapsed_time == 0);
27543         assert(d.percent_complete == 0);
27544         assert(d.display_interval == 1);
27545         assert(d.overtime_flag == 0);
27546         assert(d.k == 1024);
27547         assert(d.twiddle == '-');
27548         assert(d.manual_width == 0);
27549         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27550         assert(d.display_datacount == 1);
27551         assert(d.display_throughput == 1);
27552         assert(d.display_time == 1);
27553         assert(d.display_percent == 1);
27554         assert(d.display_bar == 1);
27555         assert(d.display_summary == 1);
27556         assert(d.display_ansi == 0);
27557         assert(d.twiddle_fg_color == 0);
27558         assert(d.twiddle_bg_color == 0);
27559         assert(d.twiddle_fg_bold == 0);
27560         assert(d.datacount_fg_color == 0);
27561         assert(d.datacount_bg_color == 0);
27562         assert(d.datacount_fg_bold == 0);
27563         assert(d.throughput_label_fg_color == 0);
27564         assert(d.throughput_label_bg_color == 0);
27565         assert(d.throughput_label_fg_bold == 0);
27566         assert(d.throughput_fg_color == 0);
27567         assert(d.throughput_bg_color == 0);
27568         assert(d.throughput_fg_bold == 0);
27569         assert(d.time_label_fg_color == 0);
27570         assert(d.time_label_bg_color == 0);
27571         assert(d.time_label_fg_bold == 0);
27572         assert(d.percent_fg_color == 0);
27573         assert(d.percent_bg_color == 0);
27574         assert(d.percent_fg_bold == 0);
27575         assert(d.barbrace_fg_color == 0);
27576         assert(d.barbrace_bg_color == 0);
27577         assert(d.barbrace_fg_bold == 0);
27578         assert(d.bar_fg_color == 0);
27579         assert(d.bar_bg_color == 0);
27580         assert(d.bar_fg_bold == 0);
27581         assert(io.in == 0);
27582         assert(io.out == 1);
27583         assert(io.in_ready == 0);
27584         assert(io.out_ready == 0);
27585         assert(io.eof_in == 0);
27586         assert(io.eof_out == 0);
27587         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27588         /* assert(io.cbuf == 0x0); */
27589         assert(io.last_read == 0);
27590         assert(io.last_write == 0);
27591         assert(io.total_read == 0);
27592         assert(io.total_write == 0);
27593         assert(io.total_size == 0);
27594         assert(io.total_size_known == 0);
27595         assert(io.timeout == 250000);
27596 
27597         assert(parse_args(out, argc, argv) == 0);
27598 
27599 #ifdef PRINT_DEBUG
27600         print();
27601 #endif
27602         assert(d.start_time == 0);
27603         assert(d.total_time == 0);
27604         assert(d.current_time == 0);
27605         assert(d.elapsed_time == 0);
27606         assert(d.percent_complete == 0);
27607         assert(d.display_interval == 1);
27608         assert(d.overtime_flag == 0);
27609         assert(d.k == 1024);
27610         assert(d.twiddle == '-');
27611         assert(d.manual_width == 0);
27612         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27613         assert(d.display_datacount == 1);
27614         assert(d.display_throughput == 1);
27615         assert(d.display_time == 1);
27616         assert(d.display_percent == 1);
27617         assert(d.display_bar == 1);
27618         assert(d.display_summary == 1);
27619         assert(d.display_ansi == 0);
27620         assert(d.twiddle_fg_color == 0);
27621         assert(d.twiddle_bg_color == 0);
27622         assert(d.twiddle_fg_bold == 0);
27623         assert(d.datacount_fg_color == 0);
27624         assert(d.datacount_bg_color == 0);
27625         assert(d.datacount_fg_bold == 0);
27626         assert(d.throughput_label_fg_color == 0);
27627         assert(d.throughput_label_bg_color == 0);
27628         assert(d.throughput_label_fg_bold == 0);
27629         assert(d.throughput_fg_color == 0);
27630         assert(d.throughput_bg_color == 0);
27631         assert(d.throughput_fg_bold == 0);
27632         assert(d.time_label_fg_color == 0);
27633         assert(d.time_label_bg_color == 0);
27634         assert(d.time_label_fg_bold == 0);
27635         assert(d.percent_fg_color == 0);
27636         assert(d.percent_bg_color == 0);
27637         assert(d.percent_fg_bold == 0);
27638         assert(d.barbrace_fg_color == 0);
27639         assert(d.barbrace_bg_color == 0);
27640         assert(d.barbrace_fg_bold == 0);
27641         assert(d.bar_fg_color == 0);
27642         assert(d.bar_bg_color == 0);
27643         assert(d.bar_fg_bold == 0);
27644         assert(io.in == 0);
27645         assert(io.out == 1);
27646         assert(io.in_ready == 0);
27647         assert(io.out_ready == 0);
27648         assert(io.eof_in == 0);
27649         assert(io.eof_out == 0);
27650         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27651         /* assert(io.cbuf == 0x0); */
27652         assert(io.last_read == 0);
27653         assert(io.last_write == 0);
27654         assert(io.total_read == 0);
27655         assert(io.total_write == 0);
27656         assert(io.total_size == 0);
27657         assert(io.total_size_known == 0);
27658         assert(io.timeout == 250000);
27659 
27660         for (argc = 0; argc < 256; argc++)
27661                 argv[argc] = 0;
27662         argc = 0;
27663         argv[argc++] = "ProgramName";
27664         argv[argc++] = "-twbg";
27665         argv[argc++] = "/dev/null";
27666 
27667         assert(parse_args(out, argc, argv) == 0);
27668 
27669 #ifdef PRINT_DEBUG
27670         print();
27671 #endif
27672         assert(d.start_time == 0);
27673         assert(d.total_time == 0);
27674         assert(d.current_time == 0);
27675         assert(d.elapsed_time == 0);
27676         assert(d.percent_complete == 0);
27677         assert(d.display_interval == 1);
27678         assert(d.overtime_flag == 0);
27679         assert(d.k == 1024);
27680         assert(d.twiddle == '-');
27681         assert(d.manual_width == 0);
27682         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27683         assert(d.display_datacount == 1);
27684         assert(d.display_throughput == 1);
27685         assert(d.display_time == 1);
27686         assert(d.display_percent == 1);
27687         assert(d.display_bar == 1);
27688         assert(d.display_summary == 1);
27689         assert(d.display_ansi == 0);
27690         assert(d.twiddle_fg_color == 0);
27691         assert(d.twiddle_bg_color == 0);
27692         assert(d.twiddle_fg_bold == 0);
27693         assert(d.datacount_fg_color == 0);
27694         assert(d.datacount_bg_color == 0);
27695         assert(d.datacount_fg_bold == 0);
27696         assert(d.throughput_label_fg_color == 0);
27697         assert(d.throughput_label_bg_color == 0);
27698         assert(d.throughput_label_fg_bold == 0);
27699         assert(d.throughput_fg_color == 0);
27700         assert(d.throughput_bg_color == 0);
27701         assert(d.throughput_fg_bold == 0);
27702         assert(d.time_label_fg_color == 0);
27703         assert(d.time_label_bg_color == 0);
27704         assert(d.time_label_fg_bold == 0);
27705         assert(d.percent_fg_color == 0);
27706         assert(d.percent_bg_color == 0);
27707         assert(d.percent_fg_bold == 0);
27708         assert(d.barbrace_fg_color == 0);
27709         assert(d.barbrace_bg_color == 0);
27710         assert(d.barbrace_fg_bold == 0);
27711         assert(d.bar_fg_color == 0);
27712         assert(d.bar_bg_color == 0);
27713         assert(d.bar_fg_bold == 0);
27714         assert(io.in == 0);
27715         assert(io.out == 1);
27716         assert(io.in_ready == 0);
27717         assert(io.out_ready == 0);
27718         assert(io.eof_in == 0);
27719         assert(io.eof_out == 0);
27720         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27721         /* assert(io.cbuf == 0x0); */
27722         assert(io.last_read == 0);
27723         assert(io.last_write == 0);
27724         assert(io.total_read == 0);
27725         assert(io.total_write == 0);
27726         assert(io.total_size == 0);
27727         assert(io.total_size_known == 0);
27728         assert(io.timeout == 250000);
27729 
27730         for (argc = 0; argc < 256; argc++)
27731                 argv[argc] = 0;
27732         argc = 0;
27733         argv[argc++] = "ProgramName";
27734         argv[argc++] = "-twbg";
27735         argv[argc++] = "black";
27736 
27737         assert(parse_args(out, argc, argv) == 0);
27738 
27739 #ifdef PRINT_DEBUG
27740         print();
27741 #endif
27742         assert(d.start_time == 0);
27743         assert(d.total_time == 0);
27744         assert(d.current_time == 0);
27745         assert(d.elapsed_time == 0);
27746         assert(d.percent_complete == 0);
27747         assert(d.display_interval == 1);
27748         assert(d.overtime_flag == 0);
27749         assert(d.k == 1024);
27750         assert(d.twiddle == '-');
27751         assert(d.manual_width == 0);
27752         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27753         assert(d.display_datacount == 1);
27754         assert(d.display_throughput == 1);
27755         assert(d.display_time == 1);
27756         assert(d.display_percent == 1);
27757         assert(d.display_bar == 1);
27758         assert(d.display_summary == 1);
27759         assert(d.display_ansi == 0);
27760         assert(d.twiddle_fg_color == 0);
27761         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
27762         assert(d.twiddle_fg_bold == 0);
27763         assert(d.datacount_fg_color == 0);
27764         assert(d.datacount_bg_color == 0);
27765         assert(d.datacount_fg_bold == 0);
27766         assert(d.throughput_label_fg_color == 0);
27767         assert(d.throughput_label_bg_color == 0);
27768         assert(d.throughput_label_fg_bold == 0);
27769         assert(d.throughput_fg_color == 0);
27770         assert(d.throughput_bg_color == 0);
27771         assert(d.throughput_fg_bold == 0);
27772         assert(d.time_label_fg_color == 0);
27773         assert(d.time_label_bg_color == 0);
27774         assert(d.time_label_fg_bold == 0);
27775         assert(d.percent_fg_color == 0);
27776         assert(d.percent_bg_color == 0);
27777         assert(d.percent_fg_bold == 0);
27778         assert(d.barbrace_fg_color == 0);
27779         assert(d.barbrace_bg_color == 0);
27780         assert(d.barbrace_fg_bold == 0);
27781         assert(d.bar_fg_color == 0);
27782         assert(d.bar_bg_color == 0);
27783         assert(d.bar_fg_bold == 0);
27784         assert(io.in == 0);
27785         assert(io.out == 1);
27786         assert(io.in_ready == 0);
27787         assert(io.out_ready == 0);
27788         assert(io.eof_in == 0);
27789         assert(io.eof_out == 0);
27790         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27791         /* assert(io.cbuf == 0x0); */
27792         assert(io.last_read == 0);
27793         assert(io.last_write == 0);
27794         assert(io.total_read == 0);
27795         assert(io.total_write == 0);
27796         assert(io.total_size == 0);
27797         assert(io.total_size_known == 0);
27798         assert(io.timeout == 250000);
27799 
27800         for (argc = 0; argc < 256; argc++)
27801                 argv[argc] = 0;
27802         argc = 0;
27803         argv[argc++] = "ProgramName";
27804         argv[argc++] = "-twbg";
27805         argv[argc++] = "red";
27806 
27807         assert(parse_args(out, argc, argv) == 0);
27808 
27809 #ifdef PRINT_DEBUG
27810         print();
27811 #endif
27812         assert(d.start_time == 0);
27813         assert(d.total_time == 0);
27814         assert(d.current_time == 0);
27815         assert(d.elapsed_time == 0);
27816         assert(d.percent_complete == 0);
27817         assert(d.display_interval == 1);
27818         assert(d.overtime_flag == 0);
27819         assert(d.k == 1024);
27820         assert(d.twiddle == '-');
27821         assert(d.manual_width == 0);
27822         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27823         assert(d.display_datacount == 1);
27824         assert(d.display_throughput == 1);
27825         assert(d.display_time == 1);
27826         assert(d.display_percent == 1);
27827         assert(d.display_bar == 1);
27828         assert(d.display_summary == 1);
27829         assert(d.display_ansi == 0);
27830         assert(d.twiddle_fg_color == 0);
27831         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
27832         assert(d.twiddle_fg_bold == 0);
27833         assert(d.datacount_fg_color == 0);
27834         assert(d.datacount_bg_color == 0);
27835         assert(d.datacount_fg_bold == 0);
27836         assert(d.throughput_label_fg_color == 0);
27837         assert(d.throughput_label_bg_color == 0);
27838         assert(d.throughput_label_fg_bold == 0);
27839         assert(d.throughput_fg_color == 0);
27840         assert(d.throughput_bg_color == 0);
27841         assert(d.throughput_fg_bold == 0);
27842         assert(d.time_label_fg_color == 0);
27843         assert(d.time_label_bg_color == 0);
27844         assert(d.time_label_fg_bold == 0);
27845         assert(d.percent_fg_color == 0);
27846         assert(d.percent_bg_color == 0);
27847         assert(d.percent_fg_bold == 0);
27848         assert(d.barbrace_fg_color == 0);
27849         assert(d.barbrace_bg_color == 0);
27850         assert(d.barbrace_fg_bold == 0);
27851         assert(d.bar_fg_color == 0);
27852         assert(d.bar_bg_color == 0);
27853         assert(d.bar_fg_bold == 0);
27854         assert(io.in == 0);
27855         assert(io.out == 1);
27856         assert(io.in_ready == 0);
27857         assert(io.out_ready == 0);
27858         assert(io.eof_in == 0);
27859         assert(io.eof_out == 0);
27860         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27861         /* assert(io.cbuf == 0x0); */
27862         assert(io.last_read == 0);
27863         assert(io.last_write == 0);
27864         assert(io.total_read == 0);
27865         assert(io.total_write == 0);
27866         assert(io.total_size == 0);
27867         assert(io.total_size_known == 0);
27868         assert(io.timeout == 250000);
27869 
27870         for (argc = 0; argc < 256; argc++)
27871                 argv[argc] = 0;
27872         argc = 0;
27873         argv[argc++] = "ProgramName";
27874         argv[argc++] = "-twbg";
27875         argv[argc++] = "green";
27876 
27877         assert(parse_args(out, argc, argv) == 0);
27878 
27879 #ifdef PRINT_DEBUG
27880         print();
27881 #endif
27882         assert(d.start_time == 0);
27883         assert(d.total_time == 0);
27884         assert(d.current_time == 0);
27885         assert(d.elapsed_time == 0);
27886         assert(d.percent_complete == 0);
27887         assert(d.display_interval == 1);
27888         assert(d.overtime_flag == 0);
27889         assert(d.k == 1024);
27890         assert(d.twiddle == '-');
27891         assert(d.manual_width == 0);
27892         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27893         assert(d.display_datacount == 1);
27894         assert(d.display_throughput == 1);
27895         assert(d.display_time == 1);
27896         assert(d.display_percent == 1);
27897         assert(d.display_bar == 1);
27898         assert(d.display_summary == 1);
27899         assert(d.display_ansi == 0);
27900         assert(d.twiddle_fg_color == 0);
27901         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
27902         assert(d.twiddle_fg_bold == 0);
27903         assert(d.datacount_fg_color == 0);
27904         assert(d.datacount_bg_color == 0);
27905         assert(d.datacount_fg_bold == 0);
27906         assert(d.throughput_label_fg_color == 0);
27907         assert(d.throughput_label_bg_color == 0);
27908         assert(d.throughput_label_fg_bold == 0);
27909         assert(d.throughput_fg_color == 0);
27910         assert(d.throughput_bg_color == 0);
27911         assert(d.throughput_fg_bold == 0);
27912         assert(d.time_label_fg_color == 0);
27913         assert(d.time_label_bg_color == 0);
27914         assert(d.time_label_fg_bold == 0);
27915         assert(d.percent_fg_color == 0);
27916         assert(d.percent_bg_color == 0);
27917         assert(d.percent_fg_bold == 0);
27918         assert(d.barbrace_fg_color == 0);
27919         assert(d.barbrace_bg_color == 0);
27920         assert(d.barbrace_fg_bold == 0);
27921         assert(d.bar_fg_color == 0);
27922         assert(d.bar_bg_color == 0);
27923         assert(d.bar_fg_bold == 0);
27924         assert(io.in == 0);
27925         assert(io.out == 1);
27926         assert(io.in_ready == 0);
27927         assert(io.out_ready == 0);
27928         assert(io.eof_in == 0);
27929         assert(io.eof_out == 0);
27930         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
27931         /* assert(io.cbuf == 0x0); */
27932         assert(io.last_read == 0);
27933         assert(io.last_write == 0);
27934         assert(io.total_read == 0);
27935         assert(io.total_write == 0);
27936         assert(io.total_size == 0);
27937         assert(io.total_size_known == 0);
27938         assert(io.timeout == 250000);
27939 
27940         for (argc = 0; argc < 256; argc++)
27941                 argv[argc] = 0;
27942         argc = 0;
27943         argv[argc++] = "ProgramName";
27944         argv[argc++] = "-twbg";
27945         argv[argc++] = "yellow";
27946 
27947         assert(parse_args(out, argc, argv) == 0);
27948 
27949 #ifdef PRINT_DEBUG
27950         print();
27951 #endif
27952         assert(d.start_time == 0);
27953         assert(d.total_time == 0);
27954         assert(d.current_time == 0);
27955         assert(d.elapsed_time == 0);
27956         assert(d.percent_complete == 0);
27957         assert(d.display_interval == 1);
27958         assert(d.overtime_flag == 0);
27959         assert(d.k == 1024);
27960         assert(d.twiddle == '-');
27961         assert(d.manual_width == 0);
27962         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
27963         assert(d.display_datacount == 1);
27964         assert(d.display_throughput == 1);
27965         assert(d.display_time == 1);
27966         assert(d.display_percent == 1);
27967         assert(d.display_bar == 1);
27968         assert(d.display_summary == 1);
27969         assert(d.display_ansi == 0);
27970         assert(d.twiddle_fg_color == 0);
27971         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
27972         assert(d.twiddle_fg_bold == 0);
27973         assert(d.datacount_fg_color == 0);
27974         assert(d.datacount_bg_color == 0);
27975         assert(d.datacount_fg_bold == 0);
27976         assert(d.throughput_label_fg_color == 0);
27977         assert(d.throughput_label_bg_color == 0);
27978         assert(d.throughput_label_fg_bold == 0);
27979         assert(d.throughput_fg_color == 0);
27980         assert(d.throughput_bg_color == 0);
27981         assert(d.throughput_fg_bold == 0);
27982         assert(d.time_label_fg_color == 0);
27983         assert(d.time_label_bg_color == 0);
27984         assert(d.time_label_fg_bold == 0);
27985         assert(d.percent_fg_color == 0);
27986         assert(d.percent_bg_color == 0);
27987         assert(d.percent_fg_bold == 0);
27988         assert(d.barbrace_fg_color == 0);
27989         assert(d.barbrace_bg_color == 0);
27990         assert(d.barbrace_fg_bold == 0);
27991         assert(d.bar_fg_color == 0);
27992         assert(d.bar_bg_color == 0);
27993         assert(d.bar_fg_bold == 0);
27994         assert(io.in == 0);
27995         assert(io.out == 1);
27996         assert(io.in_ready == 0);
27997         assert(io.out_ready == 0);
27998         assert(io.eof_in == 0);
27999         assert(io.eof_out == 0);
28000         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28001         /* assert(io.cbuf == 0x0); */
28002         assert(io.last_read == 0);
28003         assert(io.last_write == 0);
28004         assert(io.total_read == 0);
28005         assert(io.total_write == 0);
28006         assert(io.total_size == 0);
28007         assert(io.total_size_known == 0);
28008         assert(io.timeout == 250000);
28009 
28010         for (argc = 0; argc < 256; argc++)
28011                 argv[argc] = 0;
28012         argc = 0;
28013         argv[argc++] = "ProgramName";
28014         argv[argc++] = "-twbg";
28015         argv[argc++] = "blue";
28016 
28017         assert(parse_args(out, argc, argv) == 0);
28018 
28019 #ifdef PRINT_DEBUG
28020         print();
28021 #endif
28022         assert(d.start_time == 0);
28023         assert(d.total_time == 0);
28024         assert(d.current_time == 0);
28025         assert(d.elapsed_time == 0);
28026         assert(d.percent_complete == 0);
28027         assert(d.display_interval == 1);
28028         assert(d.overtime_flag == 0);
28029         assert(d.k == 1024);
28030         assert(d.twiddle == '-');
28031         assert(d.manual_width == 0);
28032         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28033         assert(d.display_datacount == 1);
28034         assert(d.display_throughput == 1);
28035         assert(d.display_time == 1);
28036         assert(d.display_percent == 1);
28037         assert(d.display_bar == 1);
28038         assert(d.display_summary == 1);
28039         assert(d.display_ansi == 0);
28040         assert(d.twiddle_fg_color == 0);
28041         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
28042         assert(d.twiddle_fg_bold == 0);
28043         assert(d.datacount_fg_color == 0);
28044         assert(d.datacount_bg_color == 0);
28045         assert(d.datacount_fg_bold == 0);
28046         assert(d.throughput_label_fg_color == 0);
28047         assert(d.throughput_label_bg_color == 0);
28048         assert(d.throughput_label_fg_bold == 0);
28049         assert(d.throughput_fg_color == 0);
28050         assert(d.throughput_bg_color == 0);
28051         assert(d.throughput_fg_bold == 0);
28052         assert(d.time_label_fg_color == 0);
28053         assert(d.time_label_bg_color == 0);
28054         assert(d.time_label_fg_bold == 0);
28055         assert(d.percent_fg_color == 0);
28056         assert(d.percent_bg_color == 0);
28057         assert(d.percent_fg_bold == 0);
28058         assert(d.barbrace_fg_color == 0);
28059         assert(d.barbrace_bg_color == 0);
28060         assert(d.barbrace_fg_bold == 0);
28061         assert(d.bar_fg_color == 0);
28062         assert(d.bar_bg_color == 0);
28063         assert(d.bar_fg_bold == 0);
28064         assert(io.in == 0);
28065         assert(io.out == 1);
28066         assert(io.in_ready == 0);
28067         assert(io.out_ready == 0);
28068         assert(io.eof_in == 0);
28069         assert(io.eof_out == 0);
28070         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28071         /* assert(io.cbuf == 0x0); */
28072         assert(io.last_read == 0);
28073         assert(io.last_write == 0);
28074         assert(io.total_read == 0);
28075         assert(io.total_write == 0);
28076         assert(io.total_size == 0);
28077         assert(io.total_size_known == 0);
28078         assert(io.timeout == 250000);
28079 
28080         for (argc = 0; argc < 256; argc++)
28081                 argv[argc] = 0;
28082         argc = 0;
28083         argv[argc++] = "ProgramName";
28084         argv[argc++] = "-twbg";
28085         argv[argc++] = "magenta";
28086 
28087         assert(parse_args(out, argc, argv) == 0);
28088 
28089 #ifdef PRINT_DEBUG
28090         print();
28091 #endif
28092         assert(d.start_time == 0);
28093         assert(d.total_time == 0);
28094         assert(d.current_time == 0);
28095         assert(d.elapsed_time == 0);
28096         assert(d.percent_complete == 0);
28097         assert(d.display_interval == 1);
28098         assert(d.overtime_flag == 0);
28099         assert(d.k == 1024);
28100         assert(d.twiddle == '-');
28101         assert(d.manual_width == 0);
28102         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28103         assert(d.display_datacount == 1);
28104         assert(d.display_throughput == 1);
28105         assert(d.display_time == 1);
28106         assert(d.display_percent == 1);
28107         assert(d.display_bar == 1);
28108         assert(d.display_summary == 1);
28109         assert(d.display_ansi == 0);
28110         assert(d.twiddle_fg_color == 0);
28111         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
28112         assert(d.twiddle_fg_bold == 0);
28113         assert(d.datacount_fg_color == 0);
28114         assert(d.datacount_bg_color == 0);
28115         assert(d.datacount_fg_bold == 0);
28116         assert(d.throughput_label_fg_color == 0);
28117         assert(d.throughput_label_bg_color == 0);
28118         assert(d.throughput_label_fg_bold == 0);
28119         assert(d.throughput_fg_color == 0);
28120         assert(d.throughput_bg_color == 0);
28121         assert(d.throughput_fg_bold == 0);
28122         assert(d.time_label_fg_color == 0);
28123         assert(d.time_label_bg_color == 0);
28124         assert(d.time_label_fg_bold == 0);
28125         assert(d.percent_fg_color == 0);
28126         assert(d.percent_bg_color == 0);
28127         assert(d.percent_fg_bold == 0);
28128         assert(d.barbrace_fg_color == 0);
28129         assert(d.barbrace_bg_color == 0);
28130         assert(d.barbrace_fg_bold == 0);
28131         assert(d.bar_fg_color == 0);
28132         assert(d.bar_bg_color == 0);
28133         assert(d.bar_fg_bold == 0);
28134         assert(io.in == 0);
28135         assert(io.out == 1);
28136         assert(io.in_ready == 0);
28137         assert(io.out_ready == 0);
28138         assert(io.eof_in == 0);
28139         assert(io.eof_out == 0);
28140         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28141         /* assert(io.cbuf == 0x0); */
28142         assert(io.last_read == 0);
28143         assert(io.last_write == 0);
28144         assert(io.total_read == 0);
28145         assert(io.total_write == 0);
28146         assert(io.total_size == 0);
28147         assert(io.total_size_known == 0);
28148         assert(io.timeout == 250000);
28149 
28150         for (argc = 0; argc < 256; argc++)
28151                 argv[argc] = 0;
28152         argc = 0;
28153         argv[argc++] = "ProgramName";
28154         argv[argc++] = "-twbg";
28155         argv[argc++] = "cyan";
28156 
28157         assert(parse_args(out, argc, argv) == 0);
28158 
28159 #ifdef PRINT_DEBUG
28160         print();
28161 #endif
28162         assert(d.start_time == 0);
28163         assert(d.total_time == 0);
28164         assert(d.current_time == 0);
28165         assert(d.elapsed_time == 0);
28166         assert(d.percent_complete == 0);
28167         assert(d.display_interval == 1);
28168         assert(d.overtime_flag == 0);
28169         assert(d.k == 1024);
28170         assert(d.twiddle == '-');
28171         assert(d.manual_width == 0);
28172         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28173         assert(d.display_datacount == 1);
28174         assert(d.display_throughput == 1);
28175         assert(d.display_time == 1);
28176         assert(d.display_percent == 1);
28177         assert(d.display_bar == 1);
28178         assert(d.display_summary == 1);
28179         assert(d.display_ansi == 0);
28180         assert(d.twiddle_fg_color == 0);
28181         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
28182         assert(d.twiddle_fg_bold == 0);
28183         assert(d.datacount_fg_color == 0);
28184         assert(d.datacount_bg_color == 0);
28185         assert(d.datacount_fg_bold == 0);
28186         assert(d.throughput_label_fg_color == 0);
28187         assert(d.throughput_label_bg_color == 0);
28188         assert(d.throughput_label_fg_bold == 0);
28189         assert(d.throughput_fg_color == 0);
28190         assert(d.throughput_bg_color == 0);
28191         assert(d.throughput_fg_bold == 0);
28192         assert(d.time_label_fg_color == 0);
28193         assert(d.time_label_bg_color == 0);
28194         assert(d.time_label_fg_bold == 0);
28195         assert(d.percent_fg_color == 0);
28196         assert(d.percent_bg_color == 0);
28197         assert(d.percent_fg_bold == 0);
28198         assert(d.barbrace_fg_color == 0);
28199         assert(d.barbrace_bg_color == 0);
28200         assert(d.barbrace_fg_bold == 0);
28201         assert(d.bar_fg_color == 0);
28202         assert(d.bar_bg_color == 0);
28203         assert(d.bar_fg_bold == 0);
28204         assert(io.in == 0);
28205         assert(io.out == 1);
28206         assert(io.in_ready == 0);
28207         assert(io.out_ready == 0);
28208         assert(io.eof_in == 0);
28209         assert(io.eof_out == 0);
28210         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28211         /* assert(io.cbuf == 0x0); */
28212         assert(io.last_read == 0);
28213         assert(io.last_write == 0);
28214         assert(io.total_read == 0);
28215         assert(io.total_write == 0);
28216         assert(io.total_size == 0);
28217         assert(io.total_size_known == 0);
28218         assert(io.timeout == 250000);
28219 
28220         for (argc = 0; argc < 256; argc++)
28221                 argv[argc] = 0;
28222         argc = 0;
28223         argv[argc++] = "ProgramName";
28224         argv[argc++] = "-twbg";
28225         argv[argc++] = "white";
28226 
28227         assert(parse_args(out, argc, argv) == 0);
28228 
28229 #ifdef PRINT_DEBUG
28230         print();
28231 #endif
28232         assert(d.start_time == 0);
28233         assert(d.total_time == 0);
28234         assert(d.current_time == 0);
28235         assert(d.elapsed_time == 0);
28236         assert(d.percent_complete == 0);
28237         assert(d.display_interval == 1);
28238         assert(d.overtime_flag == 0);
28239         assert(d.k == 1024);
28240         assert(d.twiddle == '-');
28241         assert(d.manual_width == 0);
28242         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28243         assert(d.display_datacount == 1);
28244         assert(d.display_throughput == 1);
28245         assert(d.display_time == 1);
28246         assert(d.display_percent == 1);
28247         assert(d.display_bar == 1);
28248         assert(d.display_summary == 1);
28249         assert(d.display_ansi == 0);
28250         assert(d.twiddle_fg_color == 0);
28251         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
28252         assert(d.twiddle_fg_bold == 0);
28253         assert(d.datacount_fg_color == 0);
28254         assert(d.datacount_bg_color == 0);
28255         assert(d.datacount_fg_bold == 0);
28256         assert(d.throughput_label_fg_color == 0);
28257         assert(d.throughput_label_bg_color == 0);
28258         assert(d.throughput_label_fg_bold == 0);
28259         assert(d.throughput_fg_color == 0);
28260         assert(d.throughput_bg_color == 0);
28261         assert(d.throughput_fg_bold == 0);
28262         assert(d.time_label_fg_color == 0);
28263         assert(d.time_label_bg_color == 0);
28264         assert(d.time_label_fg_bold == 0);
28265         assert(d.percent_fg_color == 0);
28266         assert(d.percent_bg_color == 0);
28267         assert(d.percent_fg_bold == 0);
28268         assert(d.barbrace_fg_color == 0);
28269         assert(d.barbrace_bg_color == 0);
28270         assert(d.barbrace_fg_bold == 0);
28271         assert(d.bar_fg_color == 0);
28272         assert(d.bar_bg_color == 0);
28273         assert(d.bar_fg_bold == 0);
28274         assert(io.in == 0);
28275         assert(io.out == 1);
28276         assert(io.in_ready == 0);
28277         assert(io.out_ready == 0);
28278         assert(io.eof_in == 0);
28279         assert(io.eof_out == 0);
28280         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28281         /* assert(io.cbuf == 0x0); */
28282         assert(io.last_read == 0);
28283         assert(io.last_write == 0);
28284         assert(io.total_read == 0);
28285         assert(io.total_write == 0);
28286         assert(io.total_size == 0);
28287         assert(io.total_size_known == 0);
28288         assert(io.timeout == 250000);
28289 
28290         for (argc = 0; argc < 256; argc++)
28291                 argv[argc] = 0;
28292         argc = 0;
28293         argv[argc++] = "ProgramName";
28294         argv[argc++] = "-twbg";
28295         argv[argc++] = "normal";
28296 
28297         assert(parse_args(out, argc, argv) == 0);
28298 
28299 #ifdef PRINT_DEBUG
28300         print();
28301 #endif
28302         assert(d.start_time == 0);
28303         assert(d.total_time == 0);
28304         assert(d.current_time == 0);
28305         assert(d.elapsed_time == 0);
28306         assert(d.percent_complete == 0);
28307         assert(d.display_interval == 1);
28308         assert(d.overtime_flag == 0);
28309         assert(d.k == 1024);
28310         assert(d.twiddle == '-');
28311         assert(d.manual_width == 0);
28312         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28313         assert(d.display_datacount == 1);
28314         assert(d.display_throughput == 1);
28315         assert(d.display_time == 1);
28316         assert(d.display_percent == 1);
28317         assert(d.display_bar == 1);
28318         assert(d.display_summary == 1);
28319         assert(d.display_ansi == 0);
28320         assert(d.twiddle_fg_color == 0);
28321         assert(d.twiddle_bg_color == 0);
28322         assert(d.twiddle_fg_bold == 0);
28323         assert(d.datacount_fg_color == 0);
28324         assert(d.datacount_bg_color == 0);
28325         assert(d.datacount_fg_bold == 0);
28326         assert(d.throughput_label_fg_color == 0);
28327         assert(d.throughput_label_bg_color == 0);
28328         assert(d.throughput_label_fg_bold == 0);
28329         assert(d.throughput_fg_color == 0);
28330         assert(d.throughput_bg_color == 0);
28331         assert(d.throughput_fg_bold == 0);
28332         assert(d.time_label_fg_color == 0);
28333         assert(d.time_label_bg_color == 0);
28334         assert(d.time_label_fg_bold == 0);
28335         assert(d.percent_fg_color == 0);
28336         assert(d.percent_bg_color == 0);
28337         assert(d.percent_fg_bold == 0);
28338         assert(d.barbrace_fg_color == 0);
28339         assert(d.barbrace_bg_color == 0);
28340         assert(d.barbrace_fg_bold == 0);
28341         assert(d.bar_fg_color == 0);
28342         assert(d.bar_bg_color == 0);
28343         assert(d.bar_fg_bold == 0);
28344         assert(io.in == 0);
28345         assert(io.out == 1);
28346         assert(io.in_ready == 0);
28347         assert(io.out_ready == 0);
28348         assert(io.eof_in == 0);
28349         assert(io.eof_out == 0);
28350         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28351         /* assert(io.cbuf == 0x0); */
28352         assert(io.last_read == 0);
28353         assert(io.last_write == 0);
28354         assert(io.total_read == 0);
28355         assert(io.total_write == 0);
28356         assert(io.total_size == 0);
28357         assert(io.total_size_known == 0);
28358         assert(io.timeout == 250000);
28359 
28360         for (argc = 0; argc < 256; argc++)
28361                 argv[argc] = 0;
28362         argc = 0;
28363         argv[argc++] = "ProgramName";
28364         argv[argc++] = "-twb";
28365 
28366         assert(parse_args(out, argc, argv) == 0);
28367 
28368 #ifdef PRINT_DEBUG
28369         print();
28370 #endif
28371         assert(d.start_time == 0);
28372         assert(d.total_time == 0);
28373         assert(d.current_time == 0);
28374         assert(d.elapsed_time == 0);
28375         assert(d.percent_complete == 0);
28376         assert(d.display_interval == 1);
28377         assert(d.overtime_flag == 0);
28378         assert(d.k == 1024);
28379         assert(d.twiddle == '-');
28380         assert(d.manual_width == 0);
28381         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28382         assert(d.display_datacount == 1);
28383         assert(d.display_throughput == 1);
28384         assert(d.display_time == 1);
28385         assert(d.display_percent == 1);
28386         assert(d.display_bar == 1);
28387         assert(d.display_summary == 1);
28388         assert(d.display_ansi == 0);
28389         assert(d.twiddle_fg_color == 0);
28390         assert(d.twiddle_bg_color == 0);
28391         assert(d.twiddle_fg_bold == 1);
28392         assert(d.datacount_fg_color == 0);
28393         assert(d.datacount_bg_color == 0);
28394         assert(d.datacount_fg_bold == 0);
28395         assert(d.throughput_label_fg_color == 0);
28396         assert(d.throughput_label_bg_color == 0);
28397         assert(d.throughput_label_fg_bold == 0);
28398         assert(d.throughput_fg_color == 0);
28399         assert(d.throughput_bg_color == 0);
28400         assert(d.throughput_fg_bold == 0);
28401         assert(d.time_label_fg_color == 0);
28402         assert(d.time_label_bg_color == 0);
28403         assert(d.time_label_fg_bold == 0);
28404         assert(d.percent_fg_color == 0);
28405         assert(d.percent_bg_color == 0);
28406         assert(d.percent_fg_bold == 0);
28407         assert(d.barbrace_fg_color == 0);
28408         assert(d.barbrace_bg_color == 0);
28409         assert(d.barbrace_fg_bold == 0);
28410         assert(d.bar_fg_color == 0);
28411         assert(d.bar_bg_color == 0);
28412         assert(d.bar_fg_bold == 0);
28413         assert(io.in == 0);
28414         assert(io.out == 1);
28415         assert(io.in_ready == 0);
28416         assert(io.out_ready == 0);
28417         assert(io.eof_in == 0);
28418         assert(io.eof_out == 0);
28419         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28420         /* assert(io.cbuf == 0x0); */
28421         assert(io.last_read == 0);
28422         assert(io.last_write == 0);
28423         assert(io.total_read == 0);
28424         assert(io.total_write == 0);
28425         assert(io.total_size == 0);
28426         assert(io.total_size_known == 0);
28427         assert(io.timeout == 250000);
28428 
28429         for (argc = 0; argc < 256; argc++)
28430                 argv[argc] = 0;
28431         argc = 0;
28432         argv[argc++] = "ProgramName";
28433         argv[argc++] = "-twn";
28434 
28435         assert(parse_args(out, argc, argv) == 0);
28436 
28437 #ifdef PRINT_DEBUG
28438         print();
28439 #endif
28440         assert(d.start_time == 0);
28441         assert(d.total_time == 0);
28442         assert(d.current_time == 0);
28443         assert(d.elapsed_time == 0);
28444         assert(d.percent_complete == 0);
28445         assert(d.display_interval == 1);
28446         assert(d.overtime_flag == 0);
28447         assert(d.k == 1024);
28448         assert(d.twiddle == '-');
28449         assert(d.manual_width == 0);
28450         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28451         assert(d.display_datacount == 1);
28452         assert(d.display_throughput == 1);
28453         assert(d.display_time == 1);
28454         assert(d.display_percent == 1);
28455         assert(d.display_bar == 1);
28456         assert(d.display_summary == 1);
28457         assert(d.display_ansi == 0);
28458         assert(d.twiddle_fg_color == 0);
28459         assert(d.twiddle_bg_color == 0);
28460         assert(d.twiddle_fg_bold == 0);
28461         assert(d.datacount_fg_color == 0);
28462         assert(d.datacount_bg_color == 0);
28463         assert(d.datacount_fg_bold == 0);
28464         assert(d.throughput_label_fg_color == 0);
28465         assert(d.throughput_label_bg_color == 0);
28466         assert(d.throughput_label_fg_bold == 0);
28467         assert(d.throughput_fg_color == 0);
28468         assert(d.throughput_bg_color == 0);
28469         assert(d.throughput_fg_bold == 0);
28470         assert(d.time_label_fg_color == 0);
28471         assert(d.time_label_bg_color == 0);
28472         assert(d.time_label_fg_bold == 0);
28473         assert(d.percent_fg_color == 0);
28474         assert(d.percent_bg_color == 0);
28475         assert(d.percent_fg_bold == 0);
28476         assert(d.barbrace_fg_color == 0);
28477         assert(d.barbrace_bg_color == 0);
28478         assert(d.barbrace_fg_bold == 0);
28479         assert(d.bar_fg_color == 0);
28480         assert(d.bar_bg_color == 0);
28481         assert(d.bar_fg_bold == 0);
28482         assert(io.in == 0);
28483         assert(io.out == 1);
28484         assert(io.in_ready == 0);
28485         assert(io.out_ready == 0);
28486         assert(io.eof_in == 0);
28487         assert(io.eof_out == 0);
28488         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28489         /* assert(io.cbuf == 0x0); */
28490         assert(io.last_read == 0);
28491         assert(io.last_write == 0);
28492         assert(io.total_read == 0);
28493         assert(io.total_write == 0);
28494         assert(io.total_size == 0);
28495         assert(io.total_size_known == 0);
28496         assert(io.timeout == 250000);
28497 
28498         assert(test_parse_rc(out, 0));
28499 
28500 #ifdef PRINT_DEBUG
28501         print();
28502 #endif
28503         assert(d.start_time == 0);
28504         assert(d.total_time == 0);
28505         assert(d.current_time == 0);
28506         assert(d.elapsed_time == 0);
28507         assert(d.percent_complete == 0);
28508         assert(d.display_interval == 1);
28509         assert(d.overtime_flag == 0);
28510         assert(d.k == 1024);
28511         assert(d.twiddle == '-');
28512         assert(d.manual_width == 0);
28513         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28514         assert(d.display_datacount == 1);
28515         assert(d.display_throughput == 1);
28516         assert(d.display_time == 1);
28517         assert(d.display_percent == 1);
28518         assert(d.display_bar == 1);
28519         assert(d.display_summary == 1);
28520         assert(d.display_ansi == 0);
28521         assert(d.twiddle_fg_color == 0);
28522         assert(d.twiddle_bg_color == 0);
28523         assert(d.twiddle_fg_bold == 0);
28524         assert(d.datacount_fg_color == 0);
28525         assert(d.datacount_bg_color == 0);
28526         assert(d.datacount_fg_bold == 0);
28527         assert(d.throughput_label_fg_color == 0);
28528         assert(d.throughput_label_bg_color == 0);
28529         assert(d.throughput_label_fg_bold == 0);
28530         assert(d.throughput_fg_color == 0);
28531         assert(d.throughput_bg_color == 0);
28532         assert(d.throughput_fg_bold == 0);
28533         assert(d.time_label_fg_color == 0);
28534         assert(d.time_label_bg_color == 0);
28535         assert(d.time_label_fg_bold == 0);
28536         assert(d.percent_fg_color == 0);
28537         assert(d.percent_bg_color == 0);
28538         assert(d.percent_fg_bold == 0);
28539         assert(d.barbrace_fg_color == 0);
28540         assert(d.barbrace_bg_color == 0);
28541         assert(d.barbrace_fg_bold == 0);
28542         assert(d.bar_fg_color == 0);
28543         assert(d.bar_bg_color == 0);
28544         assert(d.bar_fg_bold == 0);
28545         assert(io.in == 0);
28546         assert(io.out == 1);
28547         assert(io.in_ready == 0);
28548         assert(io.out_ready == 0);
28549         assert(io.eof_in == 0);
28550         assert(io.eof_out == 0);
28551         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28552         /* assert(io.cbuf == 0x0); */
28553         assert(io.last_read == 0);
28554         assert(io.last_write == 0);
28555         assert(io.total_read == 0);
28556         assert(io.total_write == 0);
28557         assert(io.total_size == 0);
28558         assert(io.total_size_known == 0);
28559         assert(io.timeout == 250000);
28560 
28561         tmp_rcfile = fopen("test-rcfile.txt", "w");
28562         assert(tmp_rcfile != 0);
28563         fclose(tmp_rcfile);
28564 
28565 #ifdef PRINT_DEBUG
28566         print();
28567 #endif
28568         assert(d.start_time == 0);
28569         assert(d.total_time == 0);
28570         assert(d.current_time == 0);
28571         assert(d.elapsed_time == 0);
28572         assert(d.percent_complete == 0);
28573         assert(d.display_interval == 1);
28574         assert(d.overtime_flag == 0);
28575         assert(d.k == 1024);
28576         assert(d.twiddle == '-');
28577         assert(d.manual_width == 0);
28578         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28579         assert(d.display_datacount == 1);
28580         assert(d.display_throughput == 1);
28581         assert(d.display_time == 1);
28582         assert(d.display_percent == 1);
28583         assert(d.display_bar == 1);
28584         assert(d.display_summary == 1);
28585         assert(d.display_ansi == 0);
28586         assert(d.twiddle_fg_color == 0);
28587         assert(d.twiddle_bg_color == 0);
28588         assert(d.twiddle_fg_bold == 0);
28589         assert(d.datacount_fg_color == 0);
28590         assert(d.datacount_bg_color == 0);
28591         assert(d.datacount_fg_bold == 0);
28592         assert(d.throughput_label_fg_color == 0);
28593         assert(d.throughput_label_bg_color == 0);
28594         assert(d.throughput_label_fg_bold == 0);
28595         assert(d.throughput_fg_color == 0);
28596         assert(d.throughput_bg_color == 0);
28597         assert(d.throughput_fg_bold == 0);
28598         assert(d.time_label_fg_color == 0);
28599         assert(d.time_label_bg_color == 0);
28600         assert(d.time_label_fg_bold == 0);
28601         assert(d.percent_fg_color == 0);
28602         assert(d.percent_bg_color == 0);
28603         assert(d.percent_fg_bold == 0);
28604         assert(d.barbrace_fg_color == 0);
28605         assert(d.barbrace_bg_color == 0);
28606         assert(d.barbrace_fg_bold == 0);
28607         assert(d.bar_fg_color == 0);
28608         assert(d.bar_bg_color == 0);
28609         assert(d.bar_fg_bold == 0);
28610         assert(io.in == 0);
28611         assert(io.out == 1);
28612         assert(io.in_ready == 0);
28613         assert(io.out_ready == 0);
28614         assert(io.eof_in == 0);
28615         assert(io.eof_out == 0);
28616         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28617         /* assert(io.cbuf == 0x0); */
28618         assert(io.last_read == 0);
28619         assert(io.last_write == 0);
28620         assert(io.total_read == 0);
28621         assert(io.total_write == 0);
28622         assert(io.total_size == 0);
28623         assert(io.total_size_known == 0);
28624         assert(io.timeout == 250000);
28625 
28626         tmp_rcfile = fopen("test-rcfile.txt", "w");
28627         assert(tmp_rcfile != 0);
28628         fprintf(tmp_rcfile, "twiddle-foreground: kjshdfkjh");
28629         fclose(tmp_rcfile);
28630 
28631         clear_errno();
28632         assert(test_parse_rc(out,1));
28633 
28634 #ifdef PRINT_DEBUG
28635         print();
28636 #endif
28637         assert(d.start_time == 0);
28638         assert(d.total_time == 0);
28639         assert(d.current_time == 0);
28640         assert(d.elapsed_time == 0);
28641         assert(d.percent_complete == 0);
28642         assert(d.display_interval == 1);
28643         assert(d.overtime_flag == 0);
28644         assert(d.k == 1024);
28645         assert(d.twiddle == '-');
28646         assert(d.manual_width == 0);
28647         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28648         assert(d.display_datacount == 1);
28649         assert(d.display_throughput == 1);
28650         assert(d.display_time == 1);
28651         assert(d.display_percent == 1);
28652         assert(d.display_bar == 1);
28653         assert(d.display_summary == 1);
28654         assert(d.display_ansi == 0);
28655         assert(d.twiddle_fg_color == 0);
28656         assert(d.twiddle_bg_color == 0);
28657         assert(d.twiddle_fg_bold == 0);
28658         assert(d.datacount_fg_color == 0);
28659         assert(d.datacount_bg_color == 0);
28660         assert(d.datacount_fg_bold == 0);
28661         assert(d.throughput_label_fg_color == 0);
28662         assert(d.throughput_label_bg_color == 0);
28663         assert(d.throughput_label_fg_bold == 0);
28664         assert(d.throughput_fg_color == 0);
28665         assert(d.throughput_bg_color == 0);
28666         assert(d.throughput_fg_bold == 0);
28667         assert(d.time_label_fg_color == 0);
28668         assert(d.time_label_bg_color == 0);
28669         assert(d.time_label_fg_bold == 0);
28670         assert(d.percent_fg_color == 0);
28671         assert(d.percent_bg_color == 0);
28672         assert(d.percent_fg_bold == 0);
28673         assert(d.barbrace_fg_color == 0);
28674         assert(d.barbrace_bg_color == 0);
28675         assert(d.barbrace_fg_bold == 0);
28676         assert(d.bar_fg_color == 0);
28677         assert(d.bar_bg_color == 0);
28678         assert(d.bar_fg_bold == 0);
28679         assert(io.in == 0);
28680         assert(io.out == 1);
28681         assert(io.in_ready == 0);
28682         assert(io.out_ready == 0);
28683         assert(io.eof_in == 0);
28684         assert(io.eof_out == 0);
28685         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28686         /* assert(io.cbuf == 0x0); */
28687         assert(io.last_read == 0);
28688         assert(io.last_write == 0);
28689         assert(io.total_read == 0);
28690         assert(io.total_write == 0);
28691         assert(io.total_size == 0);
28692         assert(io.total_size_known == 0);
28693         assert(io.timeout == 250000);
28694 
28695         tmp_rcfile = fopen("test-rcfile.txt", "w");
28696         assert(tmp_rcfile != 0);
28697         fprintf(tmp_rcfile, "twiddle-foreground: black");
28698         fclose(tmp_rcfile);
28699 
28700         clear_errno();
28701         assert(test_parse_rc(out,0));
28702 
28703 #ifdef PRINT_DEBUG
28704         print();
28705 #endif
28706         assert(d.start_time == 0);
28707         assert(d.total_time == 0);
28708         assert(d.current_time == 0);
28709         assert(d.elapsed_time == 0);
28710         assert(d.percent_complete == 0);
28711         assert(d.display_interval == 1);
28712         assert(d.overtime_flag == 0);
28713         assert(d.k == 1024);
28714         assert(d.twiddle == '-');
28715         assert(d.manual_width == 0);
28716         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28717         assert(d.display_datacount == 1);
28718         assert(d.display_throughput == 1);
28719         assert(d.display_time == 1);
28720         assert(d.display_percent == 1);
28721         assert(d.display_bar == 1);
28722         assert(d.display_summary == 1);
28723         assert(d.display_ansi == 0);
28724         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
28725         assert(d.twiddle_bg_color == 0);
28726         assert(d.twiddle_fg_bold == 0);
28727         assert(d.datacount_fg_color == 0);
28728         assert(d.datacount_bg_color == 0);
28729         assert(d.datacount_fg_bold == 0);
28730         assert(d.throughput_label_fg_color == 0);
28731         assert(d.throughput_label_bg_color == 0);
28732         assert(d.throughput_label_fg_bold == 0);
28733         assert(d.throughput_fg_color == 0);
28734         assert(d.throughput_bg_color == 0);
28735         assert(d.throughput_fg_bold == 0);
28736         assert(d.time_label_fg_color == 0);
28737         assert(d.time_label_bg_color == 0);
28738         assert(d.time_label_fg_bold == 0);
28739         assert(d.percent_fg_color == 0);
28740         assert(d.percent_bg_color == 0);
28741         assert(d.percent_fg_bold == 0);
28742         assert(d.barbrace_fg_color == 0);
28743         assert(d.barbrace_bg_color == 0);
28744         assert(d.barbrace_fg_bold == 0);
28745         assert(d.bar_fg_color == 0);
28746         assert(d.bar_bg_color == 0);
28747         assert(d.bar_fg_bold == 0);
28748         assert(io.in == 0);
28749         assert(io.out == 1);
28750         assert(io.in_ready == 0);
28751         assert(io.out_ready == 0);
28752         assert(io.eof_in == 0);
28753         assert(io.eof_out == 0);
28754         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28755         /* assert(io.cbuf == 0x0); */
28756         assert(io.last_read == 0);
28757         assert(io.last_write == 0);
28758         assert(io.total_read == 0);
28759         assert(io.total_write == 0);
28760         assert(io.total_size == 0);
28761         assert(io.total_size_known == 0);
28762         assert(io.timeout == 250000);
28763 
28764         tmp_rcfile = fopen("test-rcfile.txt", "w");
28765         assert(tmp_rcfile != 0);
28766         fprintf(tmp_rcfile, "twiddle-foreground: red");
28767         fclose(tmp_rcfile);
28768 
28769         clear_errno();
28770         assert(test_parse_rc(out,0));
28771 
28772 #ifdef PRINT_DEBUG
28773         print();
28774 #endif
28775         assert(d.start_time == 0);
28776         assert(d.total_time == 0);
28777         assert(d.current_time == 0);
28778         assert(d.elapsed_time == 0);
28779         assert(d.percent_complete == 0);
28780         assert(d.display_interval == 1);
28781         assert(d.overtime_flag == 0);
28782         assert(d.k == 1024);
28783         assert(d.twiddle == '-');
28784         assert(d.manual_width == 0);
28785         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28786         assert(d.display_datacount == 1);
28787         assert(d.display_throughput == 1);
28788         assert(d.display_time == 1);
28789         assert(d.display_percent == 1);
28790         assert(d.display_bar == 1);
28791         assert(d.display_summary == 1);
28792         assert(d.display_ansi == 0);
28793         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
28794         assert(d.twiddle_bg_color == 0);
28795         assert(d.twiddle_fg_bold == 0);
28796         assert(d.datacount_fg_color == 0);
28797         assert(d.datacount_bg_color == 0);
28798         assert(d.datacount_fg_bold == 0);
28799         assert(d.throughput_label_fg_color == 0);
28800         assert(d.throughput_label_bg_color == 0);
28801         assert(d.throughput_label_fg_bold == 0);
28802         assert(d.throughput_fg_color == 0);
28803         assert(d.throughput_bg_color == 0);
28804         assert(d.throughput_fg_bold == 0);
28805         assert(d.time_label_fg_color == 0);
28806         assert(d.time_label_bg_color == 0);
28807         assert(d.time_label_fg_bold == 0);
28808         assert(d.percent_fg_color == 0);
28809         assert(d.percent_bg_color == 0);
28810         assert(d.percent_fg_bold == 0);
28811         assert(d.barbrace_fg_color == 0);
28812         assert(d.barbrace_bg_color == 0);
28813         assert(d.barbrace_fg_bold == 0);
28814         assert(d.bar_fg_color == 0);
28815         assert(d.bar_bg_color == 0);
28816         assert(d.bar_fg_bold == 0);
28817         assert(io.in == 0);
28818         assert(io.out == 1);
28819         assert(io.in_ready == 0);
28820         assert(io.out_ready == 0);
28821         assert(io.eof_in == 0);
28822         assert(io.eof_out == 0);
28823         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28824         /* assert(io.cbuf == 0x0); */
28825         assert(io.last_read == 0);
28826         assert(io.last_write == 0);
28827         assert(io.total_read == 0);
28828         assert(io.total_write == 0);
28829         assert(io.total_size == 0);
28830         assert(io.total_size_known == 0);
28831         assert(io.timeout == 250000);
28832 
28833         tmp_rcfile = fopen("test-rcfile.txt", "w");
28834         assert(tmp_rcfile != 0);
28835         fprintf(tmp_rcfile, "twiddle-foreground: green");
28836         fclose(tmp_rcfile);
28837 
28838         clear_errno();
28839         assert(test_parse_rc(out,0));
28840 
28841 #ifdef PRINT_DEBUG
28842         print();
28843 #endif
28844         assert(d.start_time == 0);
28845         assert(d.total_time == 0);
28846         assert(d.current_time == 0);
28847         assert(d.elapsed_time == 0);
28848         assert(d.percent_complete == 0);
28849         assert(d.display_interval == 1);
28850         assert(d.overtime_flag == 0);
28851         assert(d.k == 1024);
28852         assert(d.twiddle == '-');
28853         assert(d.manual_width == 0);
28854         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28855         assert(d.display_datacount == 1);
28856         assert(d.display_throughput == 1);
28857         assert(d.display_time == 1);
28858         assert(d.display_percent == 1);
28859         assert(d.display_bar == 1);
28860         assert(d.display_summary == 1);
28861         assert(d.display_ansi == 0);
28862         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
28863         assert(d.twiddle_bg_color == 0);
28864         assert(d.twiddle_fg_bold == 0);
28865         assert(d.datacount_fg_color == 0);
28866         assert(d.datacount_bg_color == 0);
28867         assert(d.datacount_fg_bold == 0);
28868         assert(d.throughput_label_fg_color == 0);
28869         assert(d.throughput_label_bg_color == 0);
28870         assert(d.throughput_label_fg_bold == 0);
28871         assert(d.throughput_fg_color == 0);
28872         assert(d.throughput_bg_color == 0);
28873         assert(d.throughput_fg_bold == 0);
28874         assert(d.time_label_fg_color == 0);
28875         assert(d.time_label_bg_color == 0);
28876         assert(d.time_label_fg_bold == 0);
28877         assert(d.percent_fg_color == 0);
28878         assert(d.percent_bg_color == 0);
28879         assert(d.percent_fg_bold == 0);
28880         assert(d.barbrace_fg_color == 0);
28881         assert(d.barbrace_bg_color == 0);
28882         assert(d.barbrace_fg_bold == 0);
28883         assert(d.bar_fg_color == 0);
28884         assert(d.bar_bg_color == 0);
28885         assert(d.bar_fg_bold == 0);
28886         assert(io.in == 0);
28887         assert(io.out == 1);
28888         assert(io.in_ready == 0);
28889         assert(io.out_ready == 0);
28890         assert(io.eof_in == 0);
28891         assert(io.eof_out == 0);
28892         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28893         /* assert(io.cbuf == 0x0); */
28894         assert(io.last_read == 0);
28895         assert(io.last_write == 0);
28896         assert(io.total_read == 0);
28897         assert(io.total_write == 0);
28898         assert(io.total_size == 0);
28899         assert(io.total_size_known == 0);
28900         assert(io.timeout == 250000);
28901 
28902         tmp_rcfile = fopen("test-rcfile.txt", "w");
28903         assert(tmp_rcfile != 0);
28904         fprintf(tmp_rcfile, "twiddle-foreground: yellow");
28905         fclose(tmp_rcfile);
28906 
28907         clear_errno();
28908         assert(test_parse_rc(out,0));
28909 
28910 #ifdef PRINT_DEBUG
28911         print();
28912 #endif
28913         assert(d.start_time == 0);
28914         assert(d.total_time == 0);
28915         assert(d.current_time == 0);
28916         assert(d.elapsed_time == 0);
28917         assert(d.percent_complete == 0);
28918         assert(d.display_interval == 1);
28919         assert(d.overtime_flag == 0);
28920         assert(d.k == 1024);
28921         assert(d.twiddle == '-');
28922         assert(d.manual_width == 0);
28923         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28924         assert(d.display_datacount == 1);
28925         assert(d.display_throughput == 1);
28926         assert(d.display_time == 1);
28927         assert(d.display_percent == 1);
28928         assert(d.display_bar == 1);
28929         assert(d.display_summary == 1);
28930         assert(d.display_ansi == 0);
28931         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
28932         assert(d.twiddle_bg_color == 0);
28933         assert(d.twiddle_fg_bold == 0);
28934         assert(d.datacount_fg_color == 0);
28935         assert(d.datacount_bg_color == 0);
28936         assert(d.datacount_fg_bold == 0);
28937         assert(d.throughput_label_fg_color == 0);
28938         assert(d.throughput_label_bg_color == 0);
28939         assert(d.throughput_label_fg_bold == 0);
28940         assert(d.throughput_fg_color == 0);
28941         assert(d.throughput_bg_color == 0);
28942         assert(d.throughput_fg_bold == 0);
28943         assert(d.time_label_fg_color == 0);
28944         assert(d.time_label_bg_color == 0);
28945         assert(d.time_label_fg_bold == 0);
28946         assert(d.percent_fg_color == 0);
28947         assert(d.percent_bg_color == 0);
28948         assert(d.percent_fg_bold == 0);
28949         assert(d.barbrace_fg_color == 0);
28950         assert(d.barbrace_bg_color == 0);
28951         assert(d.barbrace_fg_bold == 0);
28952         assert(d.bar_fg_color == 0);
28953         assert(d.bar_bg_color == 0);
28954         assert(d.bar_fg_bold == 0);
28955         assert(io.in == 0);
28956         assert(io.out == 1);
28957         assert(io.in_ready == 0);
28958         assert(io.out_ready == 0);
28959         assert(io.eof_in == 0);
28960         assert(io.eof_out == 0);
28961         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
28962         /* assert(io.cbuf == 0x0); */
28963         assert(io.last_read == 0);
28964         assert(io.last_write == 0);
28965         assert(io.total_read == 0);
28966         assert(io.total_write == 0);
28967         assert(io.total_size == 0);
28968         assert(io.total_size_known == 0);
28969         assert(io.timeout == 250000);
28970 
28971         tmp_rcfile = fopen("test-rcfile.txt", "w");
28972         assert(tmp_rcfile != 0);
28973         fprintf(tmp_rcfile, "twiddle-foreground: blue");
28974         fclose(tmp_rcfile);
28975 
28976         clear_errno();
28977         assert(test_parse_rc(out,0));
28978 
28979 #ifdef PRINT_DEBUG
28980         print();
28981 #endif
28982         assert(d.start_time == 0);
28983         assert(d.total_time == 0);
28984         assert(d.current_time == 0);
28985         assert(d.elapsed_time == 0);
28986         assert(d.percent_complete == 0);
28987         assert(d.display_interval == 1);
28988         assert(d.overtime_flag == 0);
28989         assert(d.k == 1024);
28990         assert(d.twiddle == '-');
28991         assert(d.manual_width == 0);
28992         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
28993         assert(d.display_datacount == 1);
28994         assert(d.display_throughput == 1);
28995         assert(d.display_time == 1);
28996         assert(d.display_percent == 1);
28997         assert(d.display_bar == 1);
28998         assert(d.display_summary == 1);
28999         assert(d.display_ansi == 0);
29000         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
29001         assert(d.twiddle_bg_color == 0);
29002         assert(d.twiddle_fg_bold == 0);
29003         assert(d.datacount_fg_color == 0);
29004         assert(d.datacount_bg_color == 0);
29005         assert(d.datacount_fg_bold == 0);
29006         assert(d.throughput_label_fg_color == 0);
29007         assert(d.throughput_label_bg_color == 0);
29008         assert(d.throughput_label_fg_bold == 0);
29009         assert(d.throughput_fg_color == 0);
29010         assert(d.throughput_bg_color == 0);
29011         assert(d.throughput_fg_bold == 0);
29012         assert(d.time_label_fg_color == 0);
29013         assert(d.time_label_bg_color == 0);
29014         assert(d.time_label_fg_bold == 0);
29015         assert(d.percent_fg_color == 0);
29016         assert(d.percent_bg_color == 0);
29017         assert(d.percent_fg_bold == 0);
29018         assert(d.barbrace_fg_color == 0);
29019         assert(d.barbrace_bg_color == 0);
29020         assert(d.barbrace_fg_bold == 0);
29021         assert(d.bar_fg_color == 0);
29022         assert(d.bar_bg_color == 0);
29023         assert(d.bar_fg_bold == 0);
29024         assert(io.in == 0);
29025         assert(io.out == 1);
29026         assert(io.in_ready == 0);
29027         assert(io.out_ready == 0);
29028         assert(io.eof_in == 0);
29029         assert(io.eof_out == 0);
29030         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29031         /* assert(io.cbuf == 0x0); */
29032         assert(io.last_read == 0);
29033         assert(io.last_write == 0);
29034         assert(io.total_read == 0);
29035         assert(io.total_write == 0);
29036         assert(io.total_size == 0);
29037         assert(io.total_size_known == 0);
29038         assert(io.timeout == 250000);
29039 
29040         tmp_rcfile = fopen("test-rcfile.txt", "w");
29041         assert(tmp_rcfile != 0);
29042         fprintf(tmp_rcfile, "twiddle-foreground: magenta");
29043         fclose(tmp_rcfile);
29044 
29045         clear_errno();
29046         assert(test_parse_rc(out,0));
29047 
29048 #ifdef PRINT_DEBUG
29049         print();
29050 #endif
29051         assert(d.start_time == 0);
29052         assert(d.total_time == 0);
29053         assert(d.current_time == 0);
29054         assert(d.elapsed_time == 0);
29055         assert(d.percent_complete == 0);
29056         assert(d.display_interval == 1);
29057         assert(d.overtime_flag == 0);
29058         assert(d.k == 1024);
29059         assert(d.twiddle == '-');
29060         assert(d.manual_width == 0);
29061         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29062         assert(d.display_datacount == 1);
29063         assert(d.display_throughput == 1);
29064         assert(d.display_time == 1);
29065         assert(d.display_percent == 1);
29066         assert(d.display_bar == 1);
29067         assert(d.display_summary == 1);
29068         assert(d.display_ansi == 0);
29069         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
29070         assert(d.twiddle_bg_color == 0);
29071         assert(d.twiddle_fg_bold == 0);
29072         assert(d.datacount_fg_color == 0);
29073         assert(d.datacount_bg_color == 0);
29074         assert(d.datacount_fg_bold == 0);
29075         assert(d.throughput_label_fg_color == 0);
29076         assert(d.throughput_label_bg_color == 0);
29077         assert(d.throughput_label_fg_bold == 0);
29078         assert(d.throughput_fg_color == 0);
29079         assert(d.throughput_bg_color == 0);
29080         assert(d.throughput_fg_bold == 0);
29081         assert(d.time_label_fg_color == 0);
29082         assert(d.time_label_bg_color == 0);
29083         assert(d.time_label_fg_bold == 0);
29084         assert(d.percent_fg_color == 0);
29085         assert(d.percent_bg_color == 0);
29086         assert(d.percent_fg_bold == 0);
29087         assert(d.barbrace_fg_color == 0);
29088         assert(d.barbrace_bg_color == 0);
29089         assert(d.barbrace_fg_bold == 0);
29090         assert(d.bar_fg_color == 0);
29091         assert(d.bar_bg_color == 0);
29092         assert(d.bar_fg_bold == 0);
29093         assert(io.in == 0);
29094         assert(io.out == 1);
29095         assert(io.in_ready == 0);
29096         assert(io.out_ready == 0);
29097         assert(io.eof_in == 0);
29098         assert(io.eof_out == 0);
29099         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29100         /* assert(io.cbuf == 0x0); */
29101         assert(io.last_read == 0);
29102         assert(io.last_write == 0);
29103         assert(io.total_read == 0);
29104         assert(io.total_write == 0);
29105         assert(io.total_size == 0);
29106         assert(io.total_size_known == 0);
29107         assert(io.timeout == 250000);
29108 
29109         tmp_rcfile = fopen("test-rcfile.txt", "w");
29110         assert(tmp_rcfile != 0);
29111         fprintf(tmp_rcfile, "twiddle-foreground: cyan");
29112         fclose(tmp_rcfile);
29113 
29114         clear_errno();
29115         assert(test_parse_rc(out,0));
29116 
29117 #ifdef PRINT_DEBUG
29118         print();
29119 #endif
29120         assert(d.start_time == 0);
29121         assert(d.total_time == 0);
29122         assert(d.current_time == 0);
29123         assert(d.elapsed_time == 0);
29124         assert(d.percent_complete == 0);
29125         assert(d.display_interval == 1);
29126         assert(d.overtime_flag == 0);
29127         assert(d.k == 1024);
29128         assert(d.twiddle == '-');
29129         assert(d.manual_width == 0);
29130         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29131         assert(d.display_datacount == 1);
29132         assert(d.display_throughput == 1);
29133         assert(d.display_time == 1);
29134         assert(d.display_percent == 1);
29135         assert(d.display_bar == 1);
29136         assert(d.display_summary == 1);
29137         assert(d.display_ansi == 0);
29138         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
29139         assert(d.twiddle_bg_color == 0);
29140         assert(d.twiddle_fg_bold == 0);
29141         assert(d.datacount_fg_color == 0);
29142         assert(d.datacount_bg_color == 0);
29143         assert(d.datacount_fg_bold == 0);
29144         assert(d.throughput_label_fg_color == 0);
29145         assert(d.throughput_label_bg_color == 0);
29146         assert(d.throughput_label_fg_bold == 0);
29147         assert(d.throughput_fg_color == 0);
29148         assert(d.throughput_bg_color == 0);
29149         assert(d.throughput_fg_bold == 0);
29150         assert(d.time_label_fg_color == 0);
29151         assert(d.time_label_bg_color == 0);
29152         assert(d.time_label_fg_bold == 0);
29153         assert(d.percent_fg_color == 0);
29154         assert(d.percent_bg_color == 0);
29155         assert(d.percent_fg_bold == 0);
29156         assert(d.barbrace_fg_color == 0);
29157         assert(d.barbrace_bg_color == 0);
29158         assert(d.barbrace_fg_bold == 0);
29159         assert(d.bar_fg_color == 0);
29160         assert(d.bar_bg_color == 0);
29161         assert(d.bar_fg_bold == 0);
29162         assert(io.in == 0);
29163         assert(io.out == 1);
29164         assert(io.in_ready == 0);
29165         assert(io.out_ready == 0);
29166         assert(io.eof_in == 0);
29167         assert(io.eof_out == 0);
29168         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29169         /* assert(io.cbuf == 0x0); */
29170         assert(io.last_read == 0);
29171         assert(io.last_write == 0);
29172         assert(io.total_read == 0);
29173         assert(io.total_write == 0);
29174         assert(io.total_size == 0);
29175         assert(io.total_size_known == 0);
29176         assert(io.timeout == 250000);
29177 
29178         tmp_rcfile = fopen("test-rcfile.txt", "w");
29179         assert(tmp_rcfile != 0);
29180         fprintf(tmp_rcfile, "twiddle-foreground: white");
29181         fclose(tmp_rcfile);
29182 
29183         clear_errno();
29184         assert(test_parse_rc(out,0));
29185 
29186 #ifdef PRINT_DEBUG
29187         print();
29188 #endif
29189         assert(d.start_time == 0);
29190         assert(d.total_time == 0);
29191         assert(d.current_time == 0);
29192         assert(d.elapsed_time == 0);
29193         assert(d.percent_complete == 0);
29194         assert(d.display_interval == 1);
29195         assert(d.overtime_flag == 0);
29196         assert(d.k == 1024);
29197         assert(d.twiddle == '-');
29198         assert(d.manual_width == 0);
29199         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29200         assert(d.display_datacount == 1);
29201         assert(d.display_throughput == 1);
29202         assert(d.display_time == 1);
29203         assert(d.display_percent == 1);
29204         assert(d.display_bar == 1);
29205         assert(d.display_summary == 1);
29206         assert(d.display_ansi == 0);
29207         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
29208         assert(d.twiddle_bg_color == 0);
29209         assert(d.twiddle_fg_bold == 0);
29210         assert(d.datacount_fg_color == 0);
29211         assert(d.datacount_bg_color == 0);
29212         assert(d.datacount_fg_bold == 0);
29213         assert(d.throughput_label_fg_color == 0);
29214         assert(d.throughput_label_bg_color == 0);
29215         assert(d.throughput_label_fg_bold == 0);
29216         assert(d.throughput_fg_color == 0);
29217         assert(d.throughput_bg_color == 0);
29218         assert(d.throughput_fg_bold == 0);
29219         assert(d.time_label_fg_color == 0);
29220         assert(d.time_label_bg_color == 0);
29221         assert(d.time_label_fg_bold == 0);
29222         assert(d.percent_fg_color == 0);
29223         assert(d.percent_bg_color == 0);
29224         assert(d.percent_fg_bold == 0);
29225         assert(d.barbrace_fg_color == 0);
29226         assert(d.barbrace_bg_color == 0);
29227         assert(d.barbrace_fg_bold == 0);
29228         assert(d.bar_fg_color == 0);
29229         assert(d.bar_bg_color == 0);
29230         assert(d.bar_fg_bold == 0);
29231         assert(io.in == 0);
29232         assert(io.out == 1);
29233         assert(io.in_ready == 0);
29234         assert(io.out_ready == 0);
29235         assert(io.eof_in == 0);
29236         assert(io.eof_out == 0);
29237         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29238         /* assert(io.cbuf == 0x0); */
29239         assert(io.last_read == 0);
29240         assert(io.last_write == 0);
29241         assert(io.total_read == 0);
29242         assert(io.total_write == 0);
29243         assert(io.total_size == 0);
29244         assert(io.total_size_known == 0);
29245         assert(io.timeout == 250000);
29246 
29247         tmp_rcfile = fopen("test-rcfile.txt", "w");
29248         assert(tmp_rcfile != 0);
29249         fprintf(tmp_rcfile, "twiddle-foreground: normal");
29250         fclose(tmp_rcfile);
29251 
29252         clear_errno();
29253         assert(test_parse_rc(out,0));
29254 
29255 #ifdef PRINT_DEBUG
29256         print();
29257 #endif
29258         assert(d.start_time == 0);
29259         assert(d.total_time == 0);
29260         assert(d.current_time == 0);
29261         assert(d.elapsed_time == 0);
29262         assert(d.percent_complete == 0);
29263         assert(d.display_interval == 1);
29264         assert(d.overtime_flag == 0);
29265         assert(d.k == 1024);
29266         assert(d.twiddle == '-');
29267         assert(d.manual_width == 0);
29268         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29269         assert(d.display_datacount == 1);
29270         assert(d.display_throughput == 1);
29271         assert(d.display_time == 1);
29272         assert(d.display_percent == 1);
29273         assert(d.display_bar == 1);
29274         assert(d.display_summary == 1);
29275         assert(d.display_ansi == 0);
29276         assert(d.twiddle_fg_color == 0);
29277         assert(d.twiddle_bg_color == 0);
29278         assert(d.twiddle_fg_bold == 0);
29279         assert(d.datacount_fg_color == 0);
29280         assert(d.datacount_bg_color == 0);
29281         assert(d.datacount_fg_bold == 0);
29282         assert(d.throughput_label_fg_color == 0);
29283         assert(d.throughput_label_bg_color == 0);
29284         assert(d.throughput_label_fg_bold == 0);
29285         assert(d.throughput_fg_color == 0);
29286         assert(d.throughput_bg_color == 0);
29287         assert(d.throughput_fg_bold == 0);
29288         assert(d.time_label_fg_color == 0);
29289         assert(d.time_label_bg_color == 0);
29290         assert(d.time_label_fg_bold == 0);
29291         assert(d.percent_fg_color == 0);
29292         assert(d.percent_bg_color == 0);
29293         assert(d.percent_fg_bold == 0);
29294         assert(d.barbrace_fg_color == 0);
29295         assert(d.barbrace_bg_color == 0);
29296         assert(d.barbrace_fg_bold == 0);
29297         assert(d.bar_fg_color == 0);
29298         assert(d.bar_bg_color == 0);
29299         assert(d.bar_fg_bold == 0);
29300         assert(io.in == 0);
29301         assert(io.out == 1);
29302         assert(io.in_ready == 0);
29303         assert(io.out_ready == 0);
29304         assert(io.eof_in == 0);
29305         assert(io.eof_out == 0);
29306         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29307         /* assert(io.cbuf == 0x0); */
29308         assert(io.last_read == 0);
29309         assert(io.last_write == 0);
29310         assert(io.total_read == 0);
29311         assert(io.total_write == 0);
29312         assert(io.total_size == 0);
29313         assert(io.total_size_known == 0);
29314         assert(io.timeout == 250000);
29315 
29316         tmp_rcfile = fopen("test-rcfile.txt", "w");
29317         assert(tmp_rcfile != 0);
29318         fprintf(tmp_rcfile, "twiddle-background: kjshdfkjh");
29319         fclose(tmp_rcfile);
29320 
29321         clear_errno();
29322         assert(test_parse_rc(out,1));
29323 
29324 #ifdef PRINT_DEBUG
29325         print();
29326 #endif
29327         assert(d.start_time == 0);
29328         assert(d.total_time == 0);
29329         assert(d.current_time == 0);
29330         assert(d.elapsed_time == 0);
29331         assert(d.percent_complete == 0);
29332         assert(d.display_interval == 1);
29333         assert(d.overtime_flag == 0);
29334         assert(d.k == 1024);
29335         assert(d.twiddle == '-');
29336         assert(d.manual_width == 0);
29337         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29338         assert(d.display_datacount == 1);
29339         assert(d.display_throughput == 1);
29340         assert(d.display_time == 1);
29341         assert(d.display_percent == 1);
29342         assert(d.display_bar == 1);
29343         assert(d.display_summary == 1);
29344         assert(d.display_ansi == 0);
29345         assert(d.twiddle_fg_color == 0);
29346         assert(d.twiddle_bg_color == 0);
29347         assert(d.twiddle_fg_bold == 0);
29348         assert(d.datacount_fg_color == 0);
29349         assert(d.datacount_bg_color == 0);
29350         assert(d.datacount_fg_bold == 0);
29351         assert(d.throughput_label_fg_color == 0);
29352         assert(d.throughput_label_bg_color == 0);
29353         assert(d.throughput_label_fg_bold == 0);
29354         assert(d.throughput_fg_color == 0);
29355         assert(d.throughput_bg_color == 0);
29356         assert(d.throughput_fg_bold == 0);
29357         assert(d.time_label_fg_color == 0);
29358         assert(d.time_label_bg_color == 0);
29359         assert(d.time_label_fg_bold == 0);
29360         assert(d.percent_fg_color == 0);
29361         assert(d.percent_bg_color == 0);
29362         assert(d.percent_fg_bold == 0);
29363         assert(d.barbrace_fg_color == 0);
29364         assert(d.barbrace_bg_color == 0);
29365         assert(d.barbrace_fg_bold == 0);
29366         assert(d.bar_fg_color == 0);
29367         assert(d.bar_bg_color == 0);
29368         assert(d.bar_fg_bold == 0);
29369         assert(io.in == 0);
29370         assert(io.out == 1);
29371         assert(io.in_ready == 0);
29372         assert(io.out_ready == 0);
29373         assert(io.eof_in == 0);
29374         assert(io.eof_out == 0);
29375         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29376         /* assert(io.cbuf == 0x0); */
29377         assert(io.last_read == 0);
29378         assert(io.last_write == 0);
29379         assert(io.total_read == 0);
29380         assert(io.total_write == 0);
29381         assert(io.total_size == 0);
29382         assert(io.total_size_known == 0);
29383         assert(io.timeout == 250000);
29384 
29385         tmp_rcfile = fopen("test-rcfile.txt", "w");
29386         assert(tmp_rcfile != 0);
29387         fprintf(tmp_rcfile, "twiddle-background: black");
29388         fclose(tmp_rcfile);
29389 
29390         clear_errno();
29391         assert(test_parse_rc(out,0));
29392 
29393 #ifdef PRINT_DEBUG
29394         print();
29395 #endif
29396         assert(d.start_time == 0);
29397         assert(d.total_time == 0);
29398         assert(d.current_time == 0);
29399         assert(d.elapsed_time == 0);
29400         assert(d.percent_complete == 0);
29401         assert(d.display_interval == 1);
29402         assert(d.overtime_flag == 0);
29403         assert(d.k == 1024);
29404         assert(d.twiddle == '-');
29405         assert(d.manual_width == 0);
29406         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29407         assert(d.display_datacount == 1);
29408         assert(d.display_throughput == 1);
29409         assert(d.display_time == 1);
29410         assert(d.display_percent == 1);
29411         assert(d.display_bar == 1);
29412         assert(d.display_summary == 1);
29413         assert(d.display_ansi == 0);
29414         assert(d.twiddle_fg_color == 0);
29415         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
29416         assert(d.twiddle_fg_bold == 0);
29417         assert(d.datacount_fg_color == 0);
29418         assert(d.datacount_bg_color == 0);
29419         assert(d.datacount_fg_bold == 0);
29420         assert(d.throughput_label_fg_color == 0);
29421         assert(d.throughput_label_bg_color == 0);
29422         assert(d.throughput_label_fg_bold == 0);
29423         assert(d.throughput_fg_color == 0);
29424         assert(d.throughput_bg_color == 0);
29425         assert(d.throughput_fg_bold == 0);
29426         assert(d.time_label_fg_color == 0);
29427         assert(d.time_label_bg_color == 0);
29428         assert(d.time_label_fg_bold == 0);
29429         assert(d.percent_fg_color == 0);
29430         assert(d.percent_bg_color == 0);
29431         assert(d.percent_fg_bold == 0);
29432         assert(d.barbrace_fg_color == 0);
29433         assert(d.barbrace_bg_color == 0);
29434         assert(d.barbrace_fg_bold == 0);
29435         assert(d.bar_fg_color == 0);
29436         assert(d.bar_bg_color == 0);
29437         assert(d.bar_fg_bold == 0);
29438         assert(io.in == 0);
29439         assert(io.out == 1);
29440         assert(io.in_ready == 0);
29441         assert(io.out_ready == 0);
29442         assert(io.eof_in == 0);
29443         assert(io.eof_out == 0);
29444         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29445         /* assert(io.cbuf == 0x0); */
29446         assert(io.last_read == 0);
29447         assert(io.last_write == 0);
29448         assert(io.total_read == 0);
29449         assert(io.total_write == 0);
29450         assert(io.total_size == 0);
29451         assert(io.total_size_known == 0);
29452         assert(io.timeout == 250000);
29453 
29454         tmp_rcfile = fopen("test-rcfile.txt", "w");
29455         assert(tmp_rcfile != 0);
29456         fprintf(tmp_rcfile, "twiddle-background: red");
29457         fclose(tmp_rcfile);
29458 
29459         clear_errno();
29460         assert(test_parse_rc(out,0));
29461 
29462 #ifdef PRINT_DEBUG
29463         print();
29464 #endif
29465         assert(d.start_time == 0);
29466         assert(d.total_time == 0);
29467         assert(d.current_time == 0);
29468         assert(d.elapsed_time == 0);
29469         assert(d.percent_complete == 0);
29470         assert(d.display_interval == 1);
29471         assert(d.overtime_flag == 0);
29472         assert(d.k == 1024);
29473         assert(d.twiddle == '-');
29474         assert(d.manual_width == 0);
29475         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29476         assert(d.display_datacount == 1);
29477         assert(d.display_throughput == 1);
29478         assert(d.display_time == 1);
29479         assert(d.display_percent == 1);
29480         assert(d.display_bar == 1);
29481         assert(d.display_summary == 1);
29482         assert(d.display_ansi == 0);
29483         assert(d.twiddle_fg_color == 0);
29484         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
29485         assert(d.twiddle_fg_bold == 0);
29486         assert(d.datacount_fg_color == 0);
29487         assert(d.datacount_bg_color == 0);
29488         assert(d.datacount_fg_bold == 0);
29489         assert(d.throughput_label_fg_color == 0);
29490         assert(d.throughput_label_bg_color == 0);
29491         assert(d.throughput_label_fg_bold == 0);
29492         assert(d.throughput_fg_color == 0);
29493         assert(d.throughput_bg_color == 0);
29494         assert(d.throughput_fg_bold == 0);
29495         assert(d.time_label_fg_color == 0);
29496         assert(d.time_label_bg_color == 0);
29497         assert(d.time_label_fg_bold == 0);
29498         assert(d.percent_fg_color == 0);
29499         assert(d.percent_bg_color == 0);
29500         assert(d.percent_fg_bold == 0);
29501         assert(d.barbrace_fg_color == 0);
29502         assert(d.barbrace_bg_color == 0);
29503         assert(d.barbrace_fg_bold == 0);
29504         assert(d.bar_fg_color == 0);
29505         assert(d.bar_bg_color == 0);
29506         assert(d.bar_fg_bold == 0);
29507         assert(io.in == 0);
29508         assert(io.out == 1);
29509         assert(io.in_ready == 0);
29510         assert(io.out_ready == 0);
29511         assert(io.eof_in == 0);
29512         assert(io.eof_out == 0);
29513         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29514         /* assert(io.cbuf == 0x0); */
29515         assert(io.last_read == 0);
29516         assert(io.last_write == 0);
29517         assert(io.total_read == 0);
29518         assert(io.total_write == 0);
29519         assert(io.total_size == 0);
29520         assert(io.total_size_known == 0);
29521         assert(io.timeout == 250000);
29522 
29523         tmp_rcfile = fopen("test-rcfile.txt", "w");
29524         assert(tmp_rcfile != 0);
29525         fprintf(tmp_rcfile, "twiddle-background: green");
29526         fclose(tmp_rcfile);
29527 
29528         clear_errno();
29529         assert(test_parse_rc(out,0));
29530 
29531 #ifdef PRINT_DEBUG
29532         print();
29533 #endif
29534         assert(d.start_time == 0);
29535         assert(d.total_time == 0);
29536         assert(d.current_time == 0);
29537         assert(d.elapsed_time == 0);
29538         assert(d.percent_complete == 0);
29539         assert(d.display_interval == 1);
29540         assert(d.overtime_flag == 0);
29541         assert(d.k == 1024);
29542         assert(d.twiddle == '-');
29543         assert(d.manual_width == 0);
29544         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29545         assert(d.display_datacount == 1);
29546         assert(d.display_throughput == 1);
29547         assert(d.display_time == 1);
29548         assert(d.display_percent == 1);
29549         assert(d.display_bar == 1);
29550         assert(d.display_summary == 1);
29551         assert(d.display_ansi == 0);
29552         assert(d.twiddle_fg_color == 0);
29553         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
29554         assert(d.twiddle_fg_bold == 0);
29555         assert(d.datacount_fg_color == 0);
29556         assert(d.datacount_bg_color == 0);
29557         assert(d.datacount_fg_bold == 0);
29558         assert(d.throughput_label_fg_color == 0);
29559         assert(d.throughput_label_bg_color == 0);
29560         assert(d.throughput_label_fg_bold == 0);
29561         assert(d.throughput_fg_color == 0);
29562         assert(d.throughput_bg_color == 0);
29563         assert(d.throughput_fg_bold == 0);
29564         assert(d.time_label_fg_color == 0);
29565         assert(d.time_label_bg_color == 0);
29566         assert(d.time_label_fg_bold == 0);
29567         assert(d.percent_fg_color == 0);
29568         assert(d.percent_bg_color == 0);
29569         assert(d.percent_fg_bold == 0);
29570         assert(d.barbrace_fg_color == 0);
29571         assert(d.barbrace_bg_color == 0);
29572         assert(d.barbrace_fg_bold == 0);
29573         assert(d.bar_fg_color == 0);
29574         assert(d.bar_bg_color == 0);
29575         assert(d.bar_fg_bold == 0);
29576         assert(io.in == 0);
29577         assert(io.out == 1);
29578         assert(io.in_ready == 0);
29579         assert(io.out_ready == 0);
29580         assert(io.eof_in == 0);
29581         assert(io.eof_out == 0);
29582         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29583         /* assert(io.cbuf == 0x0); */
29584         assert(io.last_read == 0);
29585         assert(io.last_write == 0);
29586         assert(io.total_read == 0);
29587         assert(io.total_write == 0);
29588         assert(io.total_size == 0);
29589         assert(io.total_size_known == 0);
29590         assert(io.timeout == 250000);
29591 
29592         tmp_rcfile = fopen("test-rcfile.txt", "w");
29593         assert(tmp_rcfile != 0);
29594         fprintf(tmp_rcfile, "twiddle-background: yellow");
29595         fclose(tmp_rcfile);
29596 
29597         clear_errno();
29598         assert(test_parse_rc(out,0));
29599 
29600 #ifdef PRINT_DEBUG
29601         print();
29602 #endif
29603         assert(d.start_time == 0);
29604         assert(d.total_time == 0);
29605         assert(d.current_time == 0);
29606         assert(d.elapsed_time == 0);
29607         assert(d.percent_complete == 0);
29608         assert(d.display_interval == 1);
29609         assert(d.overtime_flag == 0);
29610         assert(d.k == 1024);
29611         assert(d.twiddle == '-');
29612         assert(d.manual_width == 0);
29613         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29614         assert(d.display_datacount == 1);
29615         assert(d.display_throughput == 1);
29616         assert(d.display_time == 1);
29617         assert(d.display_percent == 1);
29618         assert(d.display_bar == 1);
29619         assert(d.display_summary == 1);
29620         assert(d.display_ansi == 0);
29621         assert(d.twiddle_fg_color == 0);
29622         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
29623         assert(d.twiddle_fg_bold == 0);
29624         assert(d.datacount_fg_color == 0);
29625         assert(d.datacount_bg_color == 0);
29626         assert(d.datacount_fg_bold == 0);
29627         assert(d.throughput_label_fg_color == 0);
29628         assert(d.throughput_label_bg_color == 0);
29629         assert(d.throughput_label_fg_bold == 0);
29630         assert(d.throughput_fg_color == 0);
29631         assert(d.throughput_bg_color == 0);
29632         assert(d.throughput_fg_bold == 0);
29633         assert(d.time_label_fg_color == 0);
29634         assert(d.time_label_bg_color == 0);
29635         assert(d.time_label_fg_bold == 0);
29636         assert(d.percent_fg_color == 0);
29637         assert(d.percent_bg_color == 0);
29638         assert(d.percent_fg_bold == 0);
29639         assert(d.barbrace_fg_color == 0);
29640         assert(d.barbrace_bg_color == 0);
29641         assert(d.barbrace_fg_bold == 0);
29642         assert(d.bar_fg_color == 0);
29643         assert(d.bar_bg_color == 0);
29644         assert(d.bar_fg_bold == 0);
29645         assert(io.in == 0);
29646         assert(io.out == 1);
29647         assert(io.in_ready == 0);
29648         assert(io.out_ready == 0);
29649         assert(io.eof_in == 0);
29650         assert(io.eof_out == 0);
29651         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29652         /* assert(io.cbuf == 0x0); */
29653         assert(io.last_read == 0);
29654         assert(io.last_write == 0);
29655         assert(io.total_read == 0);
29656         assert(io.total_write == 0);
29657         assert(io.total_size == 0);
29658         assert(io.total_size_known == 0);
29659         assert(io.timeout == 250000);
29660 
29661         tmp_rcfile = fopen("test-rcfile.txt", "w");
29662         assert(tmp_rcfile != 0);
29663         fprintf(tmp_rcfile, "twiddle-background: blue");
29664         fclose(tmp_rcfile);
29665 
29666         clear_errno();
29667         assert(test_parse_rc(out,0));
29668 
29669 #ifdef PRINT_DEBUG
29670         print();
29671 #endif
29672         assert(d.start_time == 0);
29673         assert(d.total_time == 0);
29674         assert(d.current_time == 0);
29675         assert(d.elapsed_time == 0);
29676         assert(d.percent_complete == 0);
29677         assert(d.display_interval == 1);
29678         assert(d.overtime_flag == 0);
29679         assert(d.k == 1024);
29680         assert(d.twiddle == '-');
29681         assert(d.manual_width == 0);
29682         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29683         assert(d.display_datacount == 1);
29684         assert(d.display_throughput == 1);
29685         assert(d.display_time == 1);
29686         assert(d.display_percent == 1);
29687         assert(d.display_bar == 1);
29688         assert(d.display_summary == 1);
29689         assert(d.display_ansi == 0);
29690         assert(d.twiddle_fg_color == 0);
29691         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
29692         assert(d.twiddle_fg_bold == 0);
29693         assert(d.datacount_fg_color == 0);
29694         assert(d.datacount_bg_color == 0);
29695         assert(d.datacount_fg_bold == 0);
29696         assert(d.throughput_label_fg_color == 0);
29697         assert(d.throughput_label_bg_color == 0);
29698         assert(d.throughput_label_fg_bold == 0);
29699         assert(d.throughput_fg_color == 0);
29700         assert(d.throughput_bg_color == 0);
29701         assert(d.throughput_fg_bold == 0);
29702         assert(d.time_label_fg_color == 0);
29703         assert(d.time_label_bg_color == 0);
29704         assert(d.time_label_fg_bold == 0);
29705         assert(d.percent_fg_color == 0);
29706         assert(d.percent_bg_color == 0);
29707         assert(d.percent_fg_bold == 0);
29708         assert(d.barbrace_fg_color == 0);
29709         assert(d.barbrace_bg_color == 0);
29710         assert(d.barbrace_fg_bold == 0);
29711         assert(d.bar_fg_color == 0);
29712         assert(d.bar_bg_color == 0);
29713         assert(d.bar_fg_bold == 0);
29714         assert(io.in == 0);
29715         assert(io.out == 1);
29716         assert(io.in_ready == 0);
29717         assert(io.out_ready == 0);
29718         assert(io.eof_in == 0);
29719         assert(io.eof_out == 0);
29720         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29721         /* assert(io.cbuf == 0x0); */
29722         assert(io.last_read == 0);
29723         assert(io.last_write == 0);
29724         assert(io.total_read == 0);
29725         assert(io.total_write == 0);
29726         assert(io.total_size == 0);
29727         assert(io.total_size_known == 0);
29728         assert(io.timeout == 250000);
29729 
29730         tmp_rcfile = fopen("test-rcfile.txt", "w");
29731         assert(tmp_rcfile != 0);
29732         fprintf(tmp_rcfile, "twiddle-background: magenta");
29733         fclose(tmp_rcfile);
29734 
29735         clear_errno();
29736         assert(test_parse_rc(out,0));
29737 
29738 #ifdef PRINT_DEBUG
29739         print();
29740 #endif
29741         assert(d.start_time == 0);
29742         assert(d.total_time == 0);
29743         assert(d.current_time == 0);
29744         assert(d.elapsed_time == 0);
29745         assert(d.percent_complete == 0);
29746         assert(d.display_interval == 1);
29747         assert(d.overtime_flag == 0);
29748         assert(d.k == 1024);
29749         assert(d.twiddle == '-');
29750         assert(d.manual_width == 0);
29751         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29752         assert(d.display_datacount == 1);
29753         assert(d.display_throughput == 1);
29754         assert(d.display_time == 1);
29755         assert(d.display_percent == 1);
29756         assert(d.display_bar == 1);
29757         assert(d.display_summary == 1);
29758         assert(d.display_ansi == 0);
29759         assert(d.twiddle_fg_color == 0);
29760         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
29761         assert(d.twiddle_fg_bold == 0);
29762         assert(d.datacount_fg_color == 0);
29763         assert(d.datacount_bg_color == 0);
29764         assert(d.datacount_fg_bold == 0);
29765         assert(d.throughput_label_fg_color == 0);
29766         assert(d.throughput_label_bg_color == 0);
29767         assert(d.throughput_label_fg_bold == 0);
29768         assert(d.throughput_fg_color == 0);
29769         assert(d.throughput_bg_color == 0);
29770         assert(d.throughput_fg_bold == 0);
29771         assert(d.time_label_fg_color == 0);
29772         assert(d.time_label_bg_color == 0);
29773         assert(d.time_label_fg_bold == 0);
29774         assert(d.percent_fg_color == 0);
29775         assert(d.percent_bg_color == 0);
29776         assert(d.percent_fg_bold == 0);
29777         assert(d.barbrace_fg_color == 0);
29778         assert(d.barbrace_bg_color == 0);
29779         assert(d.barbrace_fg_bold == 0);
29780         assert(d.bar_fg_color == 0);
29781         assert(d.bar_bg_color == 0);
29782         assert(d.bar_fg_bold == 0);
29783         assert(io.in == 0);
29784         assert(io.out == 1);
29785         assert(io.in_ready == 0);
29786         assert(io.out_ready == 0);
29787         assert(io.eof_in == 0);
29788         assert(io.eof_out == 0);
29789         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29790         /* assert(io.cbuf == 0x0); */
29791         assert(io.last_read == 0);
29792         assert(io.last_write == 0);
29793         assert(io.total_read == 0);
29794         assert(io.total_write == 0);
29795         assert(io.total_size == 0);
29796         assert(io.total_size_known == 0);
29797         assert(io.timeout == 250000);
29798 
29799         tmp_rcfile = fopen("test-rcfile.txt", "w");
29800         assert(tmp_rcfile != 0);
29801         fprintf(tmp_rcfile, "twiddle-background: cyan");
29802         fclose(tmp_rcfile);
29803 
29804         clear_errno();
29805         assert(test_parse_rc(out,0));
29806 
29807 #ifdef PRINT_DEBUG
29808         print();
29809 #endif
29810         assert(d.start_time == 0);
29811         assert(d.total_time == 0);
29812         assert(d.current_time == 0);
29813         assert(d.elapsed_time == 0);
29814         assert(d.percent_complete == 0);
29815         assert(d.display_interval == 1);
29816         assert(d.overtime_flag == 0);
29817         assert(d.k == 1024);
29818         assert(d.twiddle == '-');
29819         assert(d.manual_width == 0);
29820         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29821         assert(d.display_datacount == 1);
29822         assert(d.display_throughput == 1);
29823         assert(d.display_time == 1);
29824         assert(d.display_percent == 1);
29825         assert(d.display_bar == 1);
29826         assert(d.display_summary == 1);
29827         assert(d.display_ansi == 0);
29828         assert(d.twiddle_fg_color == 0);
29829         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
29830         assert(d.twiddle_fg_bold == 0);
29831         assert(d.datacount_fg_color == 0);
29832         assert(d.datacount_bg_color == 0);
29833         assert(d.datacount_fg_bold == 0);
29834         assert(d.throughput_label_fg_color == 0);
29835         assert(d.throughput_label_bg_color == 0);
29836         assert(d.throughput_label_fg_bold == 0);
29837         assert(d.throughput_fg_color == 0);
29838         assert(d.throughput_bg_color == 0);
29839         assert(d.throughput_fg_bold == 0);
29840         assert(d.time_label_fg_color == 0);
29841         assert(d.time_label_bg_color == 0);
29842         assert(d.time_label_fg_bold == 0);
29843         assert(d.percent_fg_color == 0);
29844         assert(d.percent_bg_color == 0);
29845         assert(d.percent_fg_bold == 0);
29846         assert(d.barbrace_fg_color == 0);
29847         assert(d.barbrace_bg_color == 0);
29848         assert(d.barbrace_fg_bold == 0);
29849         assert(d.bar_fg_color == 0);
29850         assert(d.bar_bg_color == 0);
29851         assert(d.bar_fg_bold == 0);
29852         assert(io.in == 0);
29853         assert(io.out == 1);
29854         assert(io.in_ready == 0);
29855         assert(io.out_ready == 0);
29856         assert(io.eof_in == 0);
29857         assert(io.eof_out == 0);
29858         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29859         /* assert(io.cbuf == 0x0); */
29860         assert(io.last_read == 0);
29861         assert(io.last_write == 0);
29862         assert(io.total_read == 0);
29863         assert(io.total_write == 0);
29864         assert(io.total_size == 0);
29865         assert(io.total_size_known == 0);
29866         assert(io.timeout == 250000);
29867 
29868         tmp_rcfile = fopen("test-rcfile.txt", "w");
29869         assert(tmp_rcfile != 0);
29870         fprintf(tmp_rcfile, "twiddle-background: white");
29871         fclose(tmp_rcfile);
29872 
29873         clear_errno();
29874         assert(test_parse_rc(out,0));
29875 
29876 #ifdef PRINT_DEBUG
29877         print();
29878 #endif
29879         assert(d.start_time == 0);
29880         assert(d.total_time == 0);
29881         assert(d.current_time == 0);
29882         assert(d.elapsed_time == 0);
29883         assert(d.percent_complete == 0);
29884         assert(d.display_interval == 1);
29885         assert(d.overtime_flag == 0);
29886         assert(d.k == 1024);
29887         assert(d.twiddle == '-');
29888         assert(d.manual_width == 0);
29889         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29890         assert(d.display_datacount == 1);
29891         assert(d.display_throughput == 1);
29892         assert(d.display_time == 1);
29893         assert(d.display_percent == 1);
29894         assert(d.display_bar == 1);
29895         assert(d.display_summary == 1);
29896         assert(d.display_ansi == 0);
29897         assert(d.twiddle_fg_color == 0);
29898         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
29899         assert(d.twiddle_fg_bold == 0);
29900         assert(d.datacount_fg_color == 0);
29901         assert(d.datacount_bg_color == 0);
29902         assert(d.datacount_fg_bold == 0);
29903         assert(d.throughput_label_fg_color == 0);
29904         assert(d.throughput_label_bg_color == 0);
29905         assert(d.throughput_label_fg_bold == 0);
29906         assert(d.throughput_fg_color == 0);
29907         assert(d.throughput_bg_color == 0);
29908         assert(d.throughput_fg_bold == 0);
29909         assert(d.time_label_fg_color == 0);
29910         assert(d.time_label_bg_color == 0);
29911         assert(d.time_label_fg_bold == 0);
29912         assert(d.percent_fg_color == 0);
29913         assert(d.percent_bg_color == 0);
29914         assert(d.percent_fg_bold == 0);
29915         assert(d.barbrace_fg_color == 0);
29916         assert(d.barbrace_bg_color == 0);
29917         assert(d.barbrace_fg_bold == 0);
29918         assert(d.bar_fg_color == 0);
29919         assert(d.bar_bg_color == 0);
29920         assert(d.bar_fg_bold == 0);
29921         assert(io.in == 0);
29922         assert(io.out == 1);
29923         assert(io.in_ready == 0);
29924         assert(io.out_ready == 0);
29925         assert(io.eof_in == 0);
29926         assert(io.eof_out == 0);
29927         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29928         /* assert(io.cbuf == 0x0); */
29929         assert(io.last_read == 0);
29930         assert(io.last_write == 0);
29931         assert(io.total_read == 0);
29932         assert(io.total_write == 0);
29933         assert(io.total_size == 0);
29934         assert(io.total_size_known == 0);
29935         assert(io.timeout == 250000);
29936 
29937         tmp_rcfile = fopen("test-rcfile.txt", "w");
29938         assert(tmp_rcfile != 0);
29939         fprintf(tmp_rcfile, "twiddle-background: normal");
29940         fclose(tmp_rcfile);
29941 
29942         clear_errno();
29943         assert(test_parse_rc(out,0));
29944 
29945 #ifdef PRINT_DEBUG
29946         print();
29947 #endif
29948         assert(d.start_time == 0);
29949         assert(d.total_time == 0);
29950         assert(d.current_time == 0);
29951         assert(d.elapsed_time == 0);
29952         assert(d.percent_complete == 0);
29953         assert(d.display_interval == 1);
29954         assert(d.overtime_flag == 0);
29955         assert(d.k == 1024);
29956         assert(d.twiddle == '-');
29957         assert(d.manual_width == 0);
29958         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
29959         assert(d.display_datacount == 1);
29960         assert(d.display_throughput == 1);
29961         assert(d.display_time == 1);
29962         assert(d.display_percent == 1);
29963         assert(d.display_bar == 1);
29964         assert(d.display_summary == 1);
29965         assert(d.display_ansi == 0);
29966         assert(d.twiddle_fg_color == 0);
29967         assert(d.twiddle_bg_color == 0);
29968         assert(d.twiddle_fg_bold == 0);
29969         assert(d.datacount_fg_color == 0);
29970         assert(d.datacount_bg_color == 0);
29971         assert(d.datacount_fg_bold == 0);
29972         assert(d.throughput_label_fg_color == 0);
29973         assert(d.throughput_label_bg_color == 0);
29974         assert(d.throughput_label_fg_bold == 0);
29975         assert(d.throughput_fg_color == 0);
29976         assert(d.throughput_bg_color == 0);
29977         assert(d.throughput_fg_bold == 0);
29978         assert(d.time_label_fg_color == 0);
29979         assert(d.time_label_bg_color == 0);
29980         assert(d.time_label_fg_bold == 0);
29981         assert(d.percent_fg_color == 0);
29982         assert(d.percent_bg_color == 0);
29983         assert(d.percent_fg_bold == 0);
29984         assert(d.barbrace_fg_color == 0);
29985         assert(d.barbrace_bg_color == 0);
29986         assert(d.barbrace_fg_bold == 0);
29987         assert(d.bar_fg_color == 0);
29988         assert(d.bar_bg_color == 0);
29989         assert(d.bar_fg_bold == 0);
29990         assert(io.in == 0);
29991         assert(io.out == 1);
29992         assert(io.in_ready == 0);
29993         assert(io.out_ready == 0);
29994         assert(io.eof_in == 0);
29995         assert(io.eof_out == 0);
29996         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
29997         /* assert(io.cbuf == 0x0); */
29998         assert(io.last_read == 0);
29999         assert(io.last_write == 0);
30000         assert(io.total_read == 0);
30001         assert(io.total_write == 0);
30002         assert(io.total_size == 0);
30003         assert(io.total_size_known == 0);
30004         assert(io.timeout == 250000);
30005 
30006         tmp_rcfile = fopen("test-rcfile.txt", "w");
30007         assert(tmp_rcfile != 0);
30008         fprintf(tmp_rcfile, "twiddle-bold: Sjkhg");
30009         fclose(tmp_rcfile);
30010 
30011         clear_errno();
30012         assert(test_parse_rc(out,1));
30013 
30014 #ifdef PRINT_DEBUG
30015         print();
30016 #endif
30017         assert(d.start_time == 0);
30018         assert(d.total_time == 0);
30019         assert(d.current_time == 0);
30020         assert(d.elapsed_time == 0);
30021         assert(d.percent_complete == 0);
30022         assert(d.display_interval == 1);
30023         assert(d.overtime_flag == 0);
30024         assert(d.k == 1024);
30025         assert(d.twiddle == '-');
30026         assert(d.manual_width == 0);
30027         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30028         assert(d.display_datacount == 1);
30029         assert(d.display_throughput == 1);
30030         assert(d.display_time == 1);
30031         assert(d.display_percent == 1);
30032         assert(d.display_bar == 1);
30033         assert(d.display_summary == 1);
30034         assert(d.display_ansi == 0);
30035         assert(d.twiddle_fg_color == 0);
30036         assert(d.twiddle_bg_color == 0);
30037         assert(d.twiddle_fg_bold == 0);
30038         assert(d.datacount_fg_color == 0);
30039         assert(d.datacount_bg_color == 0);
30040         assert(d.datacount_fg_bold == 0);
30041         assert(d.throughput_label_fg_color == 0);
30042         assert(d.throughput_label_bg_color == 0);
30043         assert(d.throughput_label_fg_bold == 0);
30044         assert(d.throughput_fg_color == 0);
30045         assert(d.throughput_bg_color == 0);
30046         assert(d.throughput_fg_bold == 0);
30047         assert(d.time_label_fg_color == 0);
30048         assert(d.time_label_bg_color == 0);
30049         assert(d.time_label_fg_bold == 0);
30050         assert(d.percent_fg_color == 0);
30051         assert(d.percent_bg_color == 0);
30052         assert(d.percent_fg_bold == 0);
30053         assert(d.barbrace_fg_color == 0);
30054         assert(d.barbrace_bg_color == 0);
30055         assert(d.barbrace_fg_bold == 0);
30056         assert(d.bar_fg_color == 0);
30057         assert(d.bar_bg_color == 0);
30058         assert(d.bar_fg_bold == 0);
30059         assert(io.in == 0);
30060         assert(io.out == 1);
30061         assert(io.in_ready == 0);
30062         assert(io.out_ready == 0);
30063         assert(io.eof_in == 0);
30064         assert(io.eof_out == 0);
30065         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30066         /* assert(io.cbuf == 0x0); */
30067         assert(io.last_read == 0);
30068         assert(io.last_write == 0);
30069         assert(io.total_read == 0);
30070         assert(io.total_write == 0);
30071         assert(io.total_size == 0);
30072         assert(io.total_size_known == 0);
30073         assert(io.timeout == 250000);
30074 
30075         tmp_rcfile = fopen("test-rcfile.txt", "w");
30076         assert(tmp_rcfile != 0);
30077         fprintf(tmp_rcfile, "twiddle-bold: no");
30078         fclose(tmp_rcfile);
30079 
30080         clear_errno();
30081         assert(test_parse_rc(out,0));
30082 
30083 #ifdef PRINT_DEBUG
30084         print();
30085 #endif
30086         assert(d.start_time == 0);
30087         assert(d.total_time == 0);
30088         assert(d.current_time == 0);
30089         assert(d.elapsed_time == 0);
30090         assert(d.percent_complete == 0);
30091         assert(d.display_interval == 1);
30092         assert(d.overtime_flag == 0);
30093         assert(d.k == 1024);
30094         assert(d.twiddle == '-');
30095         assert(d.manual_width == 0);
30096         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30097         assert(d.display_datacount == 1);
30098         assert(d.display_throughput == 1);
30099         assert(d.display_time == 1);
30100         assert(d.display_percent == 1);
30101         assert(d.display_bar == 1);
30102         assert(d.display_summary == 1);
30103         assert(d.display_ansi == 0);
30104         assert(d.twiddle_fg_color == 0);
30105         assert(d.twiddle_bg_color == 0);
30106         assert(d.twiddle_fg_bold == 0);
30107         assert(d.datacount_fg_color == 0);
30108         assert(d.datacount_bg_color == 0);
30109         assert(d.datacount_fg_bold == 0);
30110         assert(d.throughput_label_fg_color == 0);
30111         assert(d.throughput_label_bg_color == 0);
30112         assert(d.throughput_label_fg_bold == 0);
30113         assert(d.throughput_fg_color == 0);
30114         assert(d.throughput_bg_color == 0);
30115         assert(d.throughput_fg_bold == 0);
30116         assert(d.time_label_fg_color == 0);
30117         assert(d.time_label_bg_color == 0);
30118         assert(d.time_label_fg_bold == 0);
30119         assert(d.percent_fg_color == 0);
30120         assert(d.percent_bg_color == 0);
30121         assert(d.percent_fg_bold == 0);
30122         assert(d.barbrace_fg_color == 0);
30123         assert(d.barbrace_bg_color == 0);
30124         assert(d.barbrace_fg_bold == 0);
30125         assert(d.bar_fg_color == 0);
30126         assert(d.bar_bg_color == 0);
30127         assert(d.bar_fg_bold == 0);
30128         assert(io.in == 0);
30129         assert(io.out == 1);
30130         assert(io.in_ready == 0);
30131         assert(io.out_ready == 0);
30132         assert(io.eof_in == 0);
30133         assert(io.eof_out == 0);
30134         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30135         /* assert(io.cbuf == 0x0); */
30136         assert(io.last_read == 0);
30137         assert(io.last_write == 0);
30138         assert(io.total_read == 0);
30139         assert(io.total_write == 0);
30140         assert(io.total_size == 0);
30141         assert(io.total_size_known == 0);
30142         assert(io.timeout == 250000);
30143 
30144         tmp_rcfile = fopen("test-rcfile.txt", "w");
30145         assert(tmp_rcfile != 0);
30146         fprintf(tmp_rcfile, "twiddle-bold: yes");
30147         fclose(tmp_rcfile);
30148 
30149         clear_errno();
30150         assert(test_parse_rc(out,0));
30151 
30152 #ifdef PRINT_DEBUG
30153         print();
30154 #endif
30155         assert(d.start_time == 0);
30156         assert(d.total_time == 0);
30157         assert(d.current_time == 0);
30158         assert(d.elapsed_time == 0);
30159         assert(d.percent_complete == 0);
30160         assert(d.display_interval == 1);
30161         assert(d.overtime_flag == 0);
30162         assert(d.k == 1024);
30163         assert(d.twiddle == '-');
30164         assert(d.manual_width == 0);
30165         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30166         assert(d.display_datacount == 1);
30167         assert(d.display_throughput == 1);
30168         assert(d.display_time == 1);
30169         assert(d.display_percent == 1);
30170         assert(d.display_bar == 1);
30171         assert(d.display_summary == 1);
30172         assert(d.display_ansi == 0);
30173         assert(d.twiddle_fg_color == 0);
30174         assert(d.twiddle_bg_color == 0);
30175         assert(d.twiddle_fg_bold == 1);
30176         assert(d.datacount_fg_color == 0);
30177         assert(d.datacount_bg_color == 0);
30178         assert(d.datacount_fg_bold == 0);
30179         assert(d.throughput_label_fg_color == 0);
30180         assert(d.throughput_label_bg_color == 0);
30181         assert(d.throughput_label_fg_bold == 0);
30182         assert(d.throughput_fg_color == 0);
30183         assert(d.throughput_bg_color == 0);
30184         assert(d.throughput_fg_bold == 0);
30185         assert(d.time_label_fg_color == 0);
30186         assert(d.time_label_bg_color == 0);
30187         assert(d.time_label_fg_bold == 0);
30188         assert(d.percent_fg_color == 0);
30189         assert(d.percent_bg_color == 0);
30190         assert(d.percent_fg_bold == 0);
30191         assert(d.barbrace_fg_color == 0);
30192         assert(d.barbrace_bg_color == 0);
30193         assert(d.barbrace_fg_bold == 0);
30194         assert(d.bar_fg_color == 0);
30195         assert(d.bar_bg_color == 0);
30196         assert(d.bar_fg_bold == 0);
30197         assert(io.in == 0);
30198         assert(io.out == 1);
30199         assert(io.in_ready == 0);
30200         assert(io.out_ready == 0);
30201         assert(io.eof_in == 0);
30202         assert(io.eof_out == 0);
30203         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30204         /* assert(io.cbuf == 0x0); */
30205         assert(io.last_read == 0);
30206         assert(io.last_write == 0);
30207         assert(io.total_read == 0);
30208         assert(io.total_write == 0);
30209         assert(io.total_size == 0);
30210         assert(io.total_size_known == 0);
30211         assert(io.timeout == 250000);
30212 
30213         tmp_rcfile = fopen("test-rcfile.txt", "w");
30214         assert(tmp_rcfile != 0);
30215         fprintf(tmp_rcfile, "twiddle-bold: n");
30216         fclose(tmp_rcfile);
30217 
30218         clear_errno();
30219         assert(test_parse_rc(out,0));
30220 
30221 #ifdef PRINT_DEBUG
30222         print();
30223 #endif
30224         assert(d.start_time == 0);
30225         assert(d.total_time == 0);
30226         assert(d.current_time == 0);
30227         assert(d.elapsed_time == 0);
30228         assert(d.percent_complete == 0);
30229         assert(d.display_interval == 1);
30230         assert(d.overtime_flag == 0);
30231         assert(d.k == 1024);
30232         assert(d.twiddle == '-');
30233         assert(d.manual_width == 0);
30234         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30235         assert(d.display_datacount == 1);
30236         assert(d.display_throughput == 1);
30237         assert(d.display_time == 1);
30238         assert(d.display_percent == 1);
30239         assert(d.display_bar == 1);
30240         assert(d.display_summary == 1);
30241         assert(d.display_ansi == 0);
30242         assert(d.twiddle_fg_color == 0);
30243         assert(d.twiddle_bg_color == 0);
30244         assert(d.twiddle_fg_bold == 0);
30245         assert(d.datacount_fg_color == 0);
30246         assert(d.datacount_bg_color == 0);
30247         assert(d.datacount_fg_bold == 0);
30248         assert(d.throughput_label_fg_color == 0);
30249         assert(d.throughput_label_bg_color == 0);
30250         assert(d.throughput_label_fg_bold == 0);
30251         assert(d.throughput_fg_color == 0);
30252         assert(d.throughput_bg_color == 0);
30253         assert(d.throughput_fg_bold == 0);
30254         assert(d.time_label_fg_color == 0);
30255         assert(d.time_label_bg_color == 0);
30256         assert(d.time_label_fg_bold == 0);
30257         assert(d.percent_fg_color == 0);
30258         assert(d.percent_bg_color == 0);
30259         assert(d.percent_fg_bold == 0);
30260         assert(d.barbrace_fg_color == 0);
30261         assert(d.barbrace_bg_color == 0);
30262         assert(d.barbrace_fg_bold == 0);
30263         assert(d.bar_fg_color == 0);
30264         assert(d.bar_bg_color == 0);
30265         assert(d.bar_fg_bold == 0);
30266         assert(io.in == 0);
30267         assert(io.out == 1);
30268         assert(io.in_ready == 0);
30269         assert(io.out_ready == 0);
30270         assert(io.eof_in == 0);
30271         assert(io.eof_out == 0);
30272         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30273         /* assert(io.cbuf == 0x0); */
30274         assert(io.last_read == 0);
30275         assert(io.last_write == 0);
30276         assert(io.total_read == 0);
30277         assert(io.total_write == 0);
30278         assert(io.total_size == 0);
30279         assert(io.total_size_known == 0);
30280         assert(io.timeout == 250000);
30281 
30282         tmp_rcfile = fopen("test-rcfile.txt", "w");
30283         assert(tmp_rcfile != 0);
30284         fprintf(tmp_rcfile, "twiddle-bold: y");
30285         fclose(tmp_rcfile);
30286 
30287         clear_errno();
30288         assert(test_parse_rc(out,0));
30289 
30290 #ifdef PRINT_DEBUG
30291         print();
30292 #endif
30293         assert(d.start_time == 0);
30294         assert(d.total_time == 0);
30295         assert(d.current_time == 0);
30296         assert(d.elapsed_time == 0);
30297         assert(d.percent_complete == 0);
30298         assert(d.display_interval == 1);
30299         assert(d.overtime_flag == 0);
30300         assert(d.k == 1024);
30301         assert(d.twiddle == '-');
30302         assert(d.manual_width == 0);
30303         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30304         assert(d.display_datacount == 1);
30305         assert(d.display_throughput == 1);
30306         assert(d.display_time == 1);
30307         assert(d.display_percent == 1);
30308         assert(d.display_bar == 1);
30309         assert(d.display_summary == 1);
30310         assert(d.display_ansi == 0);
30311         assert(d.twiddle_fg_color == 0);
30312         assert(d.twiddle_bg_color == 0);
30313         assert(d.twiddle_fg_bold == 1);
30314         assert(d.datacount_fg_color == 0);
30315         assert(d.datacount_bg_color == 0);
30316         assert(d.datacount_fg_bold == 0);
30317         assert(d.throughput_label_fg_color == 0);
30318         assert(d.throughput_label_bg_color == 0);
30319         assert(d.throughput_label_fg_bold == 0);
30320         assert(d.throughput_fg_color == 0);
30321         assert(d.throughput_bg_color == 0);
30322         assert(d.throughput_fg_bold == 0);
30323         assert(d.time_label_fg_color == 0);
30324         assert(d.time_label_bg_color == 0);
30325         assert(d.time_label_fg_bold == 0);
30326         assert(d.percent_fg_color == 0);
30327         assert(d.percent_bg_color == 0);
30328         assert(d.percent_fg_bold == 0);
30329         assert(d.barbrace_fg_color == 0);
30330         assert(d.barbrace_bg_color == 0);
30331         assert(d.barbrace_fg_bold == 0);
30332         assert(d.bar_fg_color == 0);
30333         assert(d.bar_bg_color == 0);
30334         assert(d.bar_fg_bold == 0);
30335         assert(io.in == 0);
30336         assert(io.out == 1);
30337         assert(io.in_ready == 0);
30338         assert(io.out_ready == 0);
30339         assert(io.eof_in == 0);
30340         assert(io.eof_out == 0);
30341         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30342         /* assert(io.cbuf == 0x0); */
30343         assert(io.last_read == 0);
30344         assert(io.last_write == 0);
30345         assert(io.total_read == 0);
30346         assert(io.total_write == 0);
30347         assert(io.total_size == 0);
30348         assert(io.total_size_known == 0);
30349         assert(io.timeout == 250000);
30350 
30351         tmp_rcfile = fopen("test-rcfile.txt", "w");
30352         assert(tmp_rcfile != 0);
30353         fprintf(tmp_rcfile, "twiddle-bold: false");
30354         fclose(tmp_rcfile);
30355 
30356         clear_errno();
30357         assert(test_parse_rc(out,0));
30358 
30359 #ifdef PRINT_DEBUG
30360         print();
30361 #endif
30362         assert(d.start_time == 0);
30363         assert(d.total_time == 0);
30364         assert(d.current_time == 0);
30365         assert(d.elapsed_time == 0);
30366         assert(d.percent_complete == 0);
30367         assert(d.display_interval == 1);
30368         assert(d.overtime_flag == 0);
30369         assert(d.k == 1024);
30370         assert(d.twiddle == '-');
30371         assert(d.manual_width == 0);
30372         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30373         assert(d.display_datacount == 1);
30374         assert(d.display_throughput == 1);
30375         assert(d.display_time == 1);
30376         assert(d.display_percent == 1);
30377         assert(d.display_bar == 1);
30378         assert(d.display_summary == 1);
30379         assert(d.display_ansi == 0);
30380         assert(d.twiddle_fg_color == 0);
30381         assert(d.twiddle_bg_color == 0);
30382         assert(d.twiddle_fg_bold == 0);
30383         assert(d.datacount_fg_color == 0);
30384         assert(d.datacount_bg_color == 0);
30385         assert(d.datacount_fg_bold == 0);
30386         assert(d.throughput_label_fg_color == 0);
30387         assert(d.throughput_label_bg_color == 0);
30388         assert(d.throughput_label_fg_bold == 0);
30389         assert(d.throughput_fg_color == 0);
30390         assert(d.throughput_bg_color == 0);
30391         assert(d.throughput_fg_bold == 0);
30392         assert(d.time_label_fg_color == 0);
30393         assert(d.time_label_bg_color == 0);
30394         assert(d.time_label_fg_bold == 0);
30395         assert(d.percent_fg_color == 0);
30396         assert(d.percent_bg_color == 0);
30397         assert(d.percent_fg_bold == 0);
30398         assert(d.barbrace_fg_color == 0);
30399         assert(d.barbrace_bg_color == 0);
30400         assert(d.barbrace_fg_bold == 0);
30401         assert(d.bar_fg_color == 0);
30402         assert(d.bar_bg_color == 0);
30403         assert(d.bar_fg_bold == 0);
30404         assert(io.in == 0);
30405         assert(io.out == 1);
30406         assert(io.in_ready == 0);
30407         assert(io.out_ready == 0);
30408         assert(io.eof_in == 0);
30409         assert(io.eof_out == 0);
30410         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30411         /* assert(io.cbuf == 0x0); */
30412         assert(io.last_read == 0);
30413         assert(io.last_write == 0);
30414         assert(io.total_read == 0);
30415         assert(io.total_write == 0);
30416         assert(io.total_size == 0);
30417         assert(io.total_size_known == 0);
30418         assert(io.timeout == 250000);
30419 
30420         tmp_rcfile = fopen("test-rcfile.txt", "w");
30421         assert(tmp_rcfile != 0);
30422         fprintf(tmp_rcfile, "twiddle-bold: true");
30423         fclose(tmp_rcfile);
30424 
30425         clear_errno();
30426         assert(test_parse_rc(out,0));
30427 
30428 #ifdef PRINT_DEBUG
30429         print();
30430 #endif
30431         assert(d.start_time == 0);
30432         assert(d.total_time == 0);
30433         assert(d.current_time == 0);
30434         assert(d.elapsed_time == 0);
30435         assert(d.percent_complete == 0);
30436         assert(d.display_interval == 1);
30437         assert(d.overtime_flag == 0);
30438         assert(d.k == 1024);
30439         assert(d.twiddle == '-');
30440         assert(d.manual_width == 0);
30441         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30442         assert(d.display_datacount == 1);
30443         assert(d.display_throughput == 1);
30444         assert(d.display_time == 1);
30445         assert(d.display_percent == 1);
30446         assert(d.display_bar == 1);
30447         assert(d.display_summary == 1);
30448         assert(d.display_ansi == 0);
30449         assert(d.twiddle_fg_color == 0);
30450         assert(d.twiddle_bg_color == 0);
30451         assert(d.twiddle_fg_bold == 1);
30452         assert(d.datacount_fg_color == 0);
30453         assert(d.datacount_bg_color == 0);
30454         assert(d.datacount_fg_bold == 0);
30455         assert(d.throughput_label_fg_color == 0);
30456         assert(d.throughput_label_bg_color == 0);
30457         assert(d.throughput_label_fg_bold == 0);
30458         assert(d.throughput_fg_color == 0);
30459         assert(d.throughput_bg_color == 0);
30460         assert(d.throughput_fg_bold == 0);
30461         assert(d.time_label_fg_color == 0);
30462         assert(d.time_label_bg_color == 0);
30463         assert(d.time_label_fg_bold == 0);
30464         assert(d.percent_fg_color == 0);
30465         assert(d.percent_bg_color == 0);
30466         assert(d.percent_fg_bold == 0);
30467         assert(d.barbrace_fg_color == 0);
30468         assert(d.barbrace_bg_color == 0);
30469         assert(d.barbrace_fg_bold == 0);
30470         assert(d.bar_fg_color == 0);
30471         assert(d.bar_bg_color == 0);
30472         assert(d.bar_fg_bold == 0);
30473         assert(io.in == 0);
30474         assert(io.out == 1);
30475         assert(io.in_ready == 0);
30476         assert(io.out_ready == 0);
30477         assert(io.eof_in == 0);
30478         assert(io.eof_out == 0);
30479         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30480         /* assert(io.cbuf == 0x0); */
30481         assert(io.last_read == 0);
30482         assert(io.last_write == 0);
30483         assert(io.total_read == 0);
30484         assert(io.total_write == 0);
30485         assert(io.total_size == 0);
30486         assert(io.total_size_known == 0);
30487         assert(io.timeout == 250000);
30488 
30489         tmp_rcfile = fopen("test-rcfile.txt", "w");
30490         assert(tmp_rcfile != 0);
30491         fprintf(tmp_rcfile, "twiddle-bold: f");
30492         fclose(tmp_rcfile);
30493 
30494         clear_errno();
30495         assert(test_parse_rc(out,0));
30496 
30497 #ifdef PRINT_DEBUG
30498         print();
30499 #endif
30500         assert(d.start_time == 0);
30501         assert(d.total_time == 0);
30502         assert(d.current_time == 0);
30503         assert(d.elapsed_time == 0);
30504         assert(d.percent_complete == 0);
30505         assert(d.display_interval == 1);
30506         assert(d.overtime_flag == 0);
30507         assert(d.k == 1024);
30508         assert(d.twiddle == '-');
30509         assert(d.manual_width == 0);
30510         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30511         assert(d.display_datacount == 1);
30512         assert(d.display_throughput == 1);
30513         assert(d.display_time == 1);
30514         assert(d.display_percent == 1);
30515         assert(d.display_bar == 1);
30516         assert(d.display_summary == 1);
30517         assert(d.display_ansi == 0);
30518         assert(d.twiddle_fg_color == 0);
30519         assert(d.twiddle_bg_color == 0);
30520         assert(d.twiddle_fg_bold == 0);
30521         assert(d.datacount_fg_color == 0);
30522         assert(d.datacount_bg_color == 0);
30523         assert(d.datacount_fg_bold == 0);
30524         assert(d.throughput_label_fg_color == 0);
30525         assert(d.throughput_label_bg_color == 0);
30526         assert(d.throughput_label_fg_bold == 0);
30527         assert(d.throughput_fg_color == 0);
30528         assert(d.throughput_bg_color == 0);
30529         assert(d.throughput_fg_bold == 0);
30530         assert(d.time_label_fg_color == 0);
30531         assert(d.time_label_bg_color == 0);
30532         assert(d.time_label_fg_bold == 0);
30533         assert(d.percent_fg_color == 0);
30534         assert(d.percent_bg_color == 0);
30535         assert(d.percent_fg_bold == 0);
30536         assert(d.barbrace_fg_color == 0);
30537         assert(d.barbrace_bg_color == 0);
30538         assert(d.barbrace_fg_bold == 0);
30539         assert(d.bar_fg_color == 0);
30540         assert(d.bar_bg_color == 0);
30541         assert(d.bar_fg_bold == 0);
30542         assert(io.in == 0);
30543         assert(io.out == 1);
30544         assert(io.in_ready == 0);
30545         assert(io.out_ready == 0);
30546         assert(io.eof_in == 0);
30547         assert(io.eof_out == 0);
30548         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30549         /* assert(io.cbuf == 0x0); */
30550         assert(io.last_read == 0);
30551         assert(io.last_write == 0);
30552         assert(io.total_read == 0);
30553         assert(io.total_write == 0);
30554         assert(io.total_size == 0);
30555         assert(io.total_size_known == 0);
30556         assert(io.timeout == 250000);
30557 
30558         tmp_rcfile = fopen("test-rcfile.txt", "w");
30559         assert(tmp_rcfile != 0);
30560         fprintf(tmp_rcfile, "twiddle-bold: t");
30561         fclose(tmp_rcfile);
30562 
30563         clear_errno();
30564         assert(test_parse_rc(out,0));
30565 
30566 #ifdef PRINT_DEBUG
30567         print();
30568 #endif
30569         assert(d.start_time == 0);
30570         assert(d.total_time == 0);
30571         assert(d.current_time == 0);
30572         assert(d.elapsed_time == 0);
30573         assert(d.percent_complete == 0);
30574         assert(d.display_interval == 1);
30575         assert(d.overtime_flag == 0);
30576         assert(d.k == 1024);
30577         assert(d.twiddle == '-');
30578         assert(d.manual_width == 0);
30579         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30580         assert(d.display_datacount == 1);
30581         assert(d.display_throughput == 1);
30582         assert(d.display_time == 1);
30583         assert(d.display_percent == 1);
30584         assert(d.display_bar == 1);
30585         assert(d.display_summary == 1);
30586         assert(d.display_ansi == 0);
30587         assert(d.twiddle_fg_color == 0);
30588         assert(d.twiddle_bg_color == 0);
30589         assert(d.twiddle_fg_bold == 1);
30590         assert(d.datacount_fg_color == 0);
30591         assert(d.datacount_bg_color == 0);
30592         assert(d.datacount_fg_bold == 0);
30593         assert(d.throughput_label_fg_color == 0);
30594         assert(d.throughput_label_bg_color == 0);
30595         assert(d.throughput_label_fg_bold == 0);
30596         assert(d.throughput_fg_color == 0);
30597         assert(d.throughput_bg_color == 0);
30598         assert(d.throughput_fg_bold == 0);
30599         assert(d.time_label_fg_color == 0);
30600         assert(d.time_label_bg_color == 0);
30601         assert(d.time_label_fg_bold == 0);
30602         assert(d.percent_fg_color == 0);
30603         assert(d.percent_bg_color == 0);
30604         assert(d.percent_fg_bold == 0);
30605         assert(d.barbrace_fg_color == 0);
30606         assert(d.barbrace_bg_color == 0);
30607         assert(d.barbrace_fg_bold == 0);
30608         assert(d.bar_fg_color == 0);
30609         assert(d.bar_bg_color == 0);
30610         assert(d.bar_fg_bold == 0);
30611         assert(io.in == 0);
30612         assert(io.out == 1);
30613         assert(io.in_ready == 0);
30614         assert(io.out_ready == 0);
30615         assert(io.eof_in == 0);
30616         assert(io.eof_out == 0);
30617         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30618         /* assert(io.cbuf == 0x0); */
30619         assert(io.last_read == 0);
30620         assert(io.last_write == 0);
30621         assert(io.total_read == 0);
30622         assert(io.total_write == 0);
30623         assert(io.total_size == 0);
30624         assert(io.total_size_known == 0);
30625         assert(io.timeout == 250000);
30626 
30627         tmp_rcfile = fopen("test-rcfile.txt", "w");
30628         assert(tmp_rcfile != 0);
30629         fprintf(tmp_rcfile, "twiddle-bold: 0");
30630         fclose(tmp_rcfile);
30631 
30632         clear_errno();
30633         assert(test_parse_rc(out,0));
30634 
30635 #ifdef PRINT_DEBUG
30636         print();
30637 #endif
30638         assert(d.start_time == 0);
30639         assert(d.total_time == 0);
30640         assert(d.current_time == 0);
30641         assert(d.elapsed_time == 0);
30642         assert(d.percent_complete == 0);
30643         assert(d.display_interval == 1);
30644         assert(d.overtime_flag == 0);
30645         assert(d.k == 1024);
30646         assert(d.twiddle == '-');
30647         assert(d.manual_width == 0);
30648         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30649         assert(d.display_datacount == 1);
30650         assert(d.display_throughput == 1);
30651         assert(d.display_time == 1);
30652         assert(d.display_percent == 1);
30653         assert(d.display_bar == 1);
30654         assert(d.display_summary == 1);
30655         assert(d.display_ansi == 0);
30656         assert(d.twiddle_fg_color == 0);
30657         assert(d.twiddle_bg_color == 0);
30658         assert(d.twiddle_fg_bold == 0);
30659         assert(d.datacount_fg_color == 0);
30660         assert(d.datacount_bg_color == 0);
30661         assert(d.datacount_fg_bold == 0);
30662         assert(d.throughput_label_fg_color == 0);
30663         assert(d.throughput_label_bg_color == 0);
30664         assert(d.throughput_label_fg_bold == 0);
30665         assert(d.throughput_fg_color == 0);
30666         assert(d.throughput_bg_color == 0);
30667         assert(d.throughput_fg_bold == 0);
30668         assert(d.time_label_fg_color == 0);
30669         assert(d.time_label_bg_color == 0);
30670         assert(d.time_label_fg_bold == 0);
30671         assert(d.percent_fg_color == 0);
30672         assert(d.percent_bg_color == 0);
30673         assert(d.percent_fg_bold == 0);
30674         assert(d.barbrace_fg_color == 0);
30675         assert(d.barbrace_bg_color == 0);
30676         assert(d.barbrace_fg_bold == 0);
30677         assert(d.bar_fg_color == 0);
30678         assert(d.bar_bg_color == 0);
30679         assert(d.bar_fg_bold == 0);
30680         assert(io.in == 0);
30681         assert(io.out == 1);
30682         assert(io.in_ready == 0);
30683         assert(io.out_ready == 0);
30684         assert(io.eof_in == 0);
30685         assert(io.eof_out == 0);
30686         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30687         /* assert(io.cbuf == 0x0); */
30688         assert(io.last_read == 0);
30689         assert(io.last_write == 0);
30690         assert(io.total_read == 0);
30691         assert(io.total_write == 0);
30692         assert(io.total_size == 0);
30693         assert(io.total_size_known == 0);
30694         assert(io.timeout == 250000);
30695 
30696         tmp_rcfile = fopen("test-rcfile.txt", "w");
30697         assert(tmp_rcfile != 0);
30698         fprintf(tmp_rcfile, "twiddle-bold: 1");
30699         fclose(tmp_rcfile);
30700 
30701         clear_errno();
30702         assert(test_parse_rc(out,0));
30703 
30704 #ifdef PRINT_DEBUG
30705         print();
30706 #endif
30707         assert(d.start_time == 0);
30708         assert(d.total_time == 0);
30709         assert(d.current_time == 0);
30710         assert(d.elapsed_time == 0);
30711         assert(d.percent_complete == 0);
30712         assert(d.display_interval == 1);
30713         assert(d.overtime_flag == 0);
30714         assert(d.k == 1024);
30715         assert(d.twiddle == '-');
30716         assert(d.manual_width == 0);
30717         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30718         assert(d.display_datacount == 1);
30719         assert(d.display_throughput == 1);
30720         assert(d.display_time == 1);
30721         assert(d.display_percent == 1);
30722         assert(d.display_bar == 1);
30723         assert(d.display_summary == 1);
30724         assert(d.display_ansi == 0);
30725         assert(d.twiddle_fg_color == 0);
30726         assert(d.twiddle_bg_color == 0);
30727         assert(d.twiddle_fg_bold == 1);
30728         assert(d.datacount_fg_color == 0);
30729         assert(d.datacount_bg_color == 0);
30730         assert(d.datacount_fg_bold == 0);
30731         assert(d.throughput_label_fg_color == 0);
30732         assert(d.throughput_label_bg_color == 0);
30733         assert(d.throughput_label_fg_bold == 0);
30734         assert(d.throughput_fg_color == 0);
30735         assert(d.throughput_bg_color == 0);
30736         assert(d.throughput_fg_bold == 0);
30737         assert(d.time_label_fg_color == 0);
30738         assert(d.time_label_bg_color == 0);
30739         assert(d.time_label_fg_bold == 0);
30740         assert(d.percent_fg_color == 0);
30741         assert(d.percent_bg_color == 0);
30742         assert(d.percent_fg_bold == 0);
30743         assert(d.barbrace_fg_color == 0);
30744         assert(d.barbrace_bg_color == 0);
30745         assert(d.barbrace_fg_bold == 0);
30746         assert(d.bar_fg_color == 0);
30747         assert(d.bar_bg_color == 0);
30748         assert(d.bar_fg_bold == 0);
30749         assert(io.in == 0);
30750         assert(io.out == 1);
30751         assert(io.in_ready == 0);
30752         assert(io.out_ready == 0);
30753         assert(io.eof_in == 0);
30754         assert(io.eof_out == 0);
30755         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30756         /* assert(io.cbuf == 0x0); */
30757         assert(io.last_read == 0);
30758         assert(io.last_write == 0);
30759         assert(io.total_read == 0);
30760         assert(io.total_write == 0);
30761         assert(io.total_size == 0);
30762         assert(io.total_size_known == 0);
30763         assert(io.timeout == 250000);
30764 
30765         tmp_rcfile = fopen("test-rcfile.txt", "w");
30766         assert(tmp_rcfile != 0);
30767         fprintf(tmp_rcfile, "twiddle-bold: off");
30768         fclose(tmp_rcfile);
30769 
30770         clear_errno();
30771         assert(test_parse_rc(out,0));
30772 
30773 #ifdef PRINT_DEBUG
30774         print();
30775 #endif
30776         assert(d.start_time == 0);
30777         assert(d.total_time == 0);
30778         assert(d.current_time == 0);
30779         assert(d.elapsed_time == 0);
30780         assert(d.percent_complete == 0);
30781         assert(d.display_interval == 1);
30782         assert(d.overtime_flag == 0);
30783         assert(d.k == 1024);
30784         assert(d.twiddle == '-');
30785         assert(d.manual_width == 0);
30786         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30787         assert(d.display_datacount == 1);
30788         assert(d.display_throughput == 1);
30789         assert(d.display_time == 1);
30790         assert(d.display_percent == 1);
30791         assert(d.display_bar == 1);
30792         assert(d.display_summary == 1);
30793         assert(d.display_ansi == 0);
30794         assert(d.twiddle_fg_color == 0);
30795         assert(d.twiddle_bg_color == 0);
30796         assert(d.twiddle_fg_bold == 0);
30797         assert(d.datacount_fg_color == 0);
30798         assert(d.datacount_bg_color == 0);
30799         assert(d.datacount_fg_bold == 0);
30800         assert(d.throughput_label_fg_color == 0);
30801         assert(d.throughput_label_bg_color == 0);
30802         assert(d.throughput_label_fg_bold == 0);
30803         assert(d.throughput_fg_color == 0);
30804         assert(d.throughput_bg_color == 0);
30805         assert(d.throughput_fg_bold == 0);
30806         assert(d.time_label_fg_color == 0);
30807         assert(d.time_label_bg_color == 0);
30808         assert(d.time_label_fg_bold == 0);
30809         assert(d.percent_fg_color == 0);
30810         assert(d.percent_bg_color == 0);
30811         assert(d.percent_fg_bold == 0);
30812         assert(d.barbrace_fg_color == 0);
30813         assert(d.barbrace_bg_color == 0);
30814         assert(d.barbrace_fg_bold == 0);
30815         assert(d.bar_fg_color == 0);
30816         assert(d.bar_bg_color == 0);
30817         assert(d.bar_fg_bold == 0);
30818         assert(io.in == 0);
30819         assert(io.out == 1);
30820         assert(io.in_ready == 0);
30821         assert(io.out_ready == 0);
30822         assert(io.eof_in == 0);
30823         assert(io.eof_out == 0);
30824         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30825         /* assert(io.cbuf == 0x0); */
30826         assert(io.last_read == 0);
30827         assert(io.last_write == 0);
30828         assert(io.total_read == 0);
30829         assert(io.total_write == 0);
30830         assert(io.total_size == 0);
30831         assert(io.total_size_known == 0);
30832         assert(io.timeout == 250000);
30833 
30834         tmp_rcfile = fopen("test-rcfile.txt", "w");
30835         assert(tmp_rcfile != 0);
30836         fprintf(tmp_rcfile, "twiddle-bold: on");
30837         fclose(tmp_rcfile);
30838 
30839         clear_errno();
30840         assert(test_parse_rc(out,0));
30841 
30842 #ifdef PRINT_DEBUG
30843         print();
30844 #endif
30845         assert(d.start_time == 0);
30846         assert(d.total_time == 0);
30847         assert(d.current_time == 0);
30848         assert(d.elapsed_time == 0);
30849         assert(d.percent_complete == 0);
30850         assert(d.display_interval == 1);
30851         assert(d.overtime_flag == 0);
30852         assert(d.k == 1024);
30853         assert(d.twiddle == '-');
30854         assert(d.manual_width == 0);
30855         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30856         assert(d.display_datacount == 1);
30857         assert(d.display_throughput == 1);
30858         assert(d.display_time == 1);
30859         assert(d.display_percent == 1);
30860         assert(d.display_bar == 1);
30861         assert(d.display_summary == 1);
30862         assert(d.display_ansi == 0);
30863         assert(d.twiddle_fg_color == 0);
30864         assert(d.twiddle_bg_color == 0);
30865         assert(d.twiddle_fg_bold == 1);
30866         assert(d.datacount_fg_color == 0);
30867         assert(d.datacount_bg_color == 0);
30868         assert(d.datacount_fg_bold == 0);
30869         assert(d.throughput_label_fg_color == 0);
30870         assert(d.throughput_label_bg_color == 0);
30871         assert(d.throughput_label_fg_bold == 0);
30872         assert(d.throughput_fg_color == 0);
30873         assert(d.throughput_bg_color == 0);
30874         assert(d.throughput_fg_bold == 0);
30875         assert(d.time_label_fg_color == 0);
30876         assert(d.time_label_bg_color == 0);
30877         assert(d.time_label_fg_bold == 0);
30878         assert(d.percent_fg_color == 0);
30879         assert(d.percent_bg_color == 0);
30880         assert(d.percent_fg_bold == 0);
30881         assert(d.barbrace_fg_color == 0);
30882         assert(d.barbrace_bg_color == 0);
30883         assert(d.barbrace_fg_bold == 0);
30884         assert(d.bar_fg_color == 0);
30885         assert(d.bar_bg_color == 0);
30886         assert(d.bar_fg_bold == 0);
30887         assert(io.in == 0);
30888         assert(io.out == 1);
30889         assert(io.in_ready == 0);
30890         assert(io.out_ready == 0);
30891         assert(io.eof_in == 0);
30892         assert(io.eof_out == 0);
30893         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30894         /* assert(io.cbuf == 0x0); */
30895         assert(io.last_read == 0);
30896         assert(io.last_write == 0);
30897         assert(io.total_read == 0);
30898         assert(io.total_write == 0);
30899         assert(io.total_size == 0);
30900         assert(io.total_size_known == 0);
30901         assert(io.timeout == 250000);
30902 
30903         assert(unlink("./test-rcfile.txt") == 0);
30904 }
30905 
30906 void test141(FILE *out)
30907 {
30908         int argc = 0;
30909         char *argv[256] = { 0 };
30910         FILE *tmp_rcfile = 0;
30911 
30912         unlink("./test-rcfile.txt");
30913 
30914         for (argc = 0; argc < 256; argc++)
30915                 argv[argc] = 0;
30916         argc = 0;
30917         argv[argc++] = "ProgramName";
30918         argv[argc++] = "-cfg";
30919 
30920         clear_errno();
30921         displayInit();
30922         ioInit();
30923 
30924 #ifdef PRINT_DEBUG
30925         print();
30926 #endif
30927         assert(d.start_time == 0);
30928         assert(d.total_time == 0);
30929         assert(d.current_time == 0);
30930         assert(d.elapsed_time == 0);
30931         assert(d.percent_complete == 0);
30932         assert(d.display_interval == 1);
30933         assert(d.overtime_flag == 0);
30934         assert(d.k == 1024);
30935         assert(d.twiddle == '-');
30936         assert(d.manual_width == 0);
30937         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
30938         assert(d.display_datacount == 1);
30939         assert(d.display_throughput == 1);
30940         assert(d.display_time == 1);
30941         assert(d.display_percent == 1);
30942         assert(d.display_bar == 1);
30943         assert(d.display_summary == 1);
30944         assert(d.display_ansi == 0);
30945         assert(d.twiddle_fg_color == 0);
30946         assert(d.twiddle_bg_color == 0);
30947         assert(d.twiddle_fg_bold == 0);
30948         assert(d.datacount_fg_color == 0);
30949         assert(d.datacount_bg_color == 0);
30950         assert(d.datacount_fg_bold == 0);
30951         assert(d.throughput_label_fg_color == 0);
30952         assert(d.throughput_label_bg_color == 0);
30953         assert(d.throughput_label_fg_bold == 0);
30954         assert(d.throughput_fg_color == 0);
30955         assert(d.throughput_bg_color == 0);
30956         assert(d.throughput_fg_bold == 0);
30957         assert(d.time_label_fg_color == 0);
30958         assert(d.time_label_bg_color == 0);
30959         assert(d.time_label_fg_bold == 0);
30960         assert(d.percent_fg_color == 0);
30961         assert(d.percent_bg_color == 0);
30962         assert(d.percent_fg_bold == 0);
30963         assert(d.barbrace_fg_color == 0);
30964         assert(d.barbrace_bg_color == 0);
30965         assert(d.barbrace_fg_bold == 0);
30966         assert(d.bar_fg_color == 0);
30967         assert(d.bar_bg_color == 0);
30968         assert(d.bar_fg_bold == 0);
30969         assert(io.in == 0);
30970         assert(io.out == 1);
30971         assert(io.in_ready == 0);
30972         assert(io.out_ready == 0);
30973         assert(io.eof_in == 0);
30974         assert(io.eof_out == 0);
30975         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
30976         /* assert(io.cbuf == 0x0); */
30977         assert(io.last_read == 0);
30978         assert(io.last_write == 0);
30979         assert(io.total_read == 0);
30980         assert(io.total_write == 0);
30981         assert(io.total_size == 0);
30982         assert(io.total_size_known == 0);
30983         assert(io.timeout == 250000);
30984 
30985         assert(parse_args(out, argc, argv) == 0);
30986 
30987 #ifdef PRINT_DEBUG
30988         print();
30989 #endif
30990         assert(d.start_time == 0);
30991         assert(d.total_time == 0);
30992         assert(d.current_time == 0);
30993         assert(d.elapsed_time == 0);
30994         assert(d.percent_complete == 0);
30995         assert(d.display_interval == 1);
30996         assert(d.overtime_flag == 0);
30997         assert(d.k == 1024);
30998         assert(d.twiddle == '-');
30999         assert(d.manual_width == 0);
31000         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31001         assert(d.display_datacount == 1);
31002         assert(d.display_throughput == 1);
31003         assert(d.display_time == 1);
31004         assert(d.display_percent == 1);
31005         assert(d.display_bar == 1);
31006         assert(d.display_summary == 1);
31007         assert(d.display_ansi == 0);
31008         assert(d.twiddle_fg_color == 0);
31009         assert(d.twiddle_bg_color == 0);
31010         assert(d.twiddle_fg_bold == 0);
31011         assert(d.datacount_fg_color == 0);
31012         assert(d.datacount_bg_color == 0);
31013         assert(d.datacount_fg_bold == 0);
31014         assert(d.throughput_label_fg_color == 0);
31015         assert(d.throughput_label_bg_color == 0);
31016         assert(d.throughput_label_fg_bold == 0);
31017         assert(d.throughput_fg_color == 0);
31018         assert(d.throughput_bg_color == 0);
31019         assert(d.throughput_fg_bold == 0);
31020         assert(d.time_label_fg_color == 0);
31021         assert(d.time_label_bg_color == 0);
31022         assert(d.time_label_fg_bold == 0);
31023         assert(d.percent_fg_color == 0);
31024         assert(d.percent_bg_color == 0);
31025         assert(d.percent_fg_bold == 0);
31026         assert(d.barbrace_fg_color == 0);
31027         assert(d.barbrace_bg_color == 0);
31028         assert(d.barbrace_fg_bold == 0);
31029         assert(d.bar_fg_color == 0);
31030         assert(d.bar_bg_color == 0);
31031         assert(d.bar_fg_bold == 0);
31032         assert(io.in == 0);
31033         assert(io.out == 1);
31034         assert(io.in_ready == 0);
31035         assert(io.out_ready == 0);
31036         assert(io.eof_in == 0);
31037         assert(io.eof_out == 0);
31038         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31039         /* assert(io.cbuf == 0x0); */
31040         assert(io.last_read == 0);
31041         assert(io.last_write == 0);
31042         assert(io.total_read == 0);
31043         assert(io.total_write == 0);
31044         assert(io.total_size == 0);
31045         assert(io.total_size_known == 0);
31046         assert(io.timeout == 250000);
31047 
31048         for (argc = 0; argc < 256; argc++)
31049                 argv[argc] = 0;
31050         argc = 0;
31051         argv[argc++] = "ProgramName";
31052         argv[argc++] = "-cfg";
31053         argv[argc++] = "/dev/null";
31054 
31055         assert(parse_args(out, argc, argv) == 0);
31056 
31057 #ifdef PRINT_DEBUG
31058         print();
31059 #endif
31060         assert(d.start_time == 0);
31061         assert(d.total_time == 0);
31062         assert(d.current_time == 0);
31063         assert(d.elapsed_time == 0);
31064         assert(d.percent_complete == 0);
31065         assert(d.display_interval == 1);
31066         assert(d.overtime_flag == 0);
31067         assert(d.k == 1024);
31068         assert(d.twiddle == '-');
31069         assert(d.manual_width == 0);
31070         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31071         assert(d.display_datacount == 1);
31072         assert(d.display_throughput == 1);
31073         assert(d.display_time == 1);
31074         assert(d.display_percent == 1);
31075         assert(d.display_bar == 1);
31076         assert(d.display_summary == 1);
31077         assert(d.display_ansi == 0);
31078         assert(d.twiddle_fg_color == 0);
31079         assert(d.twiddle_bg_color == 0);
31080         assert(d.twiddle_fg_bold == 0);
31081         assert(d.datacount_fg_color == 0);
31082         assert(d.datacount_bg_color == 0);
31083         assert(d.datacount_fg_bold == 0);
31084         assert(d.throughput_label_fg_color == 0);
31085         assert(d.throughput_label_bg_color == 0);
31086         assert(d.throughput_label_fg_bold == 0);
31087         assert(d.throughput_fg_color == 0);
31088         assert(d.throughput_bg_color == 0);
31089         assert(d.throughput_fg_bold == 0);
31090         assert(d.time_label_fg_color == 0);
31091         assert(d.time_label_bg_color == 0);
31092         assert(d.time_label_fg_bold == 0);
31093         assert(d.percent_fg_color == 0);
31094         assert(d.percent_bg_color == 0);
31095         assert(d.percent_fg_bold == 0);
31096         assert(d.barbrace_fg_color == 0);
31097         assert(d.barbrace_bg_color == 0);
31098         assert(d.barbrace_fg_bold == 0);
31099         assert(d.bar_fg_color == 0);
31100         assert(d.bar_bg_color == 0);
31101         assert(d.bar_fg_bold == 0);
31102         assert(io.in == 0);
31103         assert(io.out == 1);
31104         assert(io.in_ready == 0);
31105         assert(io.out_ready == 0);
31106         assert(io.eof_in == 0);
31107         assert(io.eof_out == 0);
31108         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31109         /* assert(io.cbuf == 0x0); */
31110         assert(io.last_read == 0);
31111         assert(io.last_write == 0);
31112         assert(io.total_read == 0);
31113         assert(io.total_write == 0);
31114         assert(io.total_size == 0);
31115         assert(io.total_size_known == 0);
31116         assert(io.timeout == 250000);
31117 
31118         for (argc = 0; argc < 256; argc++)
31119                 argv[argc] = 0;
31120         argc = 0;
31121         argv[argc++] = "ProgramName";
31122         argv[argc++] = "-cfg";
31123         argv[argc++] = "black";
31124 
31125         assert(parse_args(out, argc, argv) == 0);
31126 
31127 #ifdef PRINT_DEBUG
31128         print();
31129 #endif
31130         assert(d.start_time == 0);
31131         assert(d.total_time == 0);
31132         assert(d.current_time == 0);
31133         assert(d.elapsed_time == 0);
31134         assert(d.percent_complete == 0);
31135         assert(d.display_interval == 1);
31136         assert(d.overtime_flag == 0);
31137         assert(d.k == 1024);
31138         assert(d.twiddle == '-');
31139         assert(d.manual_width == 0);
31140         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31141         assert(d.display_datacount == 1);
31142         assert(d.display_throughput == 1);
31143         assert(d.display_time == 1);
31144         assert(d.display_percent == 1);
31145         assert(d.display_bar == 1);
31146         assert(d.display_summary == 1);
31147         assert(d.display_ansi == 0);
31148         assert(d.twiddle_fg_color == 0);
31149         assert(d.twiddle_bg_color == 0);
31150         assert(d.twiddle_fg_bold == 0);
31151         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
31152         assert(d.datacount_bg_color == 0);
31153         assert(d.datacount_fg_bold == 0);
31154         assert(d.throughput_label_fg_color == 0);
31155         assert(d.throughput_label_bg_color == 0);
31156         assert(d.throughput_label_fg_bold == 0);
31157         assert(d.throughput_fg_color == 0);
31158         assert(d.throughput_bg_color == 0);
31159         assert(d.throughput_fg_bold == 0);
31160         assert(d.time_label_fg_color == 0);
31161         assert(d.time_label_bg_color == 0);
31162         assert(d.time_label_fg_bold == 0);
31163         assert(d.percent_fg_color == 0);
31164         assert(d.percent_bg_color == 0);
31165         assert(d.percent_fg_bold == 0);
31166         assert(d.barbrace_fg_color == 0);
31167         assert(d.barbrace_bg_color == 0);
31168         assert(d.barbrace_fg_bold == 0);
31169         assert(d.bar_fg_color == 0);
31170         assert(d.bar_bg_color == 0);
31171         assert(d.bar_fg_bold == 0);
31172         assert(io.in == 0);
31173         assert(io.out == 1);
31174         assert(io.in_ready == 0);
31175         assert(io.out_ready == 0);
31176         assert(io.eof_in == 0);
31177         assert(io.eof_out == 0);
31178         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31179         /* assert(io.cbuf == 0x0); */
31180         assert(io.last_read == 0);
31181         assert(io.last_write == 0);
31182         assert(io.total_read == 0);
31183         assert(io.total_write == 0);
31184         assert(io.total_size == 0);
31185         assert(io.total_size_known == 0);
31186         assert(io.timeout == 250000);
31187 
31188         for (argc = 0; argc < 256; argc++)
31189                 argv[argc] = 0;
31190         argc = 0;
31191         argv[argc++] = "ProgramName";
31192         argv[argc++] = "-cfg";
31193         argv[argc++] = "red";
31194 
31195         assert(parse_args(out, argc, argv) == 0);
31196 
31197 #ifdef PRINT_DEBUG
31198         print();
31199 #endif
31200         assert(d.start_time == 0);
31201         assert(d.total_time == 0);
31202         assert(d.current_time == 0);
31203         assert(d.elapsed_time == 0);
31204         assert(d.percent_complete == 0);
31205         assert(d.display_interval == 1);
31206         assert(d.overtime_flag == 0);
31207         assert(d.k == 1024);
31208         assert(d.twiddle == '-');
31209         assert(d.manual_width == 0);
31210         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31211         assert(d.display_datacount == 1);
31212         assert(d.display_throughput == 1);
31213         assert(d.display_time == 1);
31214         assert(d.display_percent == 1);
31215         assert(d.display_bar == 1);
31216         assert(d.display_summary == 1);
31217         assert(d.display_ansi == 0);
31218         assert(d.twiddle_fg_color == 0);
31219         assert(d.twiddle_bg_color == 0);
31220         assert(d.twiddle_fg_bold == 0);
31221         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
31222         assert(d.datacount_bg_color == 0);
31223         assert(d.datacount_fg_bold == 0);
31224         assert(d.throughput_label_fg_color == 0);
31225         assert(d.throughput_label_bg_color == 0);
31226         assert(d.throughput_label_fg_bold == 0);
31227         assert(d.throughput_fg_color == 0);
31228         assert(d.throughput_bg_color == 0);
31229         assert(d.throughput_fg_bold == 0);
31230         assert(d.time_label_fg_color == 0);
31231         assert(d.time_label_bg_color == 0);
31232         assert(d.time_label_fg_bold == 0);
31233         assert(d.percent_fg_color == 0);
31234         assert(d.percent_bg_color == 0);
31235         assert(d.percent_fg_bold == 0);
31236         assert(d.barbrace_fg_color == 0);
31237         assert(d.barbrace_bg_color == 0);
31238         assert(d.barbrace_fg_bold == 0);
31239         assert(d.bar_fg_color == 0);
31240         assert(d.bar_bg_color == 0);
31241         assert(d.bar_fg_bold == 0);
31242         assert(io.in == 0);
31243         assert(io.out == 1);
31244         assert(io.in_ready == 0);
31245         assert(io.out_ready == 0);
31246         assert(io.eof_in == 0);
31247         assert(io.eof_out == 0);
31248         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31249         /* assert(io.cbuf == 0x0); */
31250         assert(io.last_read == 0);
31251         assert(io.last_write == 0);
31252         assert(io.total_read == 0);
31253         assert(io.total_write == 0);
31254         assert(io.total_size == 0);
31255         assert(io.total_size_known == 0);
31256         assert(io.timeout == 250000);
31257 
31258         for (argc = 0; argc < 256; argc++)
31259                 argv[argc] = 0;
31260         argc = 0;
31261         argv[argc++] = "ProgramName";
31262         argv[argc++] = "-cfg";
31263         argv[argc++] = "green";
31264 
31265         assert(parse_args(out, argc, argv) == 0);
31266 
31267 #ifdef PRINT_DEBUG
31268         print();
31269 #endif
31270         assert(d.start_time == 0);
31271         assert(d.total_time == 0);
31272         assert(d.current_time == 0);
31273         assert(d.elapsed_time == 0);
31274         assert(d.percent_complete == 0);
31275         assert(d.display_interval == 1);
31276         assert(d.overtime_flag == 0);
31277         assert(d.k == 1024);
31278         assert(d.twiddle == '-');
31279         assert(d.manual_width == 0);
31280         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31281         assert(d.display_datacount == 1);
31282         assert(d.display_throughput == 1);
31283         assert(d.display_time == 1);
31284         assert(d.display_percent == 1);
31285         assert(d.display_bar == 1);
31286         assert(d.display_summary == 1);
31287         assert(d.display_ansi == 0);
31288         assert(d.twiddle_fg_color == 0);
31289         assert(d.twiddle_bg_color == 0);
31290         assert(d.twiddle_fg_bold == 0);
31291         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
31292         assert(d.datacount_bg_color == 0);
31293         assert(d.datacount_fg_bold == 0);
31294         assert(d.throughput_label_fg_color == 0);
31295         assert(d.throughput_label_bg_color == 0);
31296         assert(d.throughput_label_fg_bold == 0);
31297         assert(d.throughput_fg_color == 0);
31298         assert(d.throughput_bg_color == 0);
31299         assert(d.throughput_fg_bold == 0);
31300         assert(d.time_label_fg_color == 0);
31301         assert(d.time_label_bg_color == 0);
31302         assert(d.time_label_fg_bold == 0);
31303         assert(d.percent_fg_color == 0);
31304         assert(d.percent_bg_color == 0);
31305         assert(d.percent_fg_bold == 0);
31306         assert(d.barbrace_fg_color == 0);
31307         assert(d.barbrace_bg_color == 0);
31308         assert(d.barbrace_fg_bold == 0);
31309         assert(d.bar_fg_color == 0);
31310         assert(d.bar_bg_color == 0);
31311         assert(d.bar_fg_bold == 0);
31312         assert(io.in == 0);
31313         assert(io.out == 1);
31314         assert(io.in_ready == 0);
31315         assert(io.out_ready == 0);
31316         assert(io.eof_in == 0);
31317         assert(io.eof_out == 0);
31318         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31319         /* assert(io.cbuf == 0x0); */
31320         assert(io.last_read == 0);
31321         assert(io.last_write == 0);
31322         assert(io.total_read == 0);
31323         assert(io.total_write == 0);
31324         assert(io.total_size == 0);
31325         assert(io.total_size_known == 0);
31326         assert(io.timeout == 250000);
31327 
31328         for (argc = 0; argc < 256; argc++)
31329                 argv[argc] = 0;
31330         argc = 0;
31331         argv[argc++] = "ProgramName";
31332         argv[argc++] = "-cfg";
31333         argv[argc++] = "yellow";
31334 
31335         assert(parse_args(out, argc, argv) == 0);
31336 
31337 #ifdef PRINT_DEBUG
31338         print();
31339 #endif
31340         assert(d.start_time == 0);
31341         assert(d.total_time == 0);
31342         assert(d.current_time == 0);
31343         assert(d.elapsed_time == 0);
31344         assert(d.percent_complete == 0);
31345         assert(d.display_interval == 1);
31346         assert(d.overtime_flag == 0);
31347         assert(d.k == 1024);
31348         assert(d.twiddle == '-');
31349         assert(d.manual_width == 0);
31350         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31351         assert(d.display_datacount == 1);
31352         assert(d.display_throughput == 1);
31353         assert(d.display_time == 1);
31354         assert(d.display_percent == 1);
31355         assert(d.display_bar == 1);
31356         assert(d.display_summary == 1);
31357         assert(d.display_ansi == 0);
31358         assert(d.twiddle_fg_color == 0);
31359         assert(d.twiddle_bg_color == 0);
31360         assert(d.twiddle_fg_bold == 0);
31361         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
31362         assert(d.datacount_bg_color == 0);
31363         assert(d.datacount_fg_bold == 0);
31364         assert(d.throughput_label_fg_color == 0);
31365         assert(d.throughput_label_bg_color == 0);
31366         assert(d.throughput_label_fg_bold == 0);
31367         assert(d.throughput_fg_color == 0);
31368         assert(d.throughput_bg_color == 0);
31369         assert(d.throughput_fg_bold == 0);
31370         assert(d.time_label_fg_color == 0);
31371         assert(d.time_label_bg_color == 0);
31372         assert(d.time_label_fg_bold == 0);
31373         assert(d.percent_fg_color == 0);
31374         assert(d.percent_bg_color == 0);
31375         assert(d.percent_fg_bold == 0);
31376         assert(d.barbrace_fg_color == 0);
31377         assert(d.barbrace_bg_color == 0);
31378         assert(d.barbrace_fg_bold == 0);
31379         assert(d.bar_fg_color == 0);
31380         assert(d.bar_bg_color == 0);
31381         assert(d.bar_fg_bold == 0);
31382         assert(io.in == 0);
31383         assert(io.out == 1);
31384         assert(io.in_ready == 0);
31385         assert(io.out_ready == 0);
31386         assert(io.eof_in == 0);
31387         assert(io.eof_out == 0);
31388         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31389         /* assert(io.cbuf == 0x0); */
31390         assert(io.last_read == 0);
31391         assert(io.last_write == 0);
31392         assert(io.total_read == 0);
31393         assert(io.total_write == 0);
31394         assert(io.total_size == 0);
31395         assert(io.total_size_known == 0);
31396         assert(io.timeout == 250000);
31397 
31398         for (argc = 0; argc < 256; argc++)
31399                 argv[argc] = 0;
31400         argc = 0;
31401         argv[argc++] = "ProgramName";
31402         argv[argc++] = "-cfg";
31403         argv[argc++] = "blue";
31404 
31405         assert(parse_args(out, argc, argv) == 0);
31406 
31407 #ifdef PRINT_DEBUG
31408         print();
31409 #endif
31410         assert(d.start_time == 0);
31411         assert(d.total_time == 0);
31412         assert(d.current_time == 0);
31413         assert(d.elapsed_time == 0);
31414         assert(d.percent_complete == 0);
31415         assert(d.display_interval == 1);
31416         assert(d.overtime_flag == 0);
31417         assert(d.k == 1024);
31418         assert(d.twiddle == '-');
31419         assert(d.manual_width == 0);
31420         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31421         assert(d.display_datacount == 1);
31422         assert(d.display_throughput == 1);
31423         assert(d.display_time == 1);
31424         assert(d.display_percent == 1);
31425         assert(d.display_bar == 1);
31426         assert(d.display_summary == 1);
31427         assert(d.display_ansi == 0);
31428         assert(d.twiddle_fg_color == 0);
31429         assert(d.twiddle_bg_color == 0);
31430         assert(d.twiddle_fg_bold == 0);
31431         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
31432         assert(d.datacount_bg_color == 0);
31433         assert(d.datacount_fg_bold == 0);
31434         assert(d.throughput_label_fg_color == 0);
31435         assert(d.throughput_label_bg_color == 0);
31436         assert(d.throughput_label_fg_bold == 0);
31437         assert(d.throughput_fg_color == 0);
31438         assert(d.throughput_bg_color == 0);
31439         assert(d.throughput_fg_bold == 0);
31440         assert(d.time_label_fg_color == 0);
31441         assert(d.time_label_bg_color == 0);
31442         assert(d.time_label_fg_bold == 0);
31443         assert(d.percent_fg_color == 0);
31444         assert(d.percent_bg_color == 0);
31445         assert(d.percent_fg_bold == 0);
31446         assert(d.barbrace_fg_color == 0);
31447         assert(d.barbrace_bg_color == 0);
31448         assert(d.barbrace_fg_bold == 0);
31449         assert(d.bar_fg_color == 0);
31450         assert(d.bar_bg_color == 0);
31451         assert(d.bar_fg_bold == 0);
31452         assert(io.in == 0);
31453         assert(io.out == 1);
31454         assert(io.in_ready == 0);
31455         assert(io.out_ready == 0);
31456         assert(io.eof_in == 0);
31457         assert(io.eof_out == 0);
31458         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31459         /* assert(io.cbuf == 0x0); */
31460         assert(io.last_read == 0);
31461         assert(io.last_write == 0);
31462         assert(io.total_read == 0);
31463         assert(io.total_write == 0);
31464         assert(io.total_size == 0);
31465         assert(io.total_size_known == 0);
31466         assert(io.timeout == 250000);
31467 
31468         for (argc = 0; argc < 256; argc++)
31469                 argv[argc] = 0;
31470         argc = 0;
31471         argv[argc++] = "ProgramName";
31472         argv[argc++] = "-cfg";
31473         argv[argc++] = "magenta";
31474 
31475         assert(parse_args(out, argc, argv) == 0);
31476 
31477 #ifdef PRINT_DEBUG
31478         print();
31479 #endif
31480         assert(d.start_time == 0);
31481         assert(d.total_time == 0);
31482         assert(d.current_time == 0);
31483         assert(d.elapsed_time == 0);
31484         assert(d.percent_complete == 0);
31485         assert(d.display_interval == 1);
31486         assert(d.overtime_flag == 0);
31487         assert(d.k == 1024);
31488         assert(d.twiddle == '-');
31489         assert(d.manual_width == 0);
31490         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31491         assert(d.display_datacount == 1);
31492         assert(d.display_throughput == 1);
31493         assert(d.display_time == 1);
31494         assert(d.display_percent == 1);
31495         assert(d.display_bar == 1);
31496         assert(d.display_summary == 1);
31497         assert(d.display_ansi == 0);
31498         assert(d.twiddle_fg_color == 0);
31499         assert(d.twiddle_bg_color == 0);
31500         assert(d.twiddle_fg_bold == 0);
31501         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
31502         assert(d.datacount_bg_color == 0);
31503         assert(d.datacount_fg_bold == 0);
31504         assert(d.throughput_label_fg_color == 0);
31505         assert(d.throughput_label_bg_color == 0);
31506         assert(d.throughput_label_fg_bold == 0);
31507         assert(d.throughput_fg_color == 0);
31508         assert(d.throughput_bg_color == 0);
31509         assert(d.throughput_fg_bold == 0);
31510         assert(d.time_label_fg_color == 0);
31511         assert(d.time_label_bg_color == 0);
31512         assert(d.time_label_fg_bold == 0);
31513         assert(d.percent_fg_color == 0);
31514         assert(d.percent_bg_color == 0);
31515         assert(d.percent_fg_bold == 0);
31516         assert(d.barbrace_fg_color == 0);
31517         assert(d.barbrace_bg_color == 0);
31518         assert(d.barbrace_fg_bold == 0);
31519         assert(d.bar_fg_color == 0);
31520         assert(d.bar_bg_color == 0);
31521         assert(d.bar_fg_bold == 0);
31522         assert(io.in == 0);
31523         assert(io.out == 1);
31524         assert(io.in_ready == 0);
31525         assert(io.out_ready == 0);
31526         assert(io.eof_in == 0);
31527         assert(io.eof_out == 0);
31528         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31529         /* assert(io.cbuf == 0x0); */
31530         assert(io.last_read == 0);
31531         assert(io.last_write == 0);
31532         assert(io.total_read == 0);
31533         assert(io.total_write == 0);
31534         assert(io.total_size == 0);
31535         assert(io.total_size_known == 0);
31536         assert(io.timeout == 250000);
31537 
31538         for (argc = 0; argc < 256; argc++)
31539                 argv[argc] = 0;
31540         argc = 0;
31541         argv[argc++] = "ProgramName";
31542         argv[argc++] = "-cfg";
31543         argv[argc++] = "cyan";
31544 
31545         assert(parse_args(out, argc, argv) == 0);
31546 
31547 #ifdef PRINT_DEBUG
31548         print();
31549 #endif
31550         assert(d.start_time == 0);
31551         assert(d.total_time == 0);
31552         assert(d.current_time == 0);
31553         assert(d.elapsed_time == 0);
31554         assert(d.percent_complete == 0);
31555         assert(d.display_interval == 1);
31556         assert(d.overtime_flag == 0);
31557         assert(d.k == 1024);
31558         assert(d.twiddle == '-');
31559         assert(d.manual_width == 0);
31560         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31561         assert(d.display_datacount == 1);
31562         assert(d.display_throughput == 1);
31563         assert(d.display_time == 1);
31564         assert(d.display_percent == 1);
31565         assert(d.display_bar == 1);
31566         assert(d.display_summary == 1);
31567         assert(d.display_ansi == 0);
31568         assert(d.twiddle_fg_color == 0);
31569         assert(d.twiddle_bg_color == 0);
31570         assert(d.twiddle_fg_bold == 0);
31571         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
31572         assert(d.datacount_bg_color == 0);
31573         assert(d.datacount_fg_bold == 0);
31574         assert(d.throughput_label_fg_color == 0);
31575         assert(d.throughput_label_bg_color == 0);
31576         assert(d.throughput_label_fg_bold == 0);
31577         assert(d.throughput_fg_color == 0);
31578         assert(d.throughput_bg_color == 0);
31579         assert(d.throughput_fg_bold == 0);
31580         assert(d.time_label_fg_color == 0);
31581         assert(d.time_label_bg_color == 0);
31582         assert(d.time_label_fg_bold == 0);
31583         assert(d.percent_fg_color == 0);
31584         assert(d.percent_bg_color == 0);
31585         assert(d.percent_fg_bold == 0);
31586         assert(d.barbrace_fg_color == 0);
31587         assert(d.barbrace_bg_color == 0);
31588         assert(d.barbrace_fg_bold == 0);
31589         assert(d.bar_fg_color == 0);
31590         assert(d.bar_bg_color == 0);
31591         assert(d.bar_fg_bold == 0);
31592         assert(io.in == 0);
31593         assert(io.out == 1);
31594         assert(io.in_ready == 0);
31595         assert(io.out_ready == 0);
31596         assert(io.eof_in == 0);
31597         assert(io.eof_out == 0);
31598         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31599         /* assert(io.cbuf == 0x0); */
31600         assert(io.last_read == 0);
31601         assert(io.last_write == 0);
31602         assert(io.total_read == 0);
31603         assert(io.total_write == 0);
31604         assert(io.total_size == 0);
31605         assert(io.total_size_known == 0);
31606         assert(io.timeout == 250000);
31607 
31608         for (argc = 0; argc < 256; argc++)
31609                 argv[argc] = 0;
31610         argc = 0;
31611         argv[argc++] = "ProgramName";
31612         argv[argc++] = "-cfg";
31613         argv[argc++] = "white";
31614 
31615         assert(parse_args(out, argc, argv) == 0);
31616 
31617 #ifdef PRINT_DEBUG
31618         print();
31619 #endif
31620         assert(d.start_time == 0);
31621         assert(d.total_time == 0);
31622         assert(d.current_time == 0);
31623         assert(d.elapsed_time == 0);
31624         assert(d.percent_complete == 0);
31625         assert(d.display_interval == 1);
31626         assert(d.overtime_flag == 0);
31627         assert(d.k == 1024);
31628         assert(d.twiddle == '-');
31629         assert(d.manual_width == 0);
31630         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31631         assert(d.display_datacount == 1);
31632         assert(d.display_throughput == 1);
31633         assert(d.display_time == 1);
31634         assert(d.display_percent == 1);
31635         assert(d.display_bar == 1);
31636         assert(d.display_summary == 1);
31637         assert(d.display_ansi == 0);
31638         assert(d.twiddle_fg_color == 0);
31639         assert(d.twiddle_bg_color == 0);
31640         assert(d.twiddle_fg_bold == 0);
31641         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
31642         assert(d.datacount_bg_color == 0);
31643         assert(d.datacount_fg_bold == 0);
31644         assert(d.throughput_label_fg_color == 0);
31645         assert(d.throughput_label_bg_color == 0);
31646         assert(d.throughput_label_fg_bold == 0);
31647         assert(d.throughput_fg_color == 0);
31648         assert(d.throughput_bg_color == 0);
31649         assert(d.throughput_fg_bold == 0);
31650         assert(d.time_label_fg_color == 0);
31651         assert(d.time_label_bg_color == 0);
31652         assert(d.time_label_fg_bold == 0);
31653         assert(d.percent_fg_color == 0);
31654         assert(d.percent_bg_color == 0);
31655         assert(d.percent_fg_bold == 0);
31656         assert(d.barbrace_fg_color == 0);
31657         assert(d.barbrace_bg_color == 0);
31658         assert(d.barbrace_fg_bold == 0);
31659         assert(d.bar_fg_color == 0);
31660         assert(d.bar_bg_color == 0);
31661         assert(d.bar_fg_bold == 0);
31662         assert(io.in == 0);
31663         assert(io.out == 1);
31664         assert(io.in_ready == 0);
31665         assert(io.out_ready == 0);
31666         assert(io.eof_in == 0);
31667         assert(io.eof_out == 0);
31668         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31669         /* assert(io.cbuf == 0x0); */
31670         assert(io.last_read == 0);
31671         assert(io.last_write == 0);
31672         assert(io.total_read == 0);
31673         assert(io.total_write == 0);
31674         assert(io.total_size == 0);
31675         assert(io.total_size_known == 0);
31676         assert(io.timeout == 250000);
31677 
31678         for (argc = 0; argc < 256; argc++)
31679                 argv[argc] = 0;
31680         argc = 0;
31681         argv[argc++] = "ProgramName";
31682         argv[argc++] = "-cfg";
31683         argv[argc++] = "normal";
31684 
31685         assert(parse_args(out, argc, argv) == 0);
31686 
31687 #ifdef PRINT_DEBUG
31688         print();
31689 #endif
31690         assert(d.start_time == 0);
31691         assert(d.total_time == 0);
31692         assert(d.current_time == 0);
31693         assert(d.elapsed_time == 0);
31694         assert(d.percent_complete == 0);
31695         assert(d.display_interval == 1);
31696         assert(d.overtime_flag == 0);
31697         assert(d.k == 1024);
31698         assert(d.twiddle == '-');
31699         assert(d.manual_width == 0);
31700         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31701         assert(d.display_datacount == 1);
31702         assert(d.display_throughput == 1);
31703         assert(d.display_time == 1);
31704         assert(d.display_percent == 1);
31705         assert(d.display_bar == 1);
31706         assert(d.display_summary == 1);
31707         assert(d.display_ansi == 0);
31708         assert(d.twiddle_fg_color == 0);
31709         assert(d.twiddle_bg_color == 0);
31710         assert(d.twiddle_fg_bold == 0);
31711         assert(d.datacount_fg_color == 0);
31712         assert(d.datacount_bg_color == 0);
31713         assert(d.datacount_fg_bold == 0);
31714         assert(d.throughput_label_fg_color == 0);
31715         assert(d.throughput_label_bg_color == 0);
31716         assert(d.throughput_label_fg_bold == 0);
31717         assert(d.throughput_fg_color == 0);
31718         assert(d.throughput_bg_color == 0);
31719         assert(d.throughput_fg_bold == 0);
31720         assert(d.time_label_fg_color == 0);
31721         assert(d.time_label_bg_color == 0);
31722         assert(d.time_label_fg_bold == 0);
31723         assert(d.percent_fg_color == 0);
31724         assert(d.percent_bg_color == 0);
31725         assert(d.percent_fg_bold == 0);
31726         assert(d.barbrace_fg_color == 0);
31727         assert(d.barbrace_bg_color == 0);
31728         assert(d.barbrace_fg_bold == 0);
31729         assert(d.bar_fg_color == 0);
31730         assert(d.bar_bg_color == 0);
31731         assert(d.bar_fg_bold == 0);
31732         assert(io.in == 0);
31733         assert(io.out == 1);
31734         assert(io.in_ready == 0);
31735         assert(io.out_ready == 0);
31736         assert(io.eof_in == 0);
31737         assert(io.eof_out == 0);
31738         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31739         /* assert(io.cbuf == 0x0); */
31740         assert(io.last_read == 0);
31741         assert(io.last_write == 0);
31742         assert(io.total_read == 0);
31743         assert(io.total_write == 0);
31744         assert(io.total_size == 0);
31745         assert(io.total_size_known == 0);
31746         assert(io.timeout == 250000);
31747 
31748         for (argc = 0; argc < 256; argc++)
31749                 argv[argc] = 0;
31750         argc = 0;
31751         argv[argc++] = "ProgramName";
31752         argv[argc++] = "-cbg";
31753 
31754         clear_errno();
31755         displayInit();
31756         ioInit();
31757 
31758 #ifdef PRINT_DEBUG
31759         print();
31760 #endif
31761         assert(d.start_time == 0);
31762         assert(d.total_time == 0);
31763         assert(d.current_time == 0);
31764         assert(d.elapsed_time == 0);
31765         assert(d.percent_complete == 0);
31766         assert(d.display_interval == 1);
31767         assert(d.overtime_flag == 0);
31768         assert(d.k == 1024);
31769         assert(d.twiddle == '-');
31770         assert(d.manual_width == 0);
31771         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31772         assert(d.display_datacount == 1);
31773         assert(d.display_throughput == 1);
31774         assert(d.display_time == 1);
31775         assert(d.display_percent == 1);
31776         assert(d.display_bar == 1);
31777         assert(d.display_summary == 1);
31778         assert(d.display_ansi == 0);
31779         assert(d.twiddle_fg_color == 0);
31780         assert(d.twiddle_bg_color == 0);
31781         assert(d.twiddle_fg_bold == 0);
31782         assert(d.datacount_fg_color == 0);
31783         assert(d.datacount_bg_color == 0);
31784         assert(d.datacount_fg_bold == 0);
31785         assert(d.throughput_label_fg_color == 0);
31786         assert(d.throughput_label_bg_color == 0);
31787         assert(d.throughput_label_fg_bold == 0);
31788         assert(d.throughput_fg_color == 0);
31789         assert(d.throughput_bg_color == 0);
31790         assert(d.throughput_fg_bold == 0);
31791         assert(d.time_label_fg_color == 0);
31792         assert(d.time_label_bg_color == 0);
31793         assert(d.time_label_fg_bold == 0);
31794         assert(d.percent_fg_color == 0);
31795         assert(d.percent_bg_color == 0);
31796         assert(d.percent_fg_bold == 0);
31797         assert(d.barbrace_fg_color == 0);
31798         assert(d.barbrace_bg_color == 0);
31799         assert(d.barbrace_fg_bold == 0);
31800         assert(d.bar_fg_color == 0);
31801         assert(d.bar_bg_color == 0);
31802         assert(d.bar_fg_bold == 0);
31803         assert(io.in == 0);
31804         assert(io.out == 1);
31805         assert(io.in_ready == 0);
31806         assert(io.out_ready == 0);
31807         assert(io.eof_in == 0);
31808         assert(io.eof_out == 0);
31809         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31810         /* assert(io.cbuf == 0x0); */
31811         assert(io.last_read == 0);
31812         assert(io.last_write == 0);
31813         assert(io.total_read == 0);
31814         assert(io.total_write == 0);
31815         assert(io.total_size == 0);
31816         assert(io.total_size_known == 0);
31817         assert(io.timeout == 250000);
31818 
31819         assert(parse_args(out, argc, argv) == 0);
31820 
31821 #ifdef PRINT_DEBUG
31822         print();
31823 #endif
31824         assert(d.start_time == 0);
31825         assert(d.total_time == 0);
31826         assert(d.current_time == 0);
31827         assert(d.elapsed_time == 0);
31828         assert(d.percent_complete == 0);
31829         assert(d.display_interval == 1);
31830         assert(d.overtime_flag == 0);
31831         assert(d.k == 1024);
31832         assert(d.twiddle == '-');
31833         assert(d.manual_width == 0);
31834         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31835         assert(d.display_datacount == 1);
31836         assert(d.display_throughput == 1);
31837         assert(d.display_time == 1);
31838         assert(d.display_percent == 1);
31839         assert(d.display_bar == 1);
31840         assert(d.display_summary == 1);
31841         assert(d.display_ansi == 0);
31842         assert(d.twiddle_fg_color == 0);
31843         assert(d.twiddle_bg_color == 0);
31844         assert(d.twiddle_fg_bold == 0);
31845         assert(d.datacount_fg_color == 0);
31846         assert(d.datacount_bg_color == 0);
31847         assert(d.datacount_fg_bold == 0);
31848         assert(d.throughput_label_fg_color == 0);
31849         assert(d.throughput_label_bg_color == 0);
31850         assert(d.throughput_label_fg_bold == 0);
31851         assert(d.throughput_fg_color == 0);
31852         assert(d.throughput_bg_color == 0);
31853         assert(d.throughput_fg_bold == 0);
31854         assert(d.time_label_fg_color == 0);
31855         assert(d.time_label_bg_color == 0);
31856         assert(d.time_label_fg_bold == 0);
31857         assert(d.percent_fg_color == 0);
31858         assert(d.percent_bg_color == 0);
31859         assert(d.percent_fg_bold == 0);
31860         assert(d.barbrace_fg_color == 0);
31861         assert(d.barbrace_bg_color == 0);
31862         assert(d.barbrace_fg_bold == 0);
31863         assert(d.bar_fg_color == 0);
31864         assert(d.bar_bg_color == 0);
31865         assert(d.bar_fg_bold == 0);
31866         assert(io.in == 0);
31867         assert(io.out == 1);
31868         assert(io.in_ready == 0);
31869         assert(io.out_ready == 0);
31870         assert(io.eof_in == 0);
31871         assert(io.eof_out == 0);
31872         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31873         /* assert(io.cbuf == 0x0); */
31874         assert(io.last_read == 0);
31875         assert(io.last_write == 0);
31876         assert(io.total_read == 0);
31877         assert(io.total_write == 0);
31878         assert(io.total_size == 0);
31879         assert(io.total_size_known == 0);
31880         assert(io.timeout == 250000);
31881 
31882         for (argc = 0; argc < 256; argc++)
31883                 argv[argc] = 0;
31884         argc = 0;
31885         argv[argc++] = "ProgramName";
31886         argv[argc++] = "-cbg";
31887         argv[argc++] = "/dev/null";
31888 
31889         assert(parse_args(out, argc, argv) == 0);
31890 
31891 #ifdef PRINT_DEBUG
31892         print();
31893 #endif
31894         assert(d.start_time == 0);
31895         assert(d.total_time == 0);
31896         assert(d.current_time == 0);
31897         assert(d.elapsed_time == 0);
31898         assert(d.percent_complete == 0);
31899         assert(d.display_interval == 1);
31900         assert(d.overtime_flag == 0);
31901         assert(d.k == 1024);
31902         assert(d.twiddle == '-');
31903         assert(d.manual_width == 0);
31904         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31905         assert(d.display_datacount == 1);
31906         assert(d.display_throughput == 1);
31907         assert(d.display_time == 1);
31908         assert(d.display_percent == 1);
31909         assert(d.display_bar == 1);
31910         assert(d.display_summary == 1);
31911         assert(d.display_ansi == 0);
31912         assert(d.twiddle_fg_color == 0);
31913         assert(d.twiddle_bg_color == 0);
31914         assert(d.twiddle_fg_bold == 0);
31915         assert(d.datacount_fg_color == 0);
31916         assert(d.datacount_bg_color == 0);
31917         assert(d.datacount_fg_bold == 0);
31918         assert(d.throughput_label_fg_color == 0);
31919         assert(d.throughput_label_bg_color == 0);
31920         assert(d.throughput_label_fg_bold == 0);
31921         assert(d.throughput_fg_color == 0);
31922         assert(d.throughput_bg_color == 0);
31923         assert(d.throughput_fg_bold == 0);
31924         assert(d.time_label_fg_color == 0);
31925         assert(d.time_label_bg_color == 0);
31926         assert(d.time_label_fg_bold == 0);
31927         assert(d.percent_fg_color == 0);
31928         assert(d.percent_bg_color == 0);
31929         assert(d.percent_fg_bold == 0);
31930         assert(d.barbrace_fg_color == 0);
31931         assert(d.barbrace_bg_color == 0);
31932         assert(d.barbrace_fg_bold == 0);
31933         assert(d.bar_fg_color == 0);
31934         assert(d.bar_bg_color == 0);
31935         assert(d.bar_fg_bold == 0);
31936         assert(io.in == 0);
31937         assert(io.out == 1);
31938         assert(io.in_ready == 0);
31939         assert(io.out_ready == 0);
31940         assert(io.eof_in == 0);
31941         assert(io.eof_out == 0);
31942         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
31943         /* assert(io.cbuf == 0x0); */
31944         assert(io.last_read == 0);
31945         assert(io.last_write == 0);
31946         assert(io.total_read == 0);
31947         assert(io.total_write == 0);
31948         assert(io.total_size == 0);
31949         assert(io.total_size_known == 0);
31950         assert(io.timeout == 250000);
31951 
31952         for (argc = 0; argc < 256; argc++)
31953                 argv[argc] = 0;
31954         argc = 0;
31955         argv[argc++] = "ProgramName";
31956         argv[argc++] = "-cbg";
31957         argv[argc++] = "black";
31958 
31959         assert(parse_args(out, argc, argv) == 0);
31960 
31961 #ifdef PRINT_DEBUG
31962         print();
31963 #endif
31964         assert(d.start_time == 0);
31965         assert(d.total_time == 0);
31966         assert(d.current_time == 0);
31967         assert(d.elapsed_time == 0);
31968         assert(d.percent_complete == 0);
31969         assert(d.display_interval == 1);
31970         assert(d.overtime_flag == 0);
31971         assert(d.k == 1024);
31972         assert(d.twiddle == '-');
31973         assert(d.manual_width == 0);
31974         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
31975         assert(d.display_datacount == 1);
31976         assert(d.display_throughput == 1);
31977         assert(d.display_time == 1);
31978         assert(d.display_percent == 1);
31979         assert(d.display_bar == 1);
31980         assert(d.display_summary == 1);
31981         assert(d.display_ansi == 0);
31982         assert(d.twiddle_fg_color == 0);
31983         assert(d.twiddle_bg_color == 0);
31984         assert(d.twiddle_fg_bold == 0);
31985         assert(d.datacount_fg_color == 0);
31986         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
31987         assert(d.datacount_fg_bold == 0);
31988         assert(d.throughput_label_fg_color == 0);
31989         assert(d.throughput_label_bg_color == 0);
31990         assert(d.throughput_label_fg_bold == 0);
31991         assert(d.throughput_fg_color == 0);
31992         assert(d.throughput_bg_color == 0);
31993         assert(d.throughput_fg_bold == 0);
31994         assert(d.time_label_fg_color == 0);
31995         assert(d.time_label_bg_color == 0);
31996         assert(d.time_label_fg_bold == 0);
31997         assert(d.percent_fg_color == 0);
31998         assert(d.percent_bg_color == 0);
31999         assert(d.percent_fg_bold == 0);
32000         assert(d.barbrace_fg_color == 0);
32001         assert(d.barbrace_bg_color == 0);
32002         assert(d.barbrace_fg_bold == 0);
32003         assert(d.bar_fg_color == 0);
32004         assert(d.bar_bg_color == 0);
32005         assert(d.bar_fg_bold == 0);
32006         assert(io.in == 0);
32007         assert(io.out == 1);
32008         assert(io.in_ready == 0);
32009         assert(io.out_ready == 0);
32010         assert(io.eof_in == 0);
32011         assert(io.eof_out == 0);
32012         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32013         /* assert(io.cbuf == 0x0); */
32014         assert(io.last_read == 0);
32015         assert(io.last_write == 0);
32016         assert(io.total_read == 0);
32017         assert(io.total_write == 0);
32018         assert(io.total_size == 0);
32019         assert(io.total_size_known == 0);
32020         assert(io.timeout == 250000);
32021 
32022         for (argc = 0; argc < 256; argc++)
32023                 argv[argc] = 0;
32024         argc = 0;
32025         argv[argc++] = "ProgramName";
32026         argv[argc++] = "-cbg";
32027         argv[argc++] = "red";
32028 
32029         assert(parse_args(out, argc, argv) == 0);
32030 
32031 #ifdef PRINT_DEBUG
32032         print();
32033 #endif
32034         assert(d.start_time == 0);
32035         assert(d.total_time == 0);
32036         assert(d.current_time == 0);
32037         assert(d.elapsed_time == 0);
32038         assert(d.percent_complete == 0);
32039         assert(d.display_interval == 1);
32040         assert(d.overtime_flag == 0);
32041         assert(d.k == 1024);
32042         assert(d.twiddle == '-');
32043         assert(d.manual_width == 0);
32044         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32045         assert(d.display_datacount == 1);
32046         assert(d.display_throughput == 1);
32047         assert(d.display_time == 1);
32048         assert(d.display_percent == 1);
32049         assert(d.display_bar == 1);
32050         assert(d.display_summary == 1);
32051         assert(d.display_ansi == 0);
32052         assert(d.twiddle_fg_color == 0);
32053         assert(d.twiddle_bg_color == 0);
32054         assert(d.twiddle_fg_bold == 0);
32055         assert(d.datacount_fg_color == 0);
32056         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
32057         assert(d.datacount_fg_bold == 0);
32058         assert(d.throughput_label_fg_color == 0);
32059         assert(d.throughput_label_bg_color == 0);
32060         assert(d.throughput_label_fg_bold == 0);
32061         assert(d.throughput_fg_color == 0);
32062         assert(d.throughput_bg_color == 0);
32063         assert(d.throughput_fg_bold == 0);
32064         assert(d.time_label_fg_color == 0);
32065         assert(d.time_label_bg_color == 0);
32066         assert(d.time_label_fg_bold == 0);
32067         assert(d.percent_fg_color == 0);
32068         assert(d.percent_bg_color == 0);
32069         assert(d.percent_fg_bold == 0);
32070         assert(d.barbrace_fg_color == 0);
32071         assert(d.barbrace_bg_color == 0);
32072         assert(d.barbrace_fg_bold == 0);
32073         assert(d.bar_fg_color == 0);
32074         assert(d.bar_bg_color == 0);
32075         assert(d.bar_fg_bold == 0);
32076         assert(io.in == 0);
32077         assert(io.out == 1);
32078         assert(io.in_ready == 0);
32079         assert(io.out_ready == 0);
32080         assert(io.eof_in == 0);
32081         assert(io.eof_out == 0);
32082         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32083         /* assert(io.cbuf == 0x0); */
32084         assert(io.last_read == 0);
32085         assert(io.last_write == 0);
32086         assert(io.total_read == 0);
32087         assert(io.total_write == 0);
32088         assert(io.total_size == 0);
32089         assert(io.total_size_known == 0);
32090         assert(io.timeout == 250000);
32091 
32092         for (argc = 0; argc < 256; argc++)
32093                 argv[argc] = 0;
32094         argc = 0;
32095         argv[argc++] = "ProgramName";
32096         argv[argc++] = "-cbg";
32097         argv[argc++] = "green";
32098 
32099         assert(parse_args(out, argc, argv) == 0);
32100 
32101 #ifdef PRINT_DEBUG
32102         print();
32103 #endif
32104         assert(d.start_time == 0);
32105         assert(d.total_time == 0);
32106         assert(d.current_time == 0);
32107         assert(d.elapsed_time == 0);
32108         assert(d.percent_complete == 0);
32109         assert(d.display_interval == 1);
32110         assert(d.overtime_flag == 0);
32111         assert(d.k == 1024);
32112         assert(d.twiddle == '-');
32113         assert(d.manual_width == 0);
32114         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32115         assert(d.display_datacount == 1);
32116         assert(d.display_throughput == 1);
32117         assert(d.display_time == 1);
32118         assert(d.display_percent == 1);
32119         assert(d.display_bar == 1);
32120         assert(d.display_summary == 1);
32121         assert(d.display_ansi == 0);
32122         assert(d.twiddle_fg_color == 0);
32123         assert(d.twiddle_bg_color == 0);
32124         assert(d.twiddle_fg_bold == 0);
32125         assert(d.datacount_fg_color == 0);
32126         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
32127         assert(d.datacount_fg_bold == 0);
32128         assert(d.throughput_label_fg_color == 0);
32129         assert(d.throughput_label_bg_color == 0);
32130         assert(d.throughput_label_fg_bold == 0);
32131         assert(d.throughput_fg_color == 0);
32132         assert(d.throughput_bg_color == 0);
32133         assert(d.throughput_fg_bold == 0);
32134         assert(d.time_label_fg_color == 0);
32135         assert(d.time_label_bg_color == 0);
32136         assert(d.time_label_fg_bold == 0);
32137         assert(d.percent_fg_color == 0);
32138         assert(d.percent_bg_color == 0);
32139         assert(d.percent_fg_bold == 0);
32140         assert(d.barbrace_fg_color == 0);
32141         assert(d.barbrace_bg_color == 0);
32142         assert(d.barbrace_fg_bold == 0);
32143         assert(d.bar_fg_color == 0);
32144         assert(d.bar_bg_color == 0);
32145         assert(d.bar_fg_bold == 0);
32146         assert(io.in == 0);
32147         assert(io.out == 1);
32148         assert(io.in_ready == 0);
32149         assert(io.out_ready == 0);
32150         assert(io.eof_in == 0);
32151         assert(io.eof_out == 0);
32152         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32153         /* assert(io.cbuf == 0x0); */
32154         assert(io.last_read == 0);
32155         assert(io.last_write == 0);
32156         assert(io.total_read == 0);
32157         assert(io.total_write == 0);
32158         assert(io.total_size == 0);
32159         assert(io.total_size_known == 0);
32160         assert(io.timeout == 250000);
32161 
32162         for (argc = 0; argc < 256; argc++)
32163                 argv[argc] = 0;
32164         argc = 0;
32165         argv[argc++] = "ProgramName";
32166         argv[argc++] = "-cbg";
32167         argv[argc++] = "yellow";
32168 
32169         assert(parse_args(out, argc, argv) == 0);
32170 
32171 #ifdef PRINT_DEBUG
32172         print();
32173 #endif
32174         assert(d.start_time == 0);
32175         assert(d.total_time == 0);
32176         assert(d.current_time == 0);
32177         assert(d.elapsed_time == 0);
32178         assert(d.percent_complete == 0);
32179         assert(d.display_interval == 1);
32180         assert(d.overtime_flag == 0);
32181         assert(d.k == 1024);
32182         assert(d.twiddle == '-');
32183         assert(d.manual_width == 0);
32184         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32185         assert(d.display_datacount == 1);
32186         assert(d.display_throughput == 1);
32187         assert(d.display_time == 1);
32188         assert(d.display_percent == 1);
32189         assert(d.display_bar == 1);
32190         assert(d.display_summary == 1);
32191         assert(d.display_ansi == 0);
32192         assert(d.twiddle_fg_color == 0);
32193         assert(d.twiddle_bg_color == 0);
32194         assert(d.twiddle_fg_bold == 0);
32195         assert(d.datacount_fg_color == 0);
32196         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
32197         assert(d.datacount_fg_bold == 0);
32198         assert(d.throughput_label_fg_color == 0);
32199         assert(d.throughput_label_bg_color == 0);
32200         assert(d.throughput_label_fg_bold == 0);
32201         assert(d.throughput_fg_color == 0);
32202         assert(d.throughput_bg_color == 0);
32203         assert(d.throughput_fg_bold == 0);
32204         assert(d.time_label_fg_color == 0);
32205         assert(d.time_label_bg_color == 0);
32206         assert(d.time_label_fg_bold == 0);
32207         assert(d.percent_fg_color == 0);
32208         assert(d.percent_bg_color == 0);
32209         assert(d.percent_fg_bold == 0);
32210         assert(d.barbrace_fg_color == 0);
32211         assert(d.barbrace_bg_color == 0);
32212         assert(d.barbrace_fg_bold == 0);
32213         assert(d.bar_fg_color == 0);
32214         assert(d.bar_bg_color == 0);
32215         assert(d.bar_fg_bold == 0);
32216         assert(io.in == 0);
32217         assert(io.out == 1);
32218         assert(io.in_ready == 0);
32219         assert(io.out_ready == 0);
32220         assert(io.eof_in == 0);
32221         assert(io.eof_out == 0);
32222         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32223         /* assert(io.cbuf == 0x0); */
32224         assert(io.last_read == 0);
32225         assert(io.last_write == 0);
32226         assert(io.total_read == 0);
32227         assert(io.total_write == 0);
32228         assert(io.total_size == 0);
32229         assert(io.total_size_known == 0);
32230         assert(io.timeout == 250000);
32231 
32232         for (argc = 0; argc < 256; argc++)
32233                 argv[argc] = 0;
32234         argc = 0;
32235         argv[argc++] = "ProgramName";
32236         argv[argc++] = "-cbg";
32237         argv[argc++] = "blue";
32238 
32239         assert(parse_args(out, argc, argv) == 0);
32240 
32241 #ifdef PRINT_DEBUG
32242         print();
32243 #endif
32244         assert(d.start_time == 0);
32245         assert(d.total_time == 0);
32246         assert(d.current_time == 0);
32247         assert(d.elapsed_time == 0);
32248         assert(d.percent_complete == 0);
32249         assert(d.display_interval == 1);
32250         assert(d.overtime_flag == 0);
32251         assert(d.k == 1024);
32252         assert(d.twiddle == '-');
32253         assert(d.manual_width == 0);
32254         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32255         assert(d.display_datacount == 1);
32256         assert(d.display_throughput == 1);
32257         assert(d.display_time == 1);
32258         assert(d.display_percent == 1);
32259         assert(d.display_bar == 1);
32260         assert(d.display_summary == 1);
32261         assert(d.display_ansi == 0);
32262         assert(d.twiddle_fg_color == 0);
32263         assert(d.twiddle_bg_color == 0);
32264         assert(d.twiddle_fg_bold == 0);
32265         assert(d.datacount_fg_color == 0);
32266         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
32267         assert(d.datacount_fg_bold == 0);
32268         assert(d.throughput_label_fg_color == 0);
32269         assert(d.throughput_label_bg_color == 0);
32270         assert(d.throughput_label_fg_bold == 0);
32271         assert(d.throughput_fg_color == 0);
32272         assert(d.throughput_bg_color == 0);
32273         assert(d.throughput_fg_bold == 0);
32274         assert(d.time_label_fg_color == 0);
32275         assert(d.time_label_bg_color == 0);
32276         assert(d.time_label_fg_bold == 0);
32277         assert(d.percent_fg_color == 0);
32278         assert(d.percent_bg_color == 0);
32279         assert(d.percent_fg_bold == 0);
32280         assert(d.barbrace_fg_color == 0);
32281         assert(d.barbrace_bg_color == 0);
32282         assert(d.barbrace_fg_bold == 0);
32283         assert(d.bar_fg_color == 0);
32284         assert(d.bar_bg_color == 0);
32285         assert(d.bar_fg_bold == 0);
32286         assert(io.in == 0);
32287         assert(io.out == 1);
32288         assert(io.in_ready == 0);
32289         assert(io.out_ready == 0);
32290         assert(io.eof_in == 0);
32291         assert(io.eof_out == 0);
32292         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32293         /* assert(io.cbuf == 0x0); */
32294         assert(io.last_read == 0);
32295         assert(io.last_write == 0);
32296         assert(io.total_read == 0);
32297         assert(io.total_write == 0);
32298         assert(io.total_size == 0);
32299         assert(io.total_size_known == 0);
32300         assert(io.timeout == 250000);
32301 
32302         for (argc = 0; argc < 256; argc++)
32303                 argv[argc] = 0;
32304         argc = 0;
32305         argv[argc++] = "ProgramName";
32306         argv[argc++] = "-cbg";
32307         argv[argc++] = "magenta";
32308 
32309         assert(parse_args(out, argc, argv) == 0);
32310 
32311 #ifdef PRINT_DEBUG
32312         print();
32313 #endif
32314         assert(d.start_time == 0);
32315         assert(d.total_time == 0);
32316         assert(d.current_time == 0);
32317         assert(d.elapsed_time == 0);
32318         assert(d.percent_complete == 0);
32319         assert(d.display_interval == 1);
32320         assert(d.overtime_flag == 0);
32321         assert(d.k == 1024);
32322         assert(d.twiddle == '-');
32323         assert(d.manual_width == 0);
32324         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32325         assert(d.display_datacount == 1);
32326         assert(d.display_throughput == 1);
32327         assert(d.display_time == 1);
32328         assert(d.display_percent == 1);
32329         assert(d.display_bar == 1);
32330         assert(d.display_summary == 1);
32331         assert(d.display_ansi == 0);
32332         assert(d.twiddle_fg_color == 0);
32333         assert(d.twiddle_bg_color == 0);
32334         assert(d.twiddle_fg_bold == 0);
32335         assert(d.datacount_fg_color == 0);
32336         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
32337         assert(d.datacount_fg_bold == 0);
32338         assert(d.throughput_label_fg_color == 0);
32339         assert(d.throughput_label_bg_color == 0);
32340         assert(d.throughput_label_fg_bold == 0);
32341         assert(d.throughput_fg_color == 0);
32342         assert(d.throughput_bg_color == 0);
32343         assert(d.throughput_fg_bold == 0);
32344         assert(d.time_label_fg_color == 0);
32345         assert(d.time_label_bg_color == 0);
32346         assert(d.time_label_fg_bold == 0);
32347         assert(d.percent_fg_color == 0);
32348         assert(d.percent_bg_color == 0);
32349         assert(d.percent_fg_bold == 0);
32350         assert(d.barbrace_fg_color == 0);
32351         assert(d.barbrace_bg_color == 0);
32352         assert(d.barbrace_fg_bold == 0);
32353         assert(d.bar_fg_color == 0);
32354         assert(d.bar_bg_color == 0);
32355         assert(d.bar_fg_bold == 0);
32356         assert(io.in == 0);
32357         assert(io.out == 1);
32358         assert(io.in_ready == 0);
32359         assert(io.out_ready == 0);
32360         assert(io.eof_in == 0);
32361         assert(io.eof_out == 0);
32362         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32363         /* assert(io.cbuf == 0x0); */
32364         assert(io.last_read == 0);
32365         assert(io.last_write == 0);
32366         assert(io.total_read == 0);
32367         assert(io.total_write == 0);
32368         assert(io.total_size == 0);
32369         assert(io.total_size_known == 0);
32370         assert(io.timeout == 250000);
32371 
32372         for (argc = 0; argc < 256; argc++)
32373                 argv[argc] = 0;
32374         argc = 0;
32375         argv[argc++] = "ProgramName";
32376         argv[argc++] = "-cbg";
32377         argv[argc++] = "cyan";
32378 
32379         assert(parse_args(out, argc, argv) == 0);
32380 
32381 #ifdef PRINT_DEBUG
32382         print();
32383 #endif
32384         assert(d.start_time == 0);
32385         assert(d.total_time == 0);
32386         assert(d.current_time == 0);
32387         assert(d.elapsed_time == 0);
32388         assert(d.percent_complete == 0);
32389         assert(d.display_interval == 1);
32390         assert(d.overtime_flag == 0);
32391         assert(d.k == 1024);
32392         assert(d.twiddle == '-');
32393         assert(d.manual_width == 0);
32394         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32395         assert(d.display_datacount == 1);
32396         assert(d.display_throughput == 1);
32397         assert(d.display_time == 1);
32398         assert(d.display_percent == 1);
32399         assert(d.display_bar == 1);
32400         assert(d.display_summary == 1);
32401         assert(d.display_ansi == 0);
32402         assert(d.twiddle_fg_color == 0);
32403         assert(d.twiddle_bg_color == 0);
32404         assert(d.twiddle_fg_bold == 0);
32405         assert(d.datacount_fg_color == 0);
32406         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
32407         assert(d.datacount_fg_bold == 0);
32408         assert(d.throughput_label_fg_color == 0);
32409         assert(d.throughput_label_bg_color == 0);
32410         assert(d.throughput_label_fg_bold == 0);
32411         assert(d.throughput_fg_color == 0);
32412         assert(d.throughput_bg_color == 0);
32413         assert(d.throughput_fg_bold == 0);
32414         assert(d.time_label_fg_color == 0);
32415         assert(d.time_label_bg_color == 0);
32416         assert(d.time_label_fg_bold == 0);
32417         assert(d.percent_fg_color == 0);
32418         assert(d.percent_bg_color == 0);
32419         assert(d.percent_fg_bold == 0);
32420         assert(d.barbrace_fg_color == 0);
32421         assert(d.barbrace_bg_color == 0);
32422         assert(d.barbrace_fg_bold == 0);
32423         assert(d.bar_fg_color == 0);
32424         assert(d.bar_bg_color == 0);
32425         assert(d.bar_fg_bold == 0);
32426         assert(io.in == 0);
32427         assert(io.out == 1);
32428         assert(io.in_ready == 0);
32429         assert(io.out_ready == 0);
32430         assert(io.eof_in == 0);
32431         assert(io.eof_out == 0);
32432         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32433         /* assert(io.cbuf == 0x0); */
32434         assert(io.last_read == 0);
32435         assert(io.last_write == 0);
32436         assert(io.total_read == 0);
32437         assert(io.total_write == 0);
32438         assert(io.total_size == 0);
32439         assert(io.total_size_known == 0);
32440         assert(io.timeout == 250000);
32441 
32442         for (argc = 0; argc < 256; argc++)
32443                 argv[argc] = 0;
32444         argc = 0;
32445         argv[argc++] = "ProgramName";
32446         argv[argc++] = "-cbg";
32447         argv[argc++] = "white";
32448 
32449         assert(parse_args(out, argc, argv) == 0);
32450 
32451 #ifdef PRINT_DEBUG
32452         print();
32453 #endif
32454         assert(d.start_time == 0);
32455         assert(d.total_time == 0);
32456         assert(d.current_time == 0);
32457         assert(d.elapsed_time == 0);
32458         assert(d.percent_complete == 0);
32459         assert(d.display_interval == 1);
32460         assert(d.overtime_flag == 0);
32461         assert(d.k == 1024);
32462         assert(d.twiddle == '-');
32463         assert(d.manual_width == 0);
32464         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32465         assert(d.display_datacount == 1);
32466         assert(d.display_throughput == 1);
32467         assert(d.display_time == 1);
32468         assert(d.display_percent == 1);
32469         assert(d.display_bar == 1);
32470         assert(d.display_summary == 1);
32471         assert(d.display_ansi == 0);
32472         assert(d.twiddle_fg_color == 0);
32473         assert(d.twiddle_bg_color == 0);
32474         assert(d.twiddle_fg_bold == 0);
32475         assert(d.datacount_fg_color == 0);
32476         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
32477         assert(d.datacount_fg_bold == 0);
32478         assert(d.throughput_label_fg_color == 0);
32479         assert(d.throughput_label_bg_color == 0);
32480         assert(d.throughput_label_fg_bold == 0);
32481         assert(d.throughput_fg_color == 0);
32482         assert(d.throughput_bg_color == 0);
32483         assert(d.throughput_fg_bold == 0);
32484         assert(d.time_label_fg_color == 0);
32485         assert(d.time_label_bg_color == 0);
32486         assert(d.time_label_fg_bold == 0);
32487         assert(d.percent_fg_color == 0);
32488         assert(d.percent_bg_color == 0);
32489         assert(d.percent_fg_bold == 0);
32490         assert(d.barbrace_fg_color == 0);
32491         assert(d.barbrace_bg_color == 0);
32492         assert(d.barbrace_fg_bold == 0);
32493         assert(d.bar_fg_color == 0);
32494         assert(d.bar_bg_color == 0);
32495         assert(d.bar_fg_bold == 0);
32496         assert(io.in == 0);
32497         assert(io.out == 1);
32498         assert(io.in_ready == 0);
32499         assert(io.out_ready == 0);
32500         assert(io.eof_in == 0);
32501         assert(io.eof_out == 0);
32502         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32503         /* assert(io.cbuf == 0x0); */
32504         assert(io.last_read == 0);
32505         assert(io.last_write == 0);
32506         assert(io.total_read == 0);
32507         assert(io.total_write == 0);
32508         assert(io.total_size == 0);
32509         assert(io.total_size_known == 0);
32510         assert(io.timeout == 250000);
32511 
32512         for (argc = 0; argc < 256; argc++)
32513                 argv[argc] = 0;
32514         argc = 0;
32515         argv[argc++] = "ProgramName";
32516         argv[argc++] = "-cbg";
32517         argv[argc++] = "normal";
32518 
32519         assert(parse_args(out, argc, argv) == 0);
32520 
32521 #ifdef PRINT_DEBUG
32522         print();
32523 #endif
32524         assert(d.start_time == 0);
32525         assert(d.total_time == 0);
32526         assert(d.current_time == 0);
32527         assert(d.elapsed_time == 0);
32528         assert(d.percent_complete == 0);
32529         assert(d.display_interval == 1);
32530         assert(d.overtime_flag == 0);
32531         assert(d.k == 1024);
32532         assert(d.twiddle == '-');
32533         assert(d.manual_width == 0);
32534         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32535         assert(d.display_datacount == 1);
32536         assert(d.display_throughput == 1);
32537         assert(d.display_time == 1);
32538         assert(d.display_percent == 1);
32539         assert(d.display_bar == 1);
32540         assert(d.display_summary == 1);
32541         assert(d.display_ansi == 0);
32542         assert(d.twiddle_fg_color == 0);
32543         assert(d.twiddle_bg_color == 0);
32544         assert(d.twiddle_fg_bold == 0);
32545         assert(d.datacount_fg_color == 0);
32546         assert(d.datacount_bg_color == 0);
32547         assert(d.datacount_fg_bold == 0);
32548         assert(d.throughput_label_fg_color == 0);
32549         assert(d.throughput_label_bg_color == 0);
32550         assert(d.throughput_label_fg_bold == 0);
32551         assert(d.throughput_fg_color == 0);
32552         assert(d.throughput_bg_color == 0);
32553         assert(d.throughput_fg_bold == 0);
32554         assert(d.time_label_fg_color == 0);
32555         assert(d.time_label_bg_color == 0);
32556         assert(d.time_label_fg_bold == 0);
32557         assert(d.percent_fg_color == 0);
32558         assert(d.percent_bg_color == 0);
32559         assert(d.percent_fg_bold == 0);
32560         assert(d.barbrace_fg_color == 0);
32561         assert(d.barbrace_bg_color == 0);
32562         assert(d.barbrace_fg_bold == 0);
32563         assert(d.bar_fg_color == 0);
32564         assert(d.bar_bg_color == 0);
32565         assert(d.bar_fg_bold == 0);
32566         assert(io.in == 0);
32567         assert(io.out == 1);
32568         assert(io.in_ready == 0);
32569         assert(io.out_ready == 0);
32570         assert(io.eof_in == 0);
32571         assert(io.eof_out == 0);
32572         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32573         /* assert(io.cbuf == 0x0); */
32574         assert(io.last_read == 0);
32575         assert(io.last_write == 0);
32576         assert(io.total_read == 0);
32577         assert(io.total_write == 0);
32578         assert(io.total_size == 0);
32579         assert(io.total_size_known == 0);
32580         assert(io.timeout == 250000);
32581 
32582         for (argc = 0; argc < 256; argc++)
32583                 argv[argc] = 0;
32584         argc = 0;
32585         argv[argc++] = "ProgramName";
32586         argv[argc++] = "-cb";
32587 
32588         assert(parse_args(out, argc, argv) == 0);
32589 
32590 #ifdef PRINT_DEBUG
32591         print();
32592 #endif
32593         assert(d.start_time == 0);
32594         assert(d.total_time == 0);
32595         assert(d.current_time == 0);
32596         assert(d.elapsed_time == 0);
32597         assert(d.percent_complete == 0);
32598         assert(d.display_interval == 1);
32599         assert(d.overtime_flag == 0);
32600         assert(d.k == 1024);
32601         assert(d.twiddle == '-');
32602         assert(d.manual_width == 0);
32603         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32604         assert(d.display_datacount == 1);
32605         assert(d.display_throughput == 1);
32606         assert(d.display_time == 1);
32607         assert(d.display_percent == 1);
32608         assert(d.display_bar == 1);
32609         assert(d.display_summary == 1);
32610         assert(d.display_ansi == 0);
32611         assert(d.twiddle_fg_color == 0);
32612         assert(d.twiddle_bg_color == 0);
32613         assert(d.twiddle_fg_bold == 0);
32614         assert(d.datacount_fg_color == 0);
32615         assert(d.datacount_bg_color == 0);
32616         assert(d.datacount_fg_bold == 1);
32617         assert(d.throughput_label_fg_color == 0);
32618         assert(d.throughput_label_bg_color == 0);
32619         assert(d.throughput_label_fg_bold == 0);
32620         assert(d.throughput_fg_color == 0);
32621         assert(d.throughput_bg_color == 0);
32622         assert(d.throughput_fg_bold == 0);
32623         assert(d.time_label_fg_color == 0);
32624         assert(d.time_label_bg_color == 0);
32625         assert(d.time_label_fg_bold == 0);
32626         assert(d.percent_fg_color == 0);
32627         assert(d.percent_bg_color == 0);
32628         assert(d.percent_fg_bold == 0);
32629         assert(d.barbrace_fg_color == 0);
32630         assert(d.barbrace_bg_color == 0);
32631         assert(d.barbrace_fg_bold == 0);
32632         assert(d.bar_fg_color == 0);
32633         assert(d.bar_bg_color == 0);
32634         assert(d.bar_fg_bold == 0);
32635         assert(io.in == 0);
32636         assert(io.out == 1);
32637         assert(io.in_ready == 0);
32638         assert(io.out_ready == 0);
32639         assert(io.eof_in == 0);
32640         assert(io.eof_out == 0);
32641         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32642         /* assert(io.cbuf == 0x0); */
32643         assert(io.last_read == 0);
32644         assert(io.last_write == 0);
32645         assert(io.total_read == 0);
32646         assert(io.total_write == 0);
32647         assert(io.total_size == 0);
32648         assert(io.total_size_known == 0);
32649         assert(io.timeout == 250000);
32650 
32651         for (argc = 0; argc < 256; argc++)
32652                 argv[argc] = 0;
32653         argc = 0;
32654         argv[argc++] = "ProgramName";
32655         argv[argc++] = "-cn";
32656 
32657         assert(parse_args(out, argc, argv) == 0);
32658 
32659 #ifdef PRINT_DEBUG
32660         print();
32661 #endif
32662         assert(d.start_time == 0);
32663         assert(d.total_time == 0);
32664         assert(d.current_time == 0);
32665         assert(d.elapsed_time == 0);
32666         assert(d.percent_complete == 0);
32667         assert(d.display_interval == 1);
32668         assert(d.overtime_flag == 0);
32669         assert(d.k == 1024);
32670         assert(d.twiddle == '-');
32671         assert(d.manual_width == 0);
32672         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32673         assert(d.display_datacount == 1);
32674         assert(d.display_throughput == 1);
32675         assert(d.display_time == 1);
32676         assert(d.display_percent == 1);
32677         assert(d.display_bar == 1);
32678         assert(d.display_summary == 1);
32679         assert(d.display_ansi == 0);
32680         assert(d.twiddle_fg_color == 0);
32681         assert(d.twiddle_bg_color == 0);
32682         assert(d.twiddle_fg_bold == 0);
32683         assert(d.datacount_fg_color == 0);
32684         assert(d.datacount_bg_color == 0);
32685         assert(d.datacount_fg_bold == 0);
32686         assert(d.throughput_label_fg_color == 0);
32687         assert(d.throughput_label_bg_color == 0);
32688         assert(d.throughput_label_fg_bold == 0);
32689         assert(d.throughput_fg_color == 0);
32690         assert(d.throughput_bg_color == 0);
32691         assert(d.throughput_fg_bold == 0);
32692         assert(d.time_label_fg_color == 0);
32693         assert(d.time_label_bg_color == 0);
32694         assert(d.time_label_fg_bold == 0);
32695         assert(d.percent_fg_color == 0);
32696         assert(d.percent_bg_color == 0);
32697         assert(d.percent_fg_bold == 0);
32698         assert(d.barbrace_fg_color == 0);
32699         assert(d.barbrace_bg_color == 0);
32700         assert(d.barbrace_fg_bold == 0);
32701         assert(d.bar_fg_color == 0);
32702         assert(d.bar_bg_color == 0);
32703         assert(d.bar_fg_bold == 0);
32704         assert(io.in == 0);
32705         assert(io.out == 1);
32706         assert(io.in_ready == 0);
32707         assert(io.out_ready == 0);
32708         assert(io.eof_in == 0);
32709         assert(io.eof_out == 0);
32710         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32711         /* assert(io.cbuf == 0x0); */
32712         assert(io.last_read == 0);
32713         assert(io.last_write == 0);
32714         assert(io.total_read == 0);
32715         assert(io.total_write == 0);
32716         assert(io.total_size == 0);
32717         assert(io.total_size_known == 0);
32718         assert(io.timeout == 250000);
32719 
32720         assert(test_parse_rc(out, 0));
32721 
32722 #ifdef PRINT_DEBUG
32723         print();
32724 #endif
32725         assert(d.start_time == 0);
32726         assert(d.total_time == 0);
32727         assert(d.current_time == 0);
32728         assert(d.elapsed_time == 0);
32729         assert(d.percent_complete == 0);
32730         assert(d.display_interval == 1);
32731         assert(d.overtime_flag == 0);
32732         assert(d.k == 1024);
32733         assert(d.twiddle == '-');
32734         assert(d.manual_width == 0);
32735         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32736         assert(d.display_datacount == 1);
32737         assert(d.display_throughput == 1);
32738         assert(d.display_time == 1);
32739         assert(d.display_percent == 1);
32740         assert(d.display_bar == 1);
32741         assert(d.display_summary == 1);
32742         assert(d.display_ansi == 0);
32743         assert(d.twiddle_fg_color == 0);
32744         assert(d.twiddle_bg_color == 0);
32745         assert(d.twiddle_fg_bold == 0);
32746         assert(d.datacount_fg_color == 0);
32747         assert(d.datacount_bg_color == 0);
32748         assert(d.datacount_fg_bold == 0);
32749         assert(d.throughput_label_fg_color == 0);
32750         assert(d.throughput_label_bg_color == 0);
32751         assert(d.throughput_label_fg_bold == 0);
32752         assert(d.throughput_fg_color == 0);
32753         assert(d.throughput_bg_color == 0);
32754         assert(d.throughput_fg_bold == 0);
32755         assert(d.time_label_fg_color == 0);
32756         assert(d.time_label_bg_color == 0);
32757         assert(d.time_label_fg_bold == 0);
32758         assert(d.percent_fg_color == 0);
32759         assert(d.percent_bg_color == 0);
32760         assert(d.percent_fg_bold == 0);
32761         assert(d.barbrace_fg_color == 0);
32762         assert(d.barbrace_bg_color == 0);
32763         assert(d.barbrace_fg_bold == 0);
32764         assert(d.bar_fg_color == 0);
32765         assert(d.bar_bg_color == 0);
32766         assert(d.bar_fg_bold == 0);
32767         assert(io.in == 0);
32768         assert(io.out == 1);
32769         assert(io.in_ready == 0);
32770         assert(io.out_ready == 0);
32771         assert(io.eof_in == 0);
32772         assert(io.eof_out == 0);
32773         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32774         /* assert(io.cbuf == 0x0); */
32775         assert(io.last_read == 0);
32776         assert(io.last_write == 0);
32777         assert(io.total_read == 0);
32778         assert(io.total_write == 0);
32779         assert(io.total_size == 0);
32780         assert(io.total_size_known == 0);
32781         assert(io.timeout == 250000);
32782 
32783         tmp_rcfile = fopen("test-rcfile.txt", "w");
32784         assert(tmp_rcfile != 0);
32785         fclose(tmp_rcfile);
32786 
32787 #ifdef PRINT_DEBUG
32788         print();
32789 #endif
32790         assert(d.start_time == 0);
32791         assert(d.total_time == 0);
32792         assert(d.current_time == 0);
32793         assert(d.elapsed_time == 0);
32794         assert(d.percent_complete == 0);
32795         assert(d.display_interval == 1);
32796         assert(d.overtime_flag == 0);
32797         assert(d.k == 1024);
32798         assert(d.twiddle == '-');
32799         assert(d.manual_width == 0);
32800         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32801         assert(d.display_datacount == 1);
32802         assert(d.display_throughput == 1);
32803         assert(d.display_time == 1);
32804         assert(d.display_percent == 1);
32805         assert(d.display_bar == 1);
32806         assert(d.display_summary == 1);
32807         assert(d.display_ansi == 0);
32808         assert(d.twiddle_fg_color == 0);
32809         assert(d.twiddle_bg_color == 0);
32810         assert(d.twiddle_fg_bold == 0);
32811         assert(d.datacount_fg_color == 0);
32812         assert(d.datacount_bg_color == 0);
32813         assert(d.datacount_fg_bold == 0);
32814         assert(d.throughput_label_fg_color == 0);
32815         assert(d.throughput_label_bg_color == 0);
32816         assert(d.throughput_label_fg_bold == 0);
32817         assert(d.throughput_fg_color == 0);
32818         assert(d.throughput_bg_color == 0);
32819         assert(d.throughput_fg_bold == 0);
32820         assert(d.time_label_fg_color == 0);
32821         assert(d.time_label_bg_color == 0);
32822         assert(d.time_label_fg_bold == 0);
32823         assert(d.percent_fg_color == 0);
32824         assert(d.percent_bg_color == 0);
32825         assert(d.percent_fg_bold == 0);
32826         assert(d.barbrace_fg_color == 0);
32827         assert(d.barbrace_bg_color == 0);
32828         assert(d.barbrace_fg_bold == 0);
32829         assert(d.bar_fg_color == 0);
32830         assert(d.bar_bg_color == 0);
32831         assert(d.bar_fg_bold == 0);
32832         assert(io.in == 0);
32833         assert(io.out == 1);
32834         assert(io.in_ready == 0);
32835         assert(io.out_ready == 0);
32836         assert(io.eof_in == 0);
32837         assert(io.eof_out == 0);
32838         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32839         /* assert(io.cbuf == 0x0); */
32840         assert(io.last_read == 0);
32841         assert(io.last_write == 0);
32842         assert(io.total_read == 0);
32843         assert(io.total_write == 0);
32844         assert(io.total_size == 0);
32845         assert(io.total_size_known == 0);
32846         assert(io.timeout == 250000);
32847 
32848         tmp_rcfile = fopen("test-rcfile.txt", "w");
32849         assert(tmp_rcfile != 0);
32850         fprintf(tmp_rcfile, "count-foreground: kjshdfkjh");
32851         fclose(tmp_rcfile);
32852 
32853         clear_errno();
32854         assert(test_parse_rc(out,1));
32855 
32856 #ifdef PRINT_DEBUG
32857         print();
32858 #endif
32859         assert(d.start_time == 0);
32860         assert(d.total_time == 0);
32861         assert(d.current_time == 0);
32862         assert(d.elapsed_time == 0);
32863         assert(d.percent_complete == 0);
32864         assert(d.display_interval == 1);
32865         assert(d.overtime_flag == 0);
32866         assert(d.k == 1024);
32867         assert(d.twiddle == '-');
32868         assert(d.manual_width == 0);
32869         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32870         assert(d.display_datacount == 1);
32871         assert(d.display_throughput == 1);
32872         assert(d.display_time == 1);
32873         assert(d.display_percent == 1);
32874         assert(d.display_bar == 1);
32875         assert(d.display_summary == 1);
32876         assert(d.display_ansi == 0);
32877         assert(d.twiddle_fg_color == 0);
32878         assert(d.twiddle_bg_color == 0);
32879         assert(d.twiddle_fg_bold == 0);
32880         assert(d.datacount_fg_color == 0);
32881         assert(d.datacount_bg_color == 0);
32882         assert(d.datacount_fg_bold == 0);
32883         assert(d.throughput_label_fg_color == 0);
32884         assert(d.throughput_label_bg_color == 0);
32885         assert(d.throughput_label_fg_bold == 0);
32886         assert(d.throughput_fg_color == 0);
32887         assert(d.throughput_bg_color == 0);
32888         assert(d.throughput_fg_bold == 0);
32889         assert(d.time_label_fg_color == 0);
32890         assert(d.time_label_bg_color == 0);
32891         assert(d.time_label_fg_bold == 0);
32892         assert(d.percent_fg_color == 0);
32893         assert(d.percent_bg_color == 0);
32894         assert(d.percent_fg_bold == 0);
32895         assert(d.barbrace_fg_color == 0);
32896         assert(d.barbrace_bg_color == 0);
32897         assert(d.barbrace_fg_bold == 0);
32898         assert(d.bar_fg_color == 0);
32899         assert(d.bar_bg_color == 0);
32900         assert(d.bar_fg_bold == 0);
32901         assert(io.in == 0);
32902         assert(io.out == 1);
32903         assert(io.in_ready == 0);
32904         assert(io.out_ready == 0);
32905         assert(io.eof_in == 0);
32906         assert(io.eof_out == 0);
32907         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32908         /* assert(io.cbuf == 0x0); */
32909         assert(io.last_read == 0);
32910         assert(io.last_write == 0);
32911         assert(io.total_read == 0);
32912         assert(io.total_write == 0);
32913         assert(io.total_size == 0);
32914         assert(io.total_size_known == 0);
32915         assert(io.timeout == 250000);
32916 
32917         tmp_rcfile = fopen("test-rcfile.txt", "w");
32918         assert(tmp_rcfile != 0);
32919         fprintf(tmp_rcfile, "count-foreground: black");
32920         fclose(tmp_rcfile);
32921 
32922         clear_errno();
32923         assert(test_parse_rc(out,0));
32924 
32925 #ifdef PRINT_DEBUG
32926         print();
32927 #endif
32928         assert(d.start_time == 0);
32929         assert(d.total_time == 0);
32930         assert(d.current_time == 0);
32931         assert(d.elapsed_time == 0);
32932         assert(d.percent_complete == 0);
32933         assert(d.display_interval == 1);
32934         assert(d.overtime_flag == 0);
32935         assert(d.k == 1024);
32936         assert(d.twiddle == '-');
32937         assert(d.manual_width == 0);
32938         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
32939         assert(d.display_datacount == 1);
32940         assert(d.display_throughput == 1);
32941         assert(d.display_time == 1);
32942         assert(d.display_percent == 1);
32943         assert(d.display_bar == 1);
32944         assert(d.display_summary == 1);
32945         assert(d.display_ansi == 0);
32946         assert(d.twiddle_fg_color == 0);
32947         assert(d.twiddle_bg_color == 0);
32948         assert(d.twiddle_fg_bold == 0);
32949         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
32950         assert(d.datacount_bg_color == 0);
32951         assert(d.datacount_fg_bold == 0);
32952         assert(d.throughput_label_fg_color == 0);
32953         assert(d.throughput_label_bg_color == 0);
32954         assert(d.throughput_label_fg_bold == 0);
32955         assert(d.throughput_fg_color == 0);
32956         assert(d.throughput_bg_color == 0);
32957         assert(d.throughput_fg_bold == 0);
32958         assert(d.time_label_fg_color == 0);
32959         assert(d.time_label_bg_color == 0);
32960         assert(d.time_label_fg_bold == 0);
32961         assert(d.percent_fg_color == 0);
32962         assert(d.percent_bg_color == 0);
32963         assert(d.percent_fg_bold == 0);
32964         assert(d.barbrace_fg_color == 0);
32965         assert(d.barbrace_bg_color == 0);
32966         assert(d.barbrace_fg_bold == 0);
32967         assert(d.bar_fg_color == 0);
32968         assert(d.bar_bg_color == 0);
32969         assert(d.bar_fg_bold == 0);
32970         assert(io.in == 0);
32971         assert(io.out == 1);
32972         assert(io.in_ready == 0);
32973         assert(io.out_ready == 0);
32974         assert(io.eof_in == 0);
32975         assert(io.eof_out == 0);
32976         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
32977         /* assert(io.cbuf == 0x0); */
32978         assert(io.last_read == 0);
32979         assert(io.last_write == 0);
32980         assert(io.total_read == 0);
32981         assert(io.total_write == 0);
32982         assert(io.total_size == 0);
32983         assert(io.total_size_known == 0);
32984         assert(io.timeout == 250000);
32985 
32986         tmp_rcfile = fopen("test-rcfile.txt", "w");
32987         assert(tmp_rcfile != 0);
32988         fprintf(tmp_rcfile, "count-foreground: red");
32989         fclose(tmp_rcfile);
32990 
32991         clear_errno();
32992         assert(test_parse_rc(out,0));
32993 
32994 #ifdef PRINT_DEBUG
32995         print();
32996 #endif
32997         assert(d.start_time == 0);
32998         assert(d.total_time == 0);
32999         assert(d.current_time == 0);
33000         assert(d.elapsed_time == 0);
33001         assert(d.percent_complete == 0);
33002         assert(d.display_interval == 1);
33003         assert(d.overtime_flag == 0);
33004         assert(d.k == 1024);
33005         assert(d.twiddle == '-');
33006         assert(d.manual_width == 0);
33007         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33008         assert(d.display_datacount == 1);
33009         assert(d.display_throughput == 1);
33010         assert(d.display_time == 1);
33011         assert(d.display_percent == 1);
33012         assert(d.display_bar == 1);
33013         assert(d.display_summary == 1);
33014         assert(d.display_ansi == 0);
33015         assert(d.twiddle_fg_color == 0);
33016         assert(d.twiddle_bg_color == 0);
33017         assert(d.twiddle_fg_bold == 0);
33018         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
33019         assert(d.datacount_bg_color == 0);
33020         assert(d.datacount_fg_bold == 0);
33021         assert(d.throughput_label_fg_color == 0);
33022         assert(d.throughput_label_bg_color == 0);
33023         assert(d.throughput_label_fg_bold == 0);
33024         assert(d.throughput_fg_color == 0);
33025         assert(d.throughput_bg_color == 0);
33026         assert(d.throughput_fg_bold == 0);
33027         assert(d.time_label_fg_color == 0);
33028         assert(d.time_label_bg_color == 0);
33029         assert(d.time_label_fg_bold == 0);
33030         assert(d.percent_fg_color == 0);
33031         assert(d.percent_bg_color == 0);
33032         assert(d.percent_fg_bold == 0);
33033         assert(d.barbrace_fg_color == 0);
33034         assert(d.barbrace_bg_color == 0);
33035         assert(d.barbrace_fg_bold == 0);
33036         assert(d.bar_fg_color == 0);
33037         assert(d.bar_bg_color == 0);
33038         assert(d.bar_fg_bold == 0);
33039         assert(io.in == 0);
33040         assert(io.out == 1);
33041         assert(io.in_ready == 0);
33042         assert(io.out_ready == 0);
33043         assert(io.eof_in == 0);
33044         assert(io.eof_out == 0);
33045         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33046         /* assert(io.cbuf == 0x0); */
33047         assert(io.last_read == 0);
33048         assert(io.last_write == 0);
33049         assert(io.total_read == 0);
33050         assert(io.total_write == 0);
33051         assert(io.total_size == 0);
33052         assert(io.total_size_known == 0);
33053         assert(io.timeout == 250000);
33054 
33055         tmp_rcfile = fopen("test-rcfile.txt", "w");
33056         assert(tmp_rcfile != 0);
33057         fprintf(tmp_rcfile, "count-foreground: green");
33058         fclose(tmp_rcfile);
33059 
33060         clear_errno();
33061         assert(test_parse_rc(out,0));
33062 
33063 #ifdef PRINT_DEBUG
33064         print();
33065 #endif
33066         assert(d.start_time == 0);
33067         assert(d.total_time == 0);
33068         assert(d.current_time == 0);
33069         assert(d.elapsed_time == 0);
33070         assert(d.percent_complete == 0);
33071         assert(d.display_interval == 1);
33072         assert(d.overtime_flag == 0);
33073         assert(d.k == 1024);
33074         assert(d.twiddle == '-');
33075         assert(d.manual_width == 0);
33076         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33077         assert(d.display_datacount == 1);
33078         assert(d.display_throughput == 1);
33079         assert(d.display_time == 1);
33080         assert(d.display_percent == 1);
33081         assert(d.display_bar == 1);
33082         assert(d.display_summary == 1);
33083         assert(d.display_ansi == 0);
33084         assert(d.twiddle_fg_color == 0);
33085         assert(d.twiddle_bg_color == 0);
33086         assert(d.twiddle_fg_bold == 0);
33087         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
33088         assert(d.datacount_bg_color == 0);
33089         assert(d.datacount_fg_bold == 0);
33090         assert(d.throughput_label_fg_color == 0);
33091         assert(d.throughput_label_bg_color == 0);
33092         assert(d.throughput_label_fg_bold == 0);
33093         assert(d.throughput_fg_color == 0);
33094         assert(d.throughput_bg_color == 0);
33095         assert(d.throughput_fg_bold == 0);
33096         assert(d.time_label_fg_color == 0);
33097         assert(d.time_label_bg_color == 0);
33098         assert(d.time_label_fg_bold == 0);
33099         assert(d.percent_fg_color == 0);
33100         assert(d.percent_bg_color == 0);
33101         assert(d.percent_fg_bold == 0);
33102         assert(d.barbrace_fg_color == 0);
33103         assert(d.barbrace_bg_color == 0);
33104         assert(d.barbrace_fg_bold == 0);
33105         assert(d.bar_fg_color == 0);
33106         assert(d.bar_bg_color == 0);
33107         assert(d.bar_fg_bold == 0);
33108         assert(io.in == 0);
33109         assert(io.out == 1);
33110         assert(io.in_ready == 0);
33111         assert(io.out_ready == 0);
33112         assert(io.eof_in == 0);
33113         assert(io.eof_out == 0);
33114         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33115         /* assert(io.cbuf == 0x0); */
33116         assert(io.last_read == 0);
33117         assert(io.last_write == 0);
33118         assert(io.total_read == 0);
33119         assert(io.total_write == 0);
33120         assert(io.total_size == 0);
33121         assert(io.total_size_known == 0);
33122         assert(io.timeout == 250000);
33123 
33124         tmp_rcfile = fopen("test-rcfile.txt", "w");
33125         assert(tmp_rcfile != 0);
33126         fprintf(tmp_rcfile, "count-foreground: yellow");
33127         fclose(tmp_rcfile);
33128 
33129         clear_errno();
33130         assert(test_parse_rc(out,0));
33131 
33132 #ifdef PRINT_DEBUG
33133         print();
33134 #endif
33135         assert(d.start_time == 0);
33136         assert(d.total_time == 0);
33137         assert(d.current_time == 0);
33138         assert(d.elapsed_time == 0);
33139         assert(d.percent_complete == 0);
33140         assert(d.display_interval == 1);
33141         assert(d.overtime_flag == 0);
33142         assert(d.k == 1024);
33143         assert(d.twiddle == '-');
33144         assert(d.manual_width == 0);
33145         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33146         assert(d.display_datacount == 1);
33147         assert(d.display_throughput == 1);
33148         assert(d.display_time == 1);
33149         assert(d.display_percent == 1);
33150         assert(d.display_bar == 1);
33151         assert(d.display_summary == 1);
33152         assert(d.display_ansi == 0);
33153         assert(d.twiddle_fg_color == 0);
33154         assert(d.twiddle_bg_color == 0);
33155         assert(d.twiddle_fg_bold == 0);
33156         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
33157         assert(d.datacount_bg_color == 0);
33158         assert(d.datacount_fg_bold == 0);
33159         assert(d.throughput_label_fg_color == 0);
33160         assert(d.throughput_label_bg_color == 0);
33161         assert(d.throughput_label_fg_bold == 0);
33162         assert(d.throughput_fg_color == 0);
33163         assert(d.throughput_bg_color == 0);
33164         assert(d.throughput_fg_bold == 0);
33165         assert(d.time_label_fg_color == 0);
33166         assert(d.time_label_bg_color == 0);
33167         assert(d.time_label_fg_bold == 0);
33168         assert(d.percent_fg_color == 0);
33169         assert(d.percent_bg_color == 0);
33170         assert(d.percent_fg_bold == 0);
33171         assert(d.barbrace_fg_color == 0);
33172         assert(d.barbrace_bg_color == 0);
33173         assert(d.barbrace_fg_bold == 0);
33174         assert(d.bar_fg_color == 0);
33175         assert(d.bar_bg_color == 0);
33176         assert(d.bar_fg_bold == 0);
33177         assert(io.in == 0);
33178         assert(io.out == 1);
33179         assert(io.in_ready == 0);
33180         assert(io.out_ready == 0);
33181         assert(io.eof_in == 0);
33182         assert(io.eof_out == 0);
33183         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33184         /* assert(io.cbuf == 0x0); */
33185         assert(io.last_read == 0);
33186         assert(io.last_write == 0);
33187         assert(io.total_read == 0);
33188         assert(io.total_write == 0);
33189         assert(io.total_size == 0);
33190         assert(io.total_size_known == 0);
33191         assert(io.timeout == 250000);
33192 
33193         tmp_rcfile = fopen("test-rcfile.txt", "w");
33194         assert(tmp_rcfile != 0);
33195         fprintf(tmp_rcfile, "count-foreground: blue");
33196         fclose(tmp_rcfile);
33197 
33198         clear_errno();
33199         assert(test_parse_rc(out,0));
33200 
33201 #ifdef PRINT_DEBUG
33202         print();
33203 #endif
33204         assert(d.start_time == 0);
33205         assert(d.total_time == 0);
33206         assert(d.current_time == 0);
33207         assert(d.elapsed_time == 0);
33208         assert(d.percent_complete == 0);
33209         assert(d.display_interval == 1);
33210         assert(d.overtime_flag == 0);
33211         assert(d.k == 1024);
33212         assert(d.twiddle == '-');
33213         assert(d.manual_width == 0);
33214         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33215         assert(d.display_datacount == 1);
33216         assert(d.display_throughput == 1);
33217         assert(d.display_time == 1);
33218         assert(d.display_percent == 1);
33219         assert(d.display_bar == 1);
33220         assert(d.display_summary == 1);
33221         assert(d.display_ansi == 0);
33222         assert(d.twiddle_fg_color == 0);
33223         assert(d.twiddle_bg_color == 0);
33224         assert(d.twiddle_fg_bold == 0);
33225         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
33226         assert(d.datacount_bg_color == 0);
33227         assert(d.datacount_fg_bold == 0);
33228         assert(d.throughput_label_fg_color == 0);
33229         assert(d.throughput_label_bg_color == 0);
33230         assert(d.throughput_label_fg_bold == 0);
33231         assert(d.throughput_fg_color == 0);
33232         assert(d.throughput_bg_color == 0);
33233         assert(d.throughput_fg_bold == 0);
33234         assert(d.time_label_fg_color == 0);
33235         assert(d.time_label_bg_color == 0);
33236         assert(d.time_label_fg_bold == 0);
33237         assert(d.percent_fg_color == 0);
33238         assert(d.percent_bg_color == 0);
33239         assert(d.percent_fg_bold == 0);
33240         assert(d.barbrace_fg_color == 0);
33241         assert(d.barbrace_bg_color == 0);
33242         assert(d.barbrace_fg_bold == 0);
33243         assert(d.bar_fg_color == 0);
33244         assert(d.bar_bg_color == 0);
33245         assert(d.bar_fg_bold == 0);
33246         assert(io.in == 0);
33247         assert(io.out == 1);
33248         assert(io.in_ready == 0);
33249         assert(io.out_ready == 0);
33250         assert(io.eof_in == 0);
33251         assert(io.eof_out == 0);
33252         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33253         /* assert(io.cbuf == 0x0); */
33254         assert(io.last_read == 0);
33255         assert(io.last_write == 0);
33256         assert(io.total_read == 0);
33257         assert(io.total_write == 0);
33258         assert(io.total_size == 0);
33259         assert(io.total_size_known == 0);
33260         assert(io.timeout == 250000);
33261 
33262         tmp_rcfile = fopen("test-rcfile.txt", "w");
33263         assert(tmp_rcfile != 0);
33264         fprintf(tmp_rcfile, "count-foreground: magenta");
33265         fclose(tmp_rcfile);
33266 
33267         clear_errno();
33268         assert(test_parse_rc(out,0));
33269 
33270 #ifdef PRINT_DEBUG
33271         print();
33272 #endif
33273         assert(d.start_time == 0);
33274         assert(d.total_time == 0);
33275         assert(d.current_time == 0);
33276         assert(d.elapsed_time == 0);
33277         assert(d.percent_complete == 0);
33278         assert(d.display_interval == 1);
33279         assert(d.overtime_flag == 0);
33280         assert(d.k == 1024);
33281         assert(d.twiddle == '-');
33282         assert(d.manual_width == 0);
33283         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33284         assert(d.display_datacount == 1);
33285         assert(d.display_throughput == 1);
33286         assert(d.display_time == 1);
33287         assert(d.display_percent == 1);
33288         assert(d.display_bar == 1);
33289         assert(d.display_summary == 1);
33290         assert(d.display_ansi == 0);
33291         assert(d.twiddle_fg_color == 0);
33292         assert(d.twiddle_bg_color == 0);
33293         assert(d.twiddle_fg_bold == 0);
33294         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
33295         assert(d.datacount_bg_color == 0);
33296         assert(d.datacount_fg_bold == 0);
33297         assert(d.throughput_label_fg_color == 0);
33298         assert(d.throughput_label_bg_color == 0);
33299         assert(d.throughput_label_fg_bold == 0);
33300         assert(d.throughput_fg_color == 0);
33301         assert(d.throughput_bg_color == 0);
33302         assert(d.throughput_fg_bold == 0);
33303         assert(d.time_label_fg_color == 0);
33304         assert(d.time_label_bg_color == 0);
33305         assert(d.time_label_fg_bold == 0);
33306         assert(d.percent_fg_color == 0);
33307         assert(d.percent_bg_color == 0);
33308         assert(d.percent_fg_bold == 0);
33309         assert(d.barbrace_fg_color == 0);
33310         assert(d.barbrace_bg_color == 0);
33311         assert(d.barbrace_fg_bold == 0);
33312         assert(d.bar_fg_color == 0);
33313         assert(d.bar_bg_color == 0);
33314         assert(d.bar_fg_bold == 0);
33315         assert(io.in == 0);
33316         assert(io.out == 1);
33317         assert(io.in_ready == 0);
33318         assert(io.out_ready == 0);
33319         assert(io.eof_in == 0);
33320         assert(io.eof_out == 0);
33321         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33322         /* assert(io.cbuf == 0x0); */
33323         assert(io.last_read == 0);
33324         assert(io.last_write == 0);
33325         assert(io.total_read == 0);
33326         assert(io.total_write == 0);
33327         assert(io.total_size == 0);
33328         assert(io.total_size_known == 0);
33329         assert(io.timeout == 250000);
33330 
33331         tmp_rcfile = fopen("test-rcfile.txt", "w");
33332         assert(tmp_rcfile != 0);
33333         fprintf(tmp_rcfile, "count-foreground: cyan");
33334         fclose(tmp_rcfile);
33335 
33336         clear_errno();
33337         assert(test_parse_rc(out,0));
33338 
33339 #ifdef PRINT_DEBUG
33340         print();
33341 #endif
33342         assert(d.start_time == 0);
33343         assert(d.total_time == 0);
33344         assert(d.current_time == 0);
33345         assert(d.elapsed_time == 0);
33346         assert(d.percent_complete == 0);
33347         assert(d.display_interval == 1);
33348         assert(d.overtime_flag == 0);
33349         assert(d.k == 1024);
33350         assert(d.twiddle == '-');
33351         assert(d.manual_width == 0);
33352         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33353         assert(d.display_datacount == 1);
33354         assert(d.display_throughput == 1);
33355         assert(d.display_time == 1);
33356         assert(d.display_percent == 1);
33357         assert(d.display_bar == 1);
33358         assert(d.display_summary == 1);
33359         assert(d.display_ansi == 0);
33360         assert(d.twiddle_fg_color == 0);
33361         assert(d.twiddle_bg_color == 0);
33362         assert(d.twiddle_fg_bold == 0);
33363         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
33364         assert(d.datacount_bg_color == 0);
33365         assert(d.datacount_fg_bold == 0);
33366         assert(d.throughput_label_fg_color == 0);
33367         assert(d.throughput_label_bg_color == 0);
33368         assert(d.throughput_label_fg_bold == 0);
33369         assert(d.throughput_fg_color == 0);
33370         assert(d.throughput_bg_color == 0);
33371         assert(d.throughput_fg_bold == 0);
33372         assert(d.time_label_fg_color == 0);
33373         assert(d.time_label_bg_color == 0);
33374         assert(d.time_label_fg_bold == 0);
33375         assert(d.percent_fg_color == 0);
33376         assert(d.percent_bg_color == 0);
33377         assert(d.percent_fg_bold == 0);
33378         assert(d.barbrace_fg_color == 0);
33379         assert(d.barbrace_bg_color == 0);
33380         assert(d.barbrace_fg_bold == 0);
33381         assert(d.bar_fg_color == 0);
33382         assert(d.bar_bg_color == 0);
33383         assert(d.bar_fg_bold == 0);
33384         assert(io.in == 0);
33385         assert(io.out == 1);
33386         assert(io.in_ready == 0);
33387         assert(io.out_ready == 0);
33388         assert(io.eof_in == 0);
33389         assert(io.eof_out == 0);
33390         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33391         /* assert(io.cbuf == 0x0); */
33392         assert(io.last_read == 0);
33393         assert(io.last_write == 0);
33394         assert(io.total_read == 0);
33395         assert(io.total_write == 0);
33396         assert(io.total_size == 0);
33397         assert(io.total_size_known == 0);
33398         assert(io.timeout == 250000);
33399 
33400         tmp_rcfile = fopen("test-rcfile.txt", "w");
33401         assert(tmp_rcfile != 0);
33402         fprintf(tmp_rcfile, "count-foreground: white");
33403         fclose(tmp_rcfile);
33404 
33405         clear_errno();
33406         assert(test_parse_rc(out,0));
33407 
33408 #ifdef PRINT_DEBUG
33409         print();
33410 #endif
33411         assert(d.start_time == 0);
33412         assert(d.total_time == 0);
33413         assert(d.current_time == 0);
33414         assert(d.elapsed_time == 0);
33415         assert(d.percent_complete == 0);
33416         assert(d.display_interval == 1);
33417         assert(d.overtime_flag == 0);
33418         assert(d.k == 1024);
33419         assert(d.twiddle == '-');
33420         assert(d.manual_width == 0);
33421         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33422         assert(d.display_datacount == 1);
33423         assert(d.display_throughput == 1);
33424         assert(d.display_time == 1);
33425         assert(d.display_percent == 1);
33426         assert(d.display_bar == 1);
33427         assert(d.display_summary == 1);
33428         assert(d.display_ansi == 0);
33429         assert(d.twiddle_fg_color == 0);
33430         assert(d.twiddle_bg_color == 0);
33431         assert(d.twiddle_fg_bold == 0);
33432         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
33433         assert(d.datacount_bg_color == 0);
33434         assert(d.datacount_fg_bold == 0);
33435         assert(d.throughput_label_fg_color == 0);
33436         assert(d.throughput_label_bg_color == 0);
33437         assert(d.throughput_label_fg_bold == 0);
33438         assert(d.throughput_fg_color == 0);
33439         assert(d.throughput_bg_color == 0);
33440         assert(d.throughput_fg_bold == 0);
33441         assert(d.time_label_fg_color == 0);
33442         assert(d.time_label_bg_color == 0);
33443         assert(d.time_label_fg_bold == 0);
33444         assert(d.percent_fg_color == 0);
33445         assert(d.percent_bg_color == 0);
33446         assert(d.percent_fg_bold == 0);
33447         assert(d.barbrace_fg_color == 0);
33448         assert(d.barbrace_bg_color == 0);
33449         assert(d.barbrace_fg_bold == 0);
33450         assert(d.bar_fg_color == 0);
33451         assert(d.bar_bg_color == 0);
33452         assert(d.bar_fg_bold == 0);
33453         assert(io.in == 0);
33454         assert(io.out == 1);
33455         assert(io.in_ready == 0);
33456         assert(io.out_ready == 0);
33457         assert(io.eof_in == 0);
33458         assert(io.eof_out == 0);
33459         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33460         /* assert(io.cbuf == 0x0); */
33461         assert(io.last_read == 0);
33462         assert(io.last_write == 0);
33463         assert(io.total_read == 0);
33464         assert(io.total_write == 0);
33465         assert(io.total_size == 0);
33466         assert(io.total_size_known == 0);
33467         assert(io.timeout == 250000);
33468 
33469         tmp_rcfile = fopen("test-rcfile.txt", "w");
33470         assert(tmp_rcfile != 0);
33471         fprintf(tmp_rcfile, "count-foreground: normal");
33472         fclose(tmp_rcfile);
33473 
33474         clear_errno();
33475         assert(test_parse_rc(out,0));
33476 
33477 #ifdef PRINT_DEBUG
33478         print();
33479 #endif
33480         assert(d.start_time == 0);
33481         assert(d.total_time == 0);
33482         assert(d.current_time == 0);
33483         assert(d.elapsed_time == 0);
33484         assert(d.percent_complete == 0);
33485         assert(d.display_interval == 1);
33486         assert(d.overtime_flag == 0);
33487         assert(d.k == 1024);
33488         assert(d.twiddle == '-');
33489         assert(d.manual_width == 0);
33490         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33491         assert(d.display_datacount == 1);
33492         assert(d.display_throughput == 1);
33493         assert(d.display_time == 1);
33494         assert(d.display_percent == 1);
33495         assert(d.display_bar == 1);
33496         assert(d.display_summary == 1);
33497         assert(d.display_ansi == 0);
33498         assert(d.twiddle_fg_color == 0);
33499         assert(d.twiddle_bg_color == 0);
33500         assert(d.twiddle_fg_bold == 0);
33501         assert(d.datacount_fg_color == 0);
33502         assert(d.datacount_bg_color == 0);
33503         assert(d.datacount_fg_bold == 0);
33504         assert(d.throughput_label_fg_color == 0);
33505         assert(d.throughput_label_bg_color == 0);
33506         assert(d.throughput_label_fg_bold == 0);
33507         assert(d.throughput_fg_color == 0);
33508         assert(d.throughput_bg_color == 0);
33509         assert(d.throughput_fg_bold == 0);
33510         assert(d.time_label_fg_color == 0);
33511         assert(d.time_label_bg_color == 0);
33512         assert(d.time_label_fg_bold == 0);
33513         assert(d.percent_fg_color == 0);
33514         assert(d.percent_bg_color == 0);
33515         assert(d.percent_fg_bold == 0);
33516         assert(d.barbrace_fg_color == 0);
33517         assert(d.barbrace_bg_color == 0);
33518         assert(d.barbrace_fg_bold == 0);
33519         assert(d.bar_fg_color == 0);
33520         assert(d.bar_bg_color == 0);
33521         assert(d.bar_fg_bold == 0);
33522         assert(io.in == 0);
33523         assert(io.out == 1);
33524         assert(io.in_ready == 0);
33525         assert(io.out_ready == 0);
33526         assert(io.eof_in == 0);
33527         assert(io.eof_out == 0);
33528         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33529         /* assert(io.cbuf == 0x0); */
33530         assert(io.last_read == 0);
33531         assert(io.last_write == 0);
33532         assert(io.total_read == 0);
33533         assert(io.total_write == 0);
33534         assert(io.total_size == 0);
33535         assert(io.total_size_known == 0);
33536         assert(io.timeout == 250000);
33537 
33538         tmp_rcfile = fopen("test-rcfile.txt", "w");
33539         assert(tmp_rcfile != 0);
33540         fprintf(tmp_rcfile, "count-background: kjshdfkjh");
33541         fclose(tmp_rcfile);
33542 
33543         clear_errno();
33544         assert(test_parse_rc(out,1));
33545 
33546 #ifdef PRINT_DEBUG
33547         print();
33548 #endif
33549         assert(d.start_time == 0);
33550         assert(d.total_time == 0);
33551         assert(d.current_time == 0);
33552         assert(d.elapsed_time == 0);
33553         assert(d.percent_complete == 0);
33554         assert(d.display_interval == 1);
33555         assert(d.overtime_flag == 0);
33556         assert(d.k == 1024);
33557         assert(d.twiddle == '-');
33558         assert(d.manual_width == 0);
33559         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33560         assert(d.display_datacount == 1);
33561         assert(d.display_throughput == 1);
33562         assert(d.display_time == 1);
33563         assert(d.display_percent == 1);
33564         assert(d.display_bar == 1);
33565         assert(d.display_summary == 1);
33566         assert(d.display_ansi == 0);
33567         assert(d.twiddle_fg_color == 0);
33568         assert(d.twiddle_bg_color == 0);
33569         assert(d.twiddle_fg_bold == 0);
33570         assert(d.datacount_fg_color == 0);
33571         assert(d.datacount_bg_color == 0);
33572         assert(d.datacount_fg_bold == 0);
33573         assert(d.throughput_label_fg_color == 0);
33574         assert(d.throughput_label_bg_color == 0);
33575         assert(d.throughput_label_fg_bold == 0);
33576         assert(d.throughput_fg_color == 0);
33577         assert(d.throughput_bg_color == 0);
33578         assert(d.throughput_fg_bold == 0);
33579         assert(d.time_label_fg_color == 0);
33580         assert(d.time_label_bg_color == 0);
33581         assert(d.time_label_fg_bold == 0);
33582         assert(d.percent_fg_color == 0);
33583         assert(d.percent_bg_color == 0);
33584         assert(d.percent_fg_bold == 0);
33585         assert(d.barbrace_fg_color == 0);
33586         assert(d.barbrace_bg_color == 0);
33587         assert(d.barbrace_fg_bold == 0);
33588         assert(d.bar_fg_color == 0);
33589         assert(d.bar_bg_color == 0);
33590         assert(d.bar_fg_bold == 0);
33591         assert(io.in == 0);
33592         assert(io.out == 1);
33593         assert(io.in_ready == 0);
33594         assert(io.out_ready == 0);
33595         assert(io.eof_in == 0);
33596         assert(io.eof_out == 0);
33597         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33598         /* assert(io.cbuf == 0x0); */
33599         assert(io.last_read == 0);
33600         assert(io.last_write == 0);
33601         assert(io.total_read == 0);
33602         assert(io.total_write == 0);
33603         assert(io.total_size == 0);
33604         assert(io.total_size_known == 0);
33605         assert(io.timeout == 250000);
33606 
33607         tmp_rcfile = fopen("test-rcfile.txt", "w");
33608         assert(tmp_rcfile != 0);
33609         fprintf(tmp_rcfile, "count-background: black");
33610         fclose(tmp_rcfile);
33611 
33612         clear_errno();
33613         assert(test_parse_rc(out,0));
33614 
33615 #ifdef PRINT_DEBUG
33616         print();
33617 #endif
33618         assert(d.start_time == 0);
33619         assert(d.total_time == 0);
33620         assert(d.current_time == 0);
33621         assert(d.elapsed_time == 0);
33622         assert(d.percent_complete == 0);
33623         assert(d.display_interval == 1);
33624         assert(d.overtime_flag == 0);
33625         assert(d.k == 1024);
33626         assert(d.twiddle == '-');
33627         assert(d.manual_width == 0);
33628         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33629         assert(d.display_datacount == 1);
33630         assert(d.display_throughput == 1);
33631         assert(d.display_time == 1);
33632         assert(d.display_percent == 1);
33633         assert(d.display_bar == 1);
33634         assert(d.display_summary == 1);
33635         assert(d.display_ansi == 0);
33636         assert(d.twiddle_fg_color == 0);
33637         assert(d.twiddle_bg_color == 0);
33638         assert(d.twiddle_fg_bold == 0);
33639         assert(d.datacount_fg_color == 0);
33640         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
33641         assert(d.datacount_fg_bold == 0);
33642         assert(d.throughput_label_fg_color == 0);
33643         assert(d.throughput_label_bg_color == 0);
33644         assert(d.throughput_label_fg_bold == 0);
33645         assert(d.throughput_fg_color == 0);
33646         assert(d.throughput_bg_color == 0);
33647         assert(d.throughput_fg_bold == 0);
33648         assert(d.time_label_fg_color == 0);
33649         assert(d.time_label_bg_color == 0);
33650         assert(d.time_label_fg_bold == 0);
33651         assert(d.percent_fg_color == 0);
33652         assert(d.percent_bg_color == 0);
33653         assert(d.percent_fg_bold == 0);
33654         assert(d.barbrace_fg_color == 0);
33655         assert(d.barbrace_bg_color == 0);
33656         assert(d.barbrace_fg_bold == 0);
33657         assert(d.bar_fg_color == 0);
33658         assert(d.bar_bg_color == 0);
33659         assert(d.bar_fg_bold == 0);
33660         assert(io.in == 0);
33661         assert(io.out == 1);
33662         assert(io.in_ready == 0);
33663         assert(io.out_ready == 0);
33664         assert(io.eof_in == 0);
33665         assert(io.eof_out == 0);
33666         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33667         /* assert(io.cbuf == 0x0); */
33668         assert(io.last_read == 0);
33669         assert(io.last_write == 0);
33670         assert(io.total_read == 0);
33671         assert(io.total_write == 0);
33672         assert(io.total_size == 0);
33673         assert(io.total_size_known == 0);
33674         assert(io.timeout == 250000);
33675 
33676         tmp_rcfile = fopen("test-rcfile.txt", "w");
33677         assert(tmp_rcfile != 0);
33678         fprintf(tmp_rcfile, "count-background: red");
33679         fclose(tmp_rcfile);
33680 
33681         clear_errno();
33682         assert(test_parse_rc(out,0));
33683 
33684 #ifdef PRINT_DEBUG
33685         print();
33686 #endif
33687         assert(d.start_time == 0);
33688         assert(d.total_time == 0);
33689         assert(d.current_time == 0);
33690         assert(d.elapsed_time == 0);
33691         assert(d.percent_complete == 0);
33692         assert(d.display_interval == 1);
33693         assert(d.overtime_flag == 0);
33694         assert(d.k == 1024);
33695         assert(d.twiddle == '-');
33696         assert(d.manual_width == 0);
33697         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33698         assert(d.display_datacount == 1);
33699         assert(d.display_throughput == 1);
33700         assert(d.display_time == 1);
33701         assert(d.display_percent == 1);
33702         assert(d.display_bar == 1);
33703         assert(d.display_summary == 1);
33704         assert(d.display_ansi == 0);
33705         assert(d.twiddle_fg_color == 0);
33706         assert(d.twiddle_bg_color == 0);
33707         assert(d.twiddle_fg_bold == 0);
33708         assert(d.datacount_fg_color == 0);
33709         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
33710         assert(d.datacount_fg_bold == 0);
33711         assert(d.throughput_label_fg_color == 0);
33712         assert(d.throughput_label_bg_color == 0);
33713         assert(d.throughput_label_fg_bold == 0);
33714         assert(d.throughput_fg_color == 0);
33715         assert(d.throughput_bg_color == 0);
33716         assert(d.throughput_fg_bold == 0);
33717         assert(d.time_label_fg_color == 0);
33718         assert(d.time_label_bg_color == 0);
33719         assert(d.time_label_fg_bold == 0);
33720         assert(d.percent_fg_color == 0);
33721         assert(d.percent_bg_color == 0);
33722         assert(d.percent_fg_bold == 0);
33723         assert(d.barbrace_fg_color == 0);
33724         assert(d.barbrace_bg_color == 0);
33725         assert(d.barbrace_fg_bold == 0);
33726         assert(d.bar_fg_color == 0);
33727         assert(d.bar_bg_color == 0);
33728         assert(d.bar_fg_bold == 0);
33729         assert(io.in == 0);
33730         assert(io.out == 1);
33731         assert(io.in_ready == 0);
33732         assert(io.out_ready == 0);
33733         assert(io.eof_in == 0);
33734         assert(io.eof_out == 0);
33735         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33736         /* assert(io.cbuf == 0x0); */
33737         assert(io.last_read == 0);
33738         assert(io.last_write == 0);
33739         assert(io.total_read == 0);
33740         assert(io.total_write == 0);
33741         assert(io.total_size == 0);
33742         assert(io.total_size_known == 0);
33743         assert(io.timeout == 250000);
33744 
33745         tmp_rcfile = fopen("test-rcfile.txt", "w");
33746         assert(tmp_rcfile != 0);
33747         fprintf(tmp_rcfile, "count-background: green");
33748         fclose(tmp_rcfile);
33749 
33750         clear_errno();
33751         assert(test_parse_rc(out,0));
33752 
33753 #ifdef PRINT_DEBUG
33754         print();
33755 #endif
33756         assert(d.start_time == 0);
33757         assert(d.total_time == 0);
33758         assert(d.current_time == 0);
33759         assert(d.elapsed_time == 0);
33760         assert(d.percent_complete == 0);
33761         assert(d.display_interval == 1);
33762         assert(d.overtime_flag == 0);
33763         assert(d.k == 1024);
33764         assert(d.twiddle == '-');
33765         assert(d.manual_width == 0);
33766         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33767         assert(d.display_datacount == 1);
33768         assert(d.display_throughput == 1);
33769         assert(d.display_time == 1);
33770         assert(d.display_percent == 1);
33771         assert(d.display_bar == 1);
33772         assert(d.display_summary == 1);
33773         assert(d.display_ansi == 0);
33774         assert(d.twiddle_fg_color == 0);
33775         assert(d.twiddle_bg_color == 0);
33776         assert(d.twiddle_fg_bold == 0);
33777         assert(d.datacount_fg_color == 0);
33778         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
33779         assert(d.datacount_fg_bold == 0);
33780         assert(d.throughput_label_fg_color == 0);
33781         assert(d.throughput_label_bg_color == 0);
33782         assert(d.throughput_label_fg_bold == 0);
33783         assert(d.throughput_fg_color == 0);
33784         assert(d.throughput_bg_color == 0);
33785         assert(d.throughput_fg_bold == 0);
33786         assert(d.time_label_fg_color == 0);
33787         assert(d.time_label_bg_color == 0);
33788         assert(d.time_label_fg_bold == 0);
33789         assert(d.percent_fg_color == 0);
33790         assert(d.percent_bg_color == 0);
33791         assert(d.percent_fg_bold == 0);
33792         assert(d.barbrace_fg_color == 0);
33793         assert(d.barbrace_bg_color == 0);
33794         assert(d.barbrace_fg_bold == 0);
33795         assert(d.bar_fg_color == 0);
33796         assert(d.bar_bg_color == 0);
33797         assert(d.bar_fg_bold == 0);
33798         assert(io.in == 0);
33799         assert(io.out == 1);
33800         assert(io.in_ready == 0);
33801         assert(io.out_ready == 0);
33802         assert(io.eof_in == 0);
33803         assert(io.eof_out == 0);
33804         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33805         /* assert(io.cbuf == 0x0); */
33806         assert(io.last_read == 0);
33807         assert(io.last_write == 0);
33808         assert(io.total_read == 0);
33809         assert(io.total_write == 0);
33810         assert(io.total_size == 0);
33811         assert(io.total_size_known == 0);
33812         assert(io.timeout == 250000);
33813 
33814         tmp_rcfile = fopen("test-rcfile.txt", "w");
33815         assert(tmp_rcfile != 0);
33816         fprintf(tmp_rcfile, "count-background: yellow");
33817         fclose(tmp_rcfile);
33818 
33819         clear_errno();
33820         assert(test_parse_rc(out,0));
33821 
33822 #ifdef PRINT_DEBUG
33823         print();
33824 #endif
33825         assert(d.start_time == 0);
33826         assert(d.total_time == 0);
33827         assert(d.current_time == 0);
33828         assert(d.elapsed_time == 0);
33829         assert(d.percent_complete == 0);
33830         assert(d.display_interval == 1);
33831         assert(d.overtime_flag == 0);
33832         assert(d.k == 1024);
33833         assert(d.twiddle == '-');
33834         assert(d.manual_width == 0);
33835         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33836         assert(d.display_datacount == 1);
33837         assert(d.display_throughput == 1);
33838         assert(d.display_time == 1);
33839         assert(d.display_percent == 1);
33840         assert(d.display_bar == 1);
33841         assert(d.display_summary == 1);
33842         assert(d.display_ansi == 0);
33843         assert(d.twiddle_fg_color == 0);
33844         assert(d.twiddle_bg_color == 0);
33845         assert(d.twiddle_fg_bold == 0);
33846         assert(d.datacount_fg_color == 0);
33847         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
33848         assert(d.datacount_fg_bold == 0);
33849         assert(d.throughput_label_fg_color == 0);
33850         assert(d.throughput_label_bg_color == 0);
33851         assert(d.throughput_label_fg_bold == 0);
33852         assert(d.throughput_fg_color == 0);
33853         assert(d.throughput_bg_color == 0);
33854         assert(d.throughput_fg_bold == 0);
33855         assert(d.time_label_fg_color == 0);
33856         assert(d.time_label_bg_color == 0);
33857         assert(d.time_label_fg_bold == 0);
33858         assert(d.percent_fg_color == 0);
33859         assert(d.percent_bg_color == 0);
33860         assert(d.percent_fg_bold == 0);
33861         assert(d.barbrace_fg_color == 0);
33862         assert(d.barbrace_bg_color == 0);
33863         assert(d.barbrace_fg_bold == 0);
33864         assert(d.bar_fg_color == 0);
33865         assert(d.bar_bg_color == 0);
33866         assert(d.bar_fg_bold == 0);
33867         assert(io.in == 0);
33868         assert(io.out == 1);
33869         assert(io.in_ready == 0);
33870         assert(io.out_ready == 0);
33871         assert(io.eof_in == 0);
33872         assert(io.eof_out == 0);
33873         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33874         /* assert(io.cbuf == 0x0); */
33875         assert(io.last_read == 0);
33876         assert(io.last_write == 0);
33877         assert(io.total_read == 0);
33878         assert(io.total_write == 0);
33879         assert(io.total_size == 0);
33880         assert(io.total_size_known == 0);
33881         assert(io.timeout == 250000);
33882 
33883         tmp_rcfile = fopen("test-rcfile.txt", "w");
33884         assert(tmp_rcfile != 0);
33885         fprintf(tmp_rcfile, "count-background: blue");
33886         fclose(tmp_rcfile);
33887 
33888         clear_errno();
33889         assert(test_parse_rc(out,0));
33890 
33891 #ifdef PRINT_DEBUG
33892         print();
33893 #endif
33894         assert(d.start_time == 0);
33895         assert(d.total_time == 0);
33896         assert(d.current_time == 0);
33897         assert(d.elapsed_time == 0);
33898         assert(d.percent_complete == 0);
33899         assert(d.display_interval == 1);
33900         assert(d.overtime_flag == 0);
33901         assert(d.k == 1024);
33902         assert(d.twiddle == '-');
33903         assert(d.manual_width == 0);
33904         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33905         assert(d.display_datacount == 1);
33906         assert(d.display_throughput == 1);
33907         assert(d.display_time == 1);
33908         assert(d.display_percent == 1);
33909         assert(d.display_bar == 1);
33910         assert(d.display_summary == 1);
33911         assert(d.display_ansi == 0);
33912         assert(d.twiddle_fg_color == 0);
33913         assert(d.twiddle_bg_color == 0);
33914         assert(d.twiddle_fg_bold == 0);
33915         assert(d.datacount_fg_color == 0);
33916         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
33917         assert(d.datacount_fg_bold == 0);
33918         assert(d.throughput_label_fg_color == 0);
33919         assert(d.throughput_label_bg_color == 0);
33920         assert(d.throughput_label_fg_bold == 0);
33921         assert(d.throughput_fg_color == 0);
33922         assert(d.throughput_bg_color == 0);
33923         assert(d.throughput_fg_bold == 0);
33924         assert(d.time_label_fg_color == 0);
33925         assert(d.time_label_bg_color == 0);
33926         assert(d.time_label_fg_bold == 0);
33927         assert(d.percent_fg_color == 0);
33928         assert(d.percent_bg_color == 0);
33929         assert(d.percent_fg_bold == 0);
33930         assert(d.barbrace_fg_color == 0);
33931         assert(d.barbrace_bg_color == 0);
33932         assert(d.barbrace_fg_bold == 0);
33933         assert(d.bar_fg_color == 0);
33934         assert(d.bar_bg_color == 0);
33935         assert(d.bar_fg_bold == 0);
33936         assert(io.in == 0);
33937         assert(io.out == 1);
33938         assert(io.in_ready == 0);
33939         assert(io.out_ready == 0);
33940         assert(io.eof_in == 0);
33941         assert(io.eof_out == 0);
33942         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
33943         /* assert(io.cbuf == 0x0); */
33944         assert(io.last_read == 0);
33945         assert(io.last_write == 0);
33946         assert(io.total_read == 0);
33947         assert(io.total_write == 0);
33948         assert(io.total_size == 0);
33949         assert(io.total_size_known == 0);
33950         assert(io.timeout == 250000);
33951 
33952         tmp_rcfile = fopen("test-rcfile.txt", "w");
33953         assert(tmp_rcfile != 0);
33954         fprintf(tmp_rcfile, "count-background: magenta");
33955         fclose(tmp_rcfile);
33956 
33957         clear_errno();
33958         assert(test_parse_rc(out,0));
33959 
33960 #ifdef PRINT_DEBUG
33961         print();
33962 #endif
33963         assert(d.start_time == 0);
33964         assert(d.total_time == 0);
33965         assert(d.current_time == 0);
33966         assert(d.elapsed_time == 0);
33967         assert(d.percent_complete == 0);
33968         assert(d.display_interval == 1);
33969         assert(d.overtime_flag == 0);
33970         assert(d.k == 1024);
33971         assert(d.twiddle == '-');
33972         assert(d.manual_width == 0);
33973         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
33974         assert(d.display_datacount == 1);
33975         assert(d.display_throughput == 1);
33976         assert(d.display_time == 1);
33977         assert(d.display_percent == 1);
33978         assert(d.display_bar == 1);
33979         assert(d.display_summary == 1);
33980         assert(d.display_ansi == 0);
33981         assert(d.twiddle_fg_color == 0);
33982         assert(d.twiddle_bg_color == 0);
33983         assert(d.twiddle_fg_bold == 0);
33984         assert(d.datacount_fg_color == 0);
33985         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
33986         assert(d.datacount_fg_bold == 0);
33987         assert(d.throughput_label_fg_color == 0);
33988         assert(d.throughput_label_bg_color == 0);
33989         assert(d.throughput_label_fg_bold == 0);
33990         assert(d.throughput_fg_color == 0);
33991         assert(d.throughput_bg_color == 0);
33992         assert(d.throughput_fg_bold == 0);
33993         assert(d.time_label_fg_color == 0);
33994         assert(d.time_label_bg_color == 0);
33995         assert(d.time_label_fg_bold == 0);
33996         assert(d.percent_fg_color == 0);
33997         assert(d.percent_bg_color == 0);
33998         assert(d.percent_fg_bold == 0);
33999         assert(d.barbrace_fg_color == 0);
34000         assert(d.barbrace_bg_color == 0);
34001         assert(d.barbrace_fg_bold == 0);
34002         assert(d.bar_fg_color == 0);
34003         assert(d.bar_bg_color == 0);
34004         assert(d.bar_fg_bold == 0);
34005         assert(io.in == 0);
34006         assert(io.out == 1);
34007         assert(io.in_ready == 0);
34008         assert(io.out_ready == 0);
34009         assert(io.eof_in == 0);
34010         assert(io.eof_out == 0);
34011         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34012         /* assert(io.cbuf == 0x0); */
34013         assert(io.last_read == 0);
34014         assert(io.last_write == 0);
34015         assert(io.total_read == 0);
34016         assert(io.total_write == 0);
34017         assert(io.total_size == 0);
34018         assert(io.total_size_known == 0);
34019         assert(io.timeout == 250000);
34020 
34021         tmp_rcfile = fopen("test-rcfile.txt", "w");
34022         assert(tmp_rcfile != 0);
34023         fprintf(tmp_rcfile, "count-background: cyan");
34024         fclose(tmp_rcfile);
34025 
34026         clear_errno();
34027         assert(test_parse_rc(out,0));
34028 
34029 #ifdef PRINT_DEBUG
34030         print();
34031 #endif
34032         assert(d.start_time == 0);
34033         assert(d.total_time == 0);
34034         assert(d.current_time == 0);
34035         assert(d.elapsed_time == 0);
34036         assert(d.percent_complete == 0);
34037         assert(d.display_interval == 1);
34038         assert(d.overtime_flag == 0);
34039         assert(d.k == 1024);
34040         assert(d.twiddle == '-');
34041         assert(d.manual_width == 0);
34042         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34043         assert(d.display_datacount == 1);
34044         assert(d.display_throughput == 1);
34045         assert(d.display_time == 1);
34046         assert(d.display_percent == 1);
34047         assert(d.display_bar == 1);
34048         assert(d.display_summary == 1);
34049         assert(d.display_ansi == 0);
34050         assert(d.twiddle_fg_color == 0);
34051         assert(d.twiddle_bg_color == 0);
34052         assert(d.twiddle_fg_bold == 0);
34053         assert(d.datacount_fg_color == 0);
34054         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
34055         assert(d.datacount_fg_bold == 0);
34056         assert(d.throughput_label_fg_color == 0);
34057         assert(d.throughput_label_bg_color == 0);
34058         assert(d.throughput_label_fg_bold == 0);
34059         assert(d.throughput_fg_color == 0);
34060         assert(d.throughput_bg_color == 0);
34061         assert(d.throughput_fg_bold == 0);
34062         assert(d.time_label_fg_color == 0);
34063         assert(d.time_label_bg_color == 0);
34064         assert(d.time_label_fg_bold == 0);
34065         assert(d.percent_fg_color == 0);
34066         assert(d.percent_bg_color == 0);
34067         assert(d.percent_fg_bold == 0);
34068         assert(d.barbrace_fg_color == 0);
34069         assert(d.barbrace_bg_color == 0);
34070         assert(d.barbrace_fg_bold == 0);
34071         assert(d.bar_fg_color == 0);
34072         assert(d.bar_bg_color == 0);
34073         assert(d.bar_fg_bold == 0);
34074         assert(io.in == 0);
34075         assert(io.out == 1);
34076         assert(io.in_ready == 0);
34077         assert(io.out_ready == 0);
34078         assert(io.eof_in == 0);
34079         assert(io.eof_out == 0);
34080         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34081         /* assert(io.cbuf == 0x0); */
34082         assert(io.last_read == 0);
34083         assert(io.last_write == 0);
34084         assert(io.total_read == 0);
34085         assert(io.total_write == 0);
34086         assert(io.total_size == 0);
34087         assert(io.total_size_known == 0);
34088         assert(io.timeout == 250000);
34089 
34090         tmp_rcfile = fopen("test-rcfile.txt", "w");
34091         assert(tmp_rcfile != 0);
34092         fprintf(tmp_rcfile, "count-background: white");
34093         fclose(tmp_rcfile);
34094 
34095         clear_errno();
34096         assert(test_parse_rc(out,0));
34097 
34098 #ifdef PRINT_DEBUG
34099         print();
34100 #endif
34101         assert(d.start_time == 0);
34102         assert(d.total_time == 0);
34103         assert(d.current_time == 0);
34104         assert(d.elapsed_time == 0);
34105         assert(d.percent_complete == 0);
34106         assert(d.display_interval == 1);
34107         assert(d.overtime_flag == 0);
34108         assert(d.k == 1024);
34109         assert(d.twiddle == '-');
34110         assert(d.manual_width == 0);
34111         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34112         assert(d.display_datacount == 1);
34113         assert(d.display_throughput == 1);
34114         assert(d.display_time == 1);
34115         assert(d.display_percent == 1);
34116         assert(d.display_bar == 1);
34117         assert(d.display_summary == 1);
34118         assert(d.display_ansi == 0);
34119         assert(d.twiddle_fg_color == 0);
34120         assert(d.twiddle_bg_color == 0);
34121         assert(d.twiddle_fg_bold == 0);
34122         assert(d.datacount_fg_color == 0);
34123         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
34124         assert(d.datacount_fg_bold == 0);
34125         assert(d.throughput_label_fg_color == 0);
34126         assert(d.throughput_label_bg_color == 0);
34127         assert(d.throughput_label_fg_bold == 0);
34128         assert(d.throughput_fg_color == 0);
34129         assert(d.throughput_bg_color == 0);
34130         assert(d.throughput_fg_bold == 0);
34131         assert(d.time_label_fg_color == 0);
34132         assert(d.time_label_bg_color == 0);
34133         assert(d.time_label_fg_bold == 0);
34134         assert(d.percent_fg_color == 0);
34135         assert(d.percent_bg_color == 0);
34136         assert(d.percent_fg_bold == 0);
34137         assert(d.barbrace_fg_color == 0);
34138         assert(d.barbrace_bg_color == 0);
34139         assert(d.barbrace_fg_bold == 0);
34140         assert(d.bar_fg_color == 0);
34141         assert(d.bar_bg_color == 0);
34142         assert(d.bar_fg_bold == 0);
34143         assert(io.in == 0);
34144         assert(io.out == 1);
34145         assert(io.in_ready == 0);
34146         assert(io.out_ready == 0);
34147         assert(io.eof_in == 0);
34148         assert(io.eof_out == 0);
34149         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34150         /* assert(io.cbuf == 0x0); */
34151         assert(io.last_read == 0);
34152         assert(io.last_write == 0);
34153         assert(io.total_read == 0);
34154         assert(io.total_write == 0);
34155         assert(io.total_size == 0);
34156         assert(io.total_size_known == 0);
34157         assert(io.timeout == 250000);
34158 
34159         tmp_rcfile = fopen("test-rcfile.txt", "w");
34160         assert(tmp_rcfile != 0);
34161         fprintf(tmp_rcfile, "count-background: normal");
34162         fclose(tmp_rcfile);
34163 
34164         clear_errno();
34165         assert(test_parse_rc(out,0));
34166 
34167 #ifdef PRINT_DEBUG
34168         print();
34169 #endif
34170         assert(d.start_time == 0);
34171         assert(d.total_time == 0);
34172         assert(d.current_time == 0);
34173         assert(d.elapsed_time == 0);
34174         assert(d.percent_complete == 0);
34175         assert(d.display_interval == 1);
34176         assert(d.overtime_flag == 0);
34177         assert(d.k == 1024);
34178         assert(d.twiddle == '-');
34179         assert(d.manual_width == 0);
34180         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34181         assert(d.display_datacount == 1);
34182         assert(d.display_throughput == 1);
34183         assert(d.display_time == 1);
34184         assert(d.display_percent == 1);
34185         assert(d.display_bar == 1);
34186         assert(d.display_summary == 1);
34187         assert(d.display_ansi == 0);
34188         assert(d.twiddle_fg_color == 0);
34189         assert(d.twiddle_bg_color == 0);
34190         assert(d.twiddle_fg_bold == 0);
34191         assert(d.datacount_fg_color == 0);
34192         assert(d.datacount_bg_color == 0);
34193         assert(d.datacount_fg_bold == 0);
34194         assert(d.throughput_label_fg_color == 0);
34195         assert(d.throughput_label_bg_color == 0);
34196         assert(d.throughput_label_fg_bold == 0);
34197         assert(d.throughput_fg_color == 0);
34198         assert(d.throughput_bg_color == 0);
34199         assert(d.throughput_fg_bold == 0);
34200         assert(d.time_label_fg_color == 0);
34201         assert(d.time_label_bg_color == 0);
34202         assert(d.time_label_fg_bold == 0);
34203         assert(d.percent_fg_color == 0);
34204         assert(d.percent_bg_color == 0);
34205         assert(d.percent_fg_bold == 0);
34206         assert(d.barbrace_fg_color == 0);
34207         assert(d.barbrace_bg_color == 0);
34208         assert(d.barbrace_fg_bold == 0);
34209         assert(d.bar_fg_color == 0);
34210         assert(d.bar_bg_color == 0);
34211         assert(d.bar_fg_bold == 0);
34212         assert(io.in == 0);
34213         assert(io.out == 1);
34214         assert(io.in_ready == 0);
34215         assert(io.out_ready == 0);
34216         assert(io.eof_in == 0);
34217         assert(io.eof_out == 0);
34218         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34219         /* assert(io.cbuf == 0x0); */
34220         assert(io.last_read == 0);
34221         assert(io.last_write == 0);
34222         assert(io.total_read == 0);
34223         assert(io.total_write == 0);
34224         assert(io.total_size == 0);
34225         assert(io.total_size_known == 0);
34226         assert(io.timeout == 250000);
34227 
34228         tmp_rcfile = fopen("test-rcfile.txt", "w");
34229         assert(tmp_rcfile != 0);
34230         fprintf(tmp_rcfile, "count-bold: Sjkhg");
34231         fclose(tmp_rcfile);
34232 
34233         clear_errno();
34234         assert(test_parse_rc(out,1));
34235 
34236 #ifdef PRINT_DEBUG
34237         print();
34238 #endif
34239         assert(d.start_time == 0);
34240         assert(d.total_time == 0);
34241         assert(d.current_time == 0);
34242         assert(d.elapsed_time == 0);
34243         assert(d.percent_complete == 0);
34244         assert(d.display_interval == 1);
34245         assert(d.overtime_flag == 0);
34246         assert(d.k == 1024);
34247         assert(d.twiddle == '-');
34248         assert(d.manual_width == 0);
34249         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34250         assert(d.display_datacount == 1);
34251         assert(d.display_throughput == 1);
34252         assert(d.display_time == 1);
34253         assert(d.display_percent == 1);
34254         assert(d.display_bar == 1);
34255         assert(d.display_summary == 1);
34256         assert(d.display_ansi == 0);
34257         assert(d.twiddle_fg_color == 0);
34258         assert(d.twiddle_bg_color == 0);
34259         assert(d.twiddle_fg_bold == 0);
34260         assert(d.datacount_fg_color == 0);
34261         assert(d.datacount_bg_color == 0);
34262         assert(d.datacount_fg_bold == 0);
34263         assert(d.throughput_label_fg_color == 0);
34264         assert(d.throughput_label_bg_color == 0);
34265         assert(d.throughput_label_fg_bold == 0);
34266         assert(d.throughput_fg_color == 0);
34267         assert(d.throughput_bg_color == 0);
34268         assert(d.throughput_fg_bold == 0);
34269         assert(d.time_label_fg_color == 0);
34270         assert(d.time_label_bg_color == 0);
34271         assert(d.time_label_fg_bold == 0);
34272         assert(d.percent_fg_color == 0);
34273         assert(d.percent_bg_color == 0);
34274         assert(d.percent_fg_bold == 0);
34275         assert(d.barbrace_fg_color == 0);
34276         assert(d.barbrace_bg_color == 0);
34277         assert(d.barbrace_fg_bold == 0);
34278         assert(d.bar_fg_color == 0);
34279         assert(d.bar_bg_color == 0);
34280         assert(d.bar_fg_bold == 0);
34281         assert(io.in == 0);
34282         assert(io.out == 1);
34283         assert(io.in_ready == 0);
34284         assert(io.out_ready == 0);
34285         assert(io.eof_in == 0);
34286         assert(io.eof_out == 0);
34287         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34288         /* assert(io.cbuf == 0x0); */
34289         assert(io.last_read == 0);
34290         assert(io.last_write == 0);
34291         assert(io.total_read == 0);
34292         assert(io.total_write == 0);
34293         assert(io.total_size == 0);
34294         assert(io.total_size_known == 0);
34295         assert(io.timeout == 250000);
34296 
34297         tmp_rcfile = fopen("test-rcfile.txt", "w");
34298         assert(tmp_rcfile != 0);
34299         fprintf(tmp_rcfile, "count-bold: no");
34300         fclose(tmp_rcfile);
34301 
34302         clear_errno();
34303         assert(test_parse_rc(out,0));
34304 
34305 #ifdef PRINT_DEBUG
34306         print();
34307 #endif
34308         assert(d.start_time == 0);
34309         assert(d.total_time == 0);
34310         assert(d.current_time == 0);
34311         assert(d.elapsed_time == 0);
34312         assert(d.percent_complete == 0);
34313         assert(d.display_interval == 1);
34314         assert(d.overtime_flag == 0);
34315         assert(d.k == 1024);
34316         assert(d.twiddle == '-');
34317         assert(d.manual_width == 0);
34318         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34319         assert(d.display_datacount == 1);
34320         assert(d.display_throughput == 1);
34321         assert(d.display_time == 1);
34322         assert(d.display_percent == 1);
34323         assert(d.display_bar == 1);
34324         assert(d.display_summary == 1);
34325         assert(d.display_ansi == 0);
34326         assert(d.twiddle_fg_color == 0);
34327         assert(d.twiddle_bg_color == 0);
34328         assert(d.twiddle_fg_bold == 0);
34329         assert(d.datacount_fg_color == 0);
34330         assert(d.datacount_bg_color == 0);
34331         assert(d.datacount_fg_bold == 0);
34332         assert(d.throughput_label_fg_color == 0);
34333         assert(d.throughput_label_bg_color == 0);
34334         assert(d.throughput_label_fg_bold == 0);
34335         assert(d.throughput_fg_color == 0);
34336         assert(d.throughput_bg_color == 0);
34337         assert(d.throughput_fg_bold == 0);
34338         assert(d.time_label_fg_color == 0);
34339         assert(d.time_label_bg_color == 0);
34340         assert(d.time_label_fg_bold == 0);
34341         assert(d.percent_fg_color == 0);
34342         assert(d.percent_bg_color == 0);
34343         assert(d.percent_fg_bold == 0);
34344         assert(d.barbrace_fg_color == 0);
34345         assert(d.barbrace_bg_color == 0);
34346         assert(d.barbrace_fg_bold == 0);
34347         assert(d.bar_fg_color == 0);
34348         assert(d.bar_bg_color == 0);
34349         assert(d.bar_fg_bold == 0);
34350         assert(io.in == 0);
34351         assert(io.out == 1);
34352         assert(io.in_ready == 0);
34353         assert(io.out_ready == 0);
34354         assert(io.eof_in == 0);
34355         assert(io.eof_out == 0);
34356         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34357         /* assert(io.cbuf == 0x0); */
34358         assert(io.last_read == 0);
34359         assert(io.last_write == 0);
34360         assert(io.total_read == 0);
34361         assert(io.total_write == 0);
34362         assert(io.total_size == 0);
34363         assert(io.total_size_known == 0);
34364         assert(io.timeout == 250000);
34365 
34366         tmp_rcfile = fopen("test-rcfile.txt", "w");
34367         assert(tmp_rcfile != 0);
34368         fprintf(tmp_rcfile, "count-bold: yes");
34369         fclose(tmp_rcfile);
34370 
34371         clear_errno();
34372         assert(test_parse_rc(out,0));
34373 
34374 #ifdef PRINT_DEBUG
34375         print();
34376 #endif
34377         assert(d.start_time == 0);
34378         assert(d.total_time == 0);
34379         assert(d.current_time == 0);
34380         assert(d.elapsed_time == 0);
34381         assert(d.percent_complete == 0);
34382         assert(d.display_interval == 1);
34383         assert(d.overtime_flag == 0);
34384         assert(d.k == 1024);
34385         assert(d.twiddle == '-');
34386         assert(d.manual_width == 0);
34387         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34388         assert(d.display_datacount == 1);
34389         assert(d.display_throughput == 1);
34390         assert(d.display_time == 1);
34391         assert(d.display_percent == 1);
34392         assert(d.display_bar == 1);
34393         assert(d.display_summary == 1);
34394         assert(d.display_ansi == 0);
34395         assert(d.twiddle_fg_color == 0);
34396         assert(d.twiddle_bg_color == 0);
34397         assert(d.twiddle_fg_bold == 0);
34398         assert(d.datacount_fg_color == 0);
34399         assert(d.datacount_bg_color == 0);
34400         assert(d.datacount_fg_bold == 1);
34401         assert(d.throughput_label_fg_color == 0);
34402         assert(d.throughput_label_bg_color == 0);
34403         assert(d.throughput_label_fg_bold == 0);
34404         assert(d.throughput_fg_color == 0);
34405         assert(d.throughput_bg_color == 0);
34406         assert(d.throughput_fg_bold == 0);
34407         assert(d.time_label_fg_color == 0);
34408         assert(d.time_label_bg_color == 0);
34409         assert(d.time_label_fg_bold == 0);
34410         assert(d.percent_fg_color == 0);
34411         assert(d.percent_bg_color == 0);
34412         assert(d.percent_fg_bold == 0);
34413         assert(d.barbrace_fg_color == 0);
34414         assert(d.barbrace_bg_color == 0);
34415         assert(d.barbrace_fg_bold == 0);
34416         assert(d.bar_fg_color == 0);
34417         assert(d.bar_bg_color == 0);
34418         assert(d.bar_fg_bold == 0);
34419         assert(io.in == 0);
34420         assert(io.out == 1);
34421         assert(io.in_ready == 0);
34422         assert(io.out_ready == 0);
34423         assert(io.eof_in == 0);
34424         assert(io.eof_out == 0);
34425         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34426         /* assert(io.cbuf == 0x0); */
34427         assert(io.last_read == 0);
34428         assert(io.last_write == 0);
34429         assert(io.total_read == 0);
34430         assert(io.total_write == 0);
34431         assert(io.total_size == 0);
34432         assert(io.total_size_known == 0);
34433         assert(io.timeout == 250000);
34434 
34435         tmp_rcfile = fopen("test-rcfile.txt", "w");
34436         assert(tmp_rcfile != 0);
34437         fprintf(tmp_rcfile, "count-bold: n");
34438         fclose(tmp_rcfile);
34439 
34440         clear_errno();
34441         assert(test_parse_rc(out,0));
34442 
34443 #ifdef PRINT_DEBUG
34444         print();
34445 #endif
34446         assert(d.start_time == 0);
34447         assert(d.total_time == 0);
34448         assert(d.current_time == 0);
34449         assert(d.elapsed_time == 0);
34450         assert(d.percent_complete == 0);
34451         assert(d.display_interval == 1);
34452         assert(d.overtime_flag == 0);
34453         assert(d.k == 1024);
34454         assert(d.twiddle == '-');
34455         assert(d.manual_width == 0);
34456         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34457         assert(d.display_datacount == 1);
34458         assert(d.display_throughput == 1);
34459         assert(d.display_time == 1);
34460         assert(d.display_percent == 1);
34461         assert(d.display_bar == 1);
34462         assert(d.display_summary == 1);
34463         assert(d.display_ansi == 0);
34464         assert(d.twiddle_fg_color == 0);
34465         assert(d.twiddle_bg_color == 0);
34466         assert(d.twiddle_fg_bold == 0);
34467         assert(d.datacount_fg_color == 0);
34468         assert(d.datacount_bg_color == 0);
34469         assert(d.datacount_fg_bold == 0);
34470         assert(d.throughput_label_fg_color == 0);
34471         assert(d.throughput_label_bg_color == 0);
34472         assert(d.throughput_label_fg_bold == 0);
34473         assert(d.throughput_fg_color == 0);
34474         assert(d.throughput_bg_color == 0);
34475         assert(d.throughput_fg_bold == 0);
34476         assert(d.time_label_fg_color == 0);
34477         assert(d.time_label_bg_color == 0);
34478         assert(d.time_label_fg_bold == 0);
34479         assert(d.percent_fg_color == 0);
34480         assert(d.percent_bg_color == 0);
34481         assert(d.percent_fg_bold == 0);
34482         assert(d.barbrace_fg_color == 0);
34483         assert(d.barbrace_bg_color == 0);
34484         assert(d.barbrace_fg_bold == 0);
34485         assert(d.bar_fg_color == 0);
34486         assert(d.bar_bg_color == 0);
34487         assert(d.bar_fg_bold == 0);
34488         assert(io.in == 0);
34489         assert(io.out == 1);
34490         assert(io.in_ready == 0);
34491         assert(io.out_ready == 0);
34492         assert(io.eof_in == 0);
34493         assert(io.eof_out == 0);
34494         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34495         /* assert(io.cbuf == 0x0); */
34496         assert(io.last_read == 0);
34497         assert(io.last_write == 0);
34498         assert(io.total_read == 0);
34499         assert(io.total_write == 0);
34500         assert(io.total_size == 0);
34501         assert(io.total_size_known == 0);
34502         assert(io.timeout == 250000);
34503 
34504         tmp_rcfile = fopen("test-rcfile.txt", "w");
34505         assert(tmp_rcfile != 0);
34506         fprintf(tmp_rcfile, "count-bold: y");
34507         fclose(tmp_rcfile);
34508 
34509         clear_errno();
34510         assert(test_parse_rc(out,0));
34511 
34512 #ifdef PRINT_DEBUG
34513         print();
34514 #endif
34515         assert(d.start_time == 0);
34516         assert(d.total_time == 0);
34517         assert(d.current_time == 0);
34518         assert(d.elapsed_time == 0);
34519         assert(d.percent_complete == 0);
34520         assert(d.display_interval == 1);
34521         assert(d.overtime_flag == 0);
34522         assert(d.k == 1024);
34523         assert(d.twiddle == '-');
34524         assert(d.manual_width == 0);
34525         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34526         assert(d.display_datacount == 1);
34527         assert(d.display_throughput == 1);
34528         assert(d.display_time == 1);
34529         assert(d.display_percent == 1);
34530         assert(d.display_bar == 1);
34531         assert(d.display_summary == 1);
34532         assert(d.display_ansi == 0);
34533         assert(d.twiddle_fg_color == 0);
34534         assert(d.twiddle_bg_color == 0);
34535         assert(d.twiddle_fg_bold == 0);
34536         assert(d.datacount_fg_color == 0);
34537         assert(d.datacount_bg_color == 0);
34538         assert(d.datacount_fg_bold == 1);
34539         assert(d.throughput_label_fg_color == 0);
34540         assert(d.throughput_label_bg_color == 0);
34541         assert(d.throughput_label_fg_bold == 0);
34542         assert(d.throughput_fg_color == 0);
34543         assert(d.throughput_bg_color == 0);
34544         assert(d.throughput_fg_bold == 0);
34545         assert(d.time_label_fg_color == 0);
34546         assert(d.time_label_bg_color == 0);
34547         assert(d.time_label_fg_bold == 0);
34548         assert(d.percent_fg_color == 0);
34549         assert(d.percent_bg_color == 0);
34550         assert(d.percent_fg_bold == 0);
34551         assert(d.barbrace_fg_color == 0);
34552         assert(d.barbrace_bg_color == 0);
34553         assert(d.barbrace_fg_bold == 0);
34554         assert(d.bar_fg_color == 0);
34555         assert(d.bar_bg_color == 0);
34556         assert(d.bar_fg_bold == 0);
34557         assert(io.in == 0);
34558         assert(io.out == 1);
34559         assert(io.in_ready == 0);
34560         assert(io.out_ready == 0);
34561         assert(io.eof_in == 0);
34562         assert(io.eof_out == 0);
34563         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34564         /* assert(io.cbuf == 0x0); */
34565         assert(io.last_read == 0);
34566         assert(io.last_write == 0);
34567         assert(io.total_read == 0);
34568         assert(io.total_write == 0);
34569         assert(io.total_size == 0);
34570         assert(io.total_size_known == 0);
34571         assert(io.timeout == 250000);
34572 
34573         tmp_rcfile = fopen("test-rcfile.txt", "w");
34574         assert(tmp_rcfile != 0);
34575         fprintf(tmp_rcfile, "count-bold: false");
34576         fclose(tmp_rcfile);
34577 
34578         clear_errno();
34579         assert(test_parse_rc(out,0));
34580 
34581 #ifdef PRINT_DEBUG
34582         print();
34583 #endif
34584         assert(d.start_time == 0);
34585         assert(d.total_time == 0);
34586         assert(d.current_time == 0);
34587         assert(d.elapsed_time == 0);
34588         assert(d.percent_complete == 0);
34589         assert(d.display_interval == 1);
34590         assert(d.overtime_flag == 0);
34591         assert(d.k == 1024);
34592         assert(d.twiddle == '-');
34593         assert(d.manual_width == 0);
34594         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34595         assert(d.display_datacount == 1);
34596         assert(d.display_throughput == 1);
34597         assert(d.display_time == 1);
34598         assert(d.display_percent == 1);
34599         assert(d.display_bar == 1);
34600         assert(d.display_summary == 1);
34601         assert(d.display_ansi == 0);
34602         assert(d.twiddle_fg_color == 0);
34603         assert(d.twiddle_bg_color == 0);
34604         assert(d.twiddle_fg_bold == 0);
34605         assert(d.datacount_fg_color == 0);
34606         assert(d.datacount_bg_color == 0);
34607         assert(d.datacount_fg_bold == 0);
34608         assert(d.throughput_label_fg_color == 0);
34609         assert(d.throughput_label_bg_color == 0);
34610         assert(d.throughput_label_fg_bold == 0);
34611         assert(d.throughput_fg_color == 0);
34612         assert(d.throughput_bg_color == 0);
34613         assert(d.throughput_fg_bold == 0);
34614         assert(d.time_label_fg_color == 0);
34615         assert(d.time_label_bg_color == 0);
34616         assert(d.time_label_fg_bold == 0);
34617         assert(d.percent_fg_color == 0);
34618         assert(d.percent_bg_color == 0);
34619         assert(d.percent_fg_bold == 0);
34620         assert(d.barbrace_fg_color == 0);
34621         assert(d.barbrace_bg_color == 0);
34622         assert(d.barbrace_fg_bold == 0);
34623         assert(d.bar_fg_color == 0);
34624         assert(d.bar_bg_color == 0);
34625         assert(d.bar_fg_bold == 0);
34626         assert(io.in == 0);
34627         assert(io.out == 1);
34628         assert(io.in_ready == 0);
34629         assert(io.out_ready == 0);
34630         assert(io.eof_in == 0);
34631         assert(io.eof_out == 0);
34632         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34633         /* assert(io.cbuf == 0x0); */
34634         assert(io.last_read == 0);
34635         assert(io.last_write == 0);
34636         assert(io.total_read == 0);
34637         assert(io.total_write == 0);
34638         assert(io.total_size == 0);
34639         assert(io.total_size_known == 0);
34640         assert(io.timeout == 250000);
34641 
34642         tmp_rcfile = fopen("test-rcfile.txt", "w");
34643         assert(tmp_rcfile != 0);
34644         fprintf(tmp_rcfile, "count-bold: true");
34645         fclose(tmp_rcfile);
34646 
34647         clear_errno();
34648         assert(test_parse_rc(out,0));
34649 
34650 #ifdef PRINT_DEBUG
34651         print();
34652 #endif
34653         assert(d.start_time == 0);
34654         assert(d.total_time == 0);
34655         assert(d.current_time == 0);
34656         assert(d.elapsed_time == 0);
34657         assert(d.percent_complete == 0);
34658         assert(d.display_interval == 1);
34659         assert(d.overtime_flag == 0);
34660         assert(d.k == 1024);
34661         assert(d.twiddle == '-');
34662         assert(d.manual_width == 0);
34663         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34664         assert(d.display_datacount == 1);
34665         assert(d.display_throughput == 1);
34666         assert(d.display_time == 1);
34667         assert(d.display_percent == 1);
34668         assert(d.display_bar == 1);
34669         assert(d.display_summary == 1);
34670         assert(d.display_ansi == 0);
34671         assert(d.twiddle_fg_color == 0);
34672         assert(d.twiddle_bg_color == 0);
34673         assert(d.twiddle_fg_bold == 0);
34674         assert(d.datacount_fg_color == 0);
34675         assert(d.datacount_bg_color == 0);
34676         assert(d.datacount_fg_bold == 1);
34677         assert(d.throughput_label_fg_color == 0);
34678         assert(d.throughput_label_bg_color == 0);
34679         assert(d.throughput_label_fg_bold == 0);
34680         assert(d.throughput_fg_color == 0);
34681         assert(d.throughput_bg_color == 0);
34682         assert(d.throughput_fg_bold == 0);
34683         assert(d.time_label_fg_color == 0);
34684         assert(d.time_label_bg_color == 0);
34685         assert(d.time_label_fg_bold == 0);
34686         assert(d.percent_fg_color == 0);
34687         assert(d.percent_bg_color == 0);
34688         assert(d.percent_fg_bold == 0);
34689         assert(d.barbrace_fg_color == 0);
34690         assert(d.barbrace_bg_color == 0);
34691         assert(d.barbrace_fg_bold == 0);
34692         assert(d.bar_fg_color == 0);
34693         assert(d.bar_bg_color == 0);
34694         assert(d.bar_fg_bold == 0);
34695         assert(io.in == 0);
34696         assert(io.out == 1);
34697         assert(io.in_ready == 0);
34698         assert(io.out_ready == 0);
34699         assert(io.eof_in == 0);
34700         assert(io.eof_out == 0);
34701         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34702         /* assert(io.cbuf == 0x0); */
34703         assert(io.last_read == 0);
34704         assert(io.last_write == 0);
34705         assert(io.total_read == 0);
34706         assert(io.total_write == 0);
34707         assert(io.total_size == 0);
34708         assert(io.total_size_known == 0);
34709         assert(io.timeout == 250000);
34710 
34711         tmp_rcfile = fopen("test-rcfile.txt", "w");
34712         assert(tmp_rcfile != 0);
34713         fprintf(tmp_rcfile, "count-bold: f");
34714         fclose(tmp_rcfile);
34715 
34716         clear_errno();
34717         assert(test_parse_rc(out,0));
34718 
34719 #ifdef PRINT_DEBUG
34720         print();
34721 #endif
34722         assert(d.start_time == 0);
34723         assert(d.total_time == 0);
34724         assert(d.current_time == 0);
34725         assert(d.elapsed_time == 0);
34726         assert(d.percent_complete == 0);
34727         assert(d.display_interval == 1);
34728         assert(d.overtime_flag == 0);
34729         assert(d.k == 1024);
34730         assert(d.twiddle == '-');
34731         assert(d.manual_width == 0);
34732         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34733         assert(d.display_datacount == 1);
34734         assert(d.display_throughput == 1);
34735         assert(d.display_time == 1);
34736         assert(d.display_percent == 1);
34737         assert(d.display_bar == 1);
34738         assert(d.display_summary == 1);
34739         assert(d.display_ansi == 0);
34740         assert(d.twiddle_fg_color == 0);
34741         assert(d.twiddle_bg_color == 0);
34742         assert(d.twiddle_fg_bold == 0);
34743         assert(d.datacount_fg_color == 0);
34744         assert(d.datacount_bg_color == 0);
34745         assert(d.datacount_fg_bold == 0);
34746         assert(d.throughput_label_fg_color == 0);
34747         assert(d.throughput_label_bg_color == 0);
34748         assert(d.throughput_label_fg_bold == 0);
34749         assert(d.throughput_fg_color == 0);
34750         assert(d.throughput_bg_color == 0);
34751         assert(d.throughput_fg_bold == 0);
34752         assert(d.time_label_fg_color == 0);
34753         assert(d.time_label_bg_color == 0);
34754         assert(d.time_label_fg_bold == 0);
34755         assert(d.percent_fg_color == 0);
34756         assert(d.percent_bg_color == 0);
34757         assert(d.percent_fg_bold == 0);
34758         assert(d.barbrace_fg_color == 0);
34759         assert(d.barbrace_bg_color == 0);
34760         assert(d.barbrace_fg_bold == 0);
34761         assert(d.bar_fg_color == 0);
34762         assert(d.bar_bg_color == 0);
34763         assert(d.bar_fg_bold == 0);
34764         assert(io.in == 0);
34765         assert(io.out == 1);
34766         assert(io.in_ready == 0);
34767         assert(io.out_ready == 0);
34768         assert(io.eof_in == 0);
34769         assert(io.eof_out == 0);
34770         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34771         /* assert(io.cbuf == 0x0); */
34772         assert(io.last_read == 0);
34773         assert(io.last_write == 0);
34774         assert(io.total_read == 0);
34775         assert(io.total_write == 0);
34776         assert(io.total_size == 0);
34777         assert(io.total_size_known == 0);
34778         assert(io.timeout == 250000);
34779 
34780         tmp_rcfile = fopen("test-rcfile.txt", "w");
34781         assert(tmp_rcfile != 0);
34782         fprintf(tmp_rcfile, "count-bold: t");
34783         fclose(tmp_rcfile);
34784 
34785         clear_errno();
34786         assert(test_parse_rc(out,0));
34787 
34788 #ifdef PRINT_DEBUG
34789         print();
34790 #endif
34791         assert(d.start_time == 0);
34792         assert(d.total_time == 0);
34793         assert(d.current_time == 0);
34794         assert(d.elapsed_time == 0);
34795         assert(d.percent_complete == 0);
34796         assert(d.display_interval == 1);
34797         assert(d.overtime_flag == 0);
34798         assert(d.k == 1024);
34799         assert(d.twiddle == '-');
34800         assert(d.manual_width == 0);
34801         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34802         assert(d.display_datacount == 1);
34803         assert(d.display_throughput == 1);
34804         assert(d.display_time == 1);
34805         assert(d.display_percent == 1);
34806         assert(d.display_bar == 1);
34807         assert(d.display_summary == 1);
34808         assert(d.display_ansi == 0);
34809         assert(d.twiddle_fg_color == 0);
34810         assert(d.twiddle_bg_color == 0);
34811         assert(d.twiddle_fg_bold == 0);
34812         assert(d.datacount_fg_color == 0);
34813         assert(d.datacount_bg_color == 0);
34814         assert(d.datacount_fg_bold == 1);
34815         assert(d.throughput_label_fg_color == 0);
34816         assert(d.throughput_label_bg_color == 0);
34817         assert(d.throughput_label_fg_bold == 0);
34818         assert(d.throughput_fg_color == 0);
34819         assert(d.throughput_bg_color == 0);
34820         assert(d.throughput_fg_bold == 0);
34821         assert(d.time_label_fg_color == 0);
34822         assert(d.time_label_bg_color == 0);
34823         assert(d.time_label_fg_bold == 0);
34824         assert(d.percent_fg_color == 0);
34825         assert(d.percent_bg_color == 0);
34826         assert(d.percent_fg_bold == 0);
34827         assert(d.barbrace_fg_color == 0);
34828         assert(d.barbrace_bg_color == 0);
34829         assert(d.barbrace_fg_bold == 0);
34830         assert(d.bar_fg_color == 0);
34831         assert(d.bar_bg_color == 0);
34832         assert(d.bar_fg_bold == 0);
34833         assert(io.in == 0);
34834         assert(io.out == 1);
34835         assert(io.in_ready == 0);
34836         assert(io.out_ready == 0);
34837         assert(io.eof_in == 0);
34838         assert(io.eof_out == 0);
34839         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34840         /* assert(io.cbuf == 0x0); */
34841         assert(io.last_read == 0);
34842         assert(io.last_write == 0);
34843         assert(io.total_read == 0);
34844         assert(io.total_write == 0);
34845         assert(io.total_size == 0);
34846         assert(io.total_size_known == 0);
34847         assert(io.timeout == 250000);
34848 
34849         tmp_rcfile = fopen("test-rcfile.txt", "w");
34850         assert(tmp_rcfile != 0);
34851         fprintf(tmp_rcfile, "count-bold: 0");
34852         fclose(tmp_rcfile);
34853 
34854         clear_errno();
34855         assert(test_parse_rc(out,0));
34856 
34857 #ifdef PRINT_DEBUG
34858         print();
34859 #endif
34860         assert(d.start_time == 0);
34861         assert(d.total_time == 0);
34862         assert(d.current_time == 0);
34863         assert(d.elapsed_time == 0);
34864         assert(d.percent_complete == 0);
34865         assert(d.display_interval == 1);
34866         assert(d.overtime_flag == 0);
34867         assert(d.k == 1024);
34868         assert(d.twiddle == '-');
34869         assert(d.manual_width == 0);
34870         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34871         assert(d.display_datacount == 1);
34872         assert(d.display_throughput == 1);
34873         assert(d.display_time == 1);
34874         assert(d.display_percent == 1);
34875         assert(d.display_bar == 1);
34876         assert(d.display_summary == 1);
34877         assert(d.display_ansi == 0);
34878         assert(d.twiddle_fg_color == 0);
34879         assert(d.twiddle_bg_color == 0);
34880         assert(d.twiddle_fg_bold == 0);
34881         assert(d.datacount_fg_color == 0);
34882         assert(d.datacount_bg_color == 0);
34883         assert(d.datacount_fg_bold == 0);
34884         assert(d.throughput_label_fg_color == 0);
34885         assert(d.throughput_label_bg_color == 0);
34886         assert(d.throughput_label_fg_bold == 0);
34887         assert(d.throughput_fg_color == 0);
34888         assert(d.throughput_bg_color == 0);
34889         assert(d.throughput_fg_bold == 0);
34890         assert(d.time_label_fg_color == 0);
34891         assert(d.time_label_bg_color == 0);
34892         assert(d.time_label_fg_bold == 0);
34893         assert(d.percent_fg_color == 0);
34894         assert(d.percent_bg_color == 0);
34895         assert(d.percent_fg_bold == 0);
34896         assert(d.barbrace_fg_color == 0);
34897         assert(d.barbrace_bg_color == 0);
34898         assert(d.barbrace_fg_bold == 0);
34899         assert(d.bar_fg_color == 0);
34900         assert(d.bar_bg_color == 0);
34901         assert(d.bar_fg_bold == 0);
34902         assert(io.in == 0);
34903         assert(io.out == 1);
34904         assert(io.in_ready == 0);
34905         assert(io.out_ready == 0);
34906         assert(io.eof_in == 0);
34907         assert(io.eof_out == 0);
34908         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34909         /* assert(io.cbuf == 0x0); */
34910         assert(io.last_read == 0);
34911         assert(io.last_write == 0);
34912         assert(io.total_read == 0);
34913         assert(io.total_write == 0);
34914         assert(io.total_size == 0);
34915         assert(io.total_size_known == 0);
34916         assert(io.timeout == 250000);
34917 
34918         tmp_rcfile = fopen("test-rcfile.txt", "w");
34919         assert(tmp_rcfile != 0);
34920         fprintf(tmp_rcfile, "count-bold: 1");
34921         fclose(tmp_rcfile);
34922 
34923         clear_errno();
34924         assert(test_parse_rc(out,0));
34925 
34926 #ifdef PRINT_DEBUG
34927         print();
34928 #endif
34929         assert(d.start_time == 0);
34930         assert(d.total_time == 0);
34931         assert(d.current_time == 0);
34932         assert(d.elapsed_time == 0);
34933         assert(d.percent_complete == 0);
34934         assert(d.display_interval == 1);
34935         assert(d.overtime_flag == 0);
34936         assert(d.k == 1024);
34937         assert(d.twiddle == '-');
34938         assert(d.manual_width == 0);
34939         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
34940         assert(d.display_datacount == 1);
34941         assert(d.display_throughput == 1);
34942         assert(d.display_time == 1);
34943         assert(d.display_percent == 1);
34944         assert(d.display_bar == 1);
34945         assert(d.display_summary == 1);
34946         assert(d.display_ansi == 0);
34947         assert(d.twiddle_fg_color == 0);
34948         assert(d.twiddle_bg_color == 0);
34949         assert(d.twiddle_fg_bold == 0);
34950         assert(d.datacount_fg_color == 0);
34951         assert(d.datacount_bg_color == 0);
34952         assert(d.datacount_fg_bold == 1);
34953         assert(d.throughput_label_fg_color == 0);
34954         assert(d.throughput_label_bg_color == 0);
34955         assert(d.throughput_label_fg_bold == 0);
34956         assert(d.throughput_fg_color == 0);
34957         assert(d.throughput_bg_color == 0);
34958         assert(d.throughput_fg_bold == 0);
34959         assert(d.time_label_fg_color == 0);
34960         assert(d.time_label_bg_color == 0);
34961         assert(d.time_label_fg_bold == 0);
34962         assert(d.percent_fg_color == 0);
34963         assert(d.percent_bg_color == 0);
34964         assert(d.percent_fg_bold == 0);
34965         assert(d.barbrace_fg_color == 0);
34966         assert(d.barbrace_bg_color == 0);
34967         assert(d.barbrace_fg_bold == 0);
34968         assert(d.bar_fg_color == 0);
34969         assert(d.bar_bg_color == 0);
34970         assert(d.bar_fg_bold == 0);
34971         assert(io.in == 0);
34972         assert(io.out == 1);
34973         assert(io.in_ready == 0);
34974         assert(io.out_ready == 0);
34975         assert(io.eof_in == 0);
34976         assert(io.eof_out == 0);
34977         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
34978         /* assert(io.cbuf == 0x0); */
34979         assert(io.last_read == 0);
34980         assert(io.last_write == 0);
34981         assert(io.total_read == 0);
34982         assert(io.total_write == 0);
34983         assert(io.total_size == 0);
34984         assert(io.total_size_known == 0);
34985         assert(io.timeout == 250000);
34986 
34987         tmp_rcfile = fopen("test-rcfile.txt", "w");
34988         assert(tmp_rcfile != 0);
34989         fprintf(tmp_rcfile, "count-bold: off");
34990         fclose(tmp_rcfile);
34991 
34992         clear_errno();
34993         assert(test_parse_rc(out,0));
34994 
34995 #ifdef PRINT_DEBUG
34996         print();
34997 #endif
34998         assert(d.start_time == 0);
34999         assert(d.total_time == 0);
35000         assert(d.current_time == 0);
35001         assert(d.elapsed_time == 0);
35002         assert(d.percent_complete == 0);
35003         assert(d.display_interval == 1);
35004         assert(d.overtime_flag == 0);
35005         assert(d.k == 1024);
35006         assert(d.twiddle == '-');
35007         assert(d.manual_width == 0);
35008         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
35009         assert(d.display_datacount == 1);
35010         assert(d.display_throughput == 1);
35011         assert(d.display_time == 1);
35012         assert(d.display_percent == 1);
35013         assert(d.display_bar == 1);
35014         assert(d.display_summary == 1);
35015         assert(d.display_ansi == 0);
35016         assert(d.twiddle_fg_color == 0);
35017         assert(d.twiddle_bg_color == 0);
35018         assert(d.twiddle_fg_bold == 0);
35019         assert(d.datacount_fg_color == 0);
35020         assert(d.datacount_bg_color == 0);
35021         assert(d.datacount_fg_bold == 0);
35022         assert(d.throughput_label_fg_color == 0);
35023         assert(d.throughput_label_bg_color == 0);
35024         assert(d.throughput_label_fg_bold == 0);
35025         assert(d.throughput_fg_color == 0);
35026         assert(d.throughput_bg_color == 0);
35027         assert(d.throughput_fg_bold == 0);
35028         assert(d.time_label_fg_color == 0);
35029         assert(d.time_label_bg_color == 0);
35030         assert(d.time_label_fg_bold == 0);
35031         assert(d.percent_fg_color == 0);
35032         assert(d.percent_bg_color == 0);
35033         assert(d.percent_fg_bold == 0);
35034         assert(d.barbrace_fg_color == 0);
35035         assert(d.barbrace_bg_color == 0);
35036         assert(d.barbrace_fg_bold == 0);
35037         assert(d.bar_fg_color == 0);
35038         assert(d.bar_bg_color == 0);
35039         assert(d.bar_fg_bold == 0);
35040         assert(io.in == 0);
35041         assert(io.out == 1);
35042         assert(io.in_ready == 0);
35043         assert(io.out_ready == 0);
35044         assert(io.eof_in == 0);
35045         assert(io.eof_out == 0);
35046         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
35047         /* assert(io.cbuf == 0x0); */
35048         assert(io.last_read == 0);
35049         assert(io.last_write == 0);
35050         assert(io.total_read == 0);
35051         assert(io.total_write == 0);
35052         assert(io.total_size == 0);
35053         assert(io.total_size_known == 0);
35054         assert(io.timeout == 250000);
35055 
35056         tmp_rcfile = fopen("test-rcfile.txt", "w");
35057         assert(tmp_rcfile != 0);
35058         fprintf(tmp_rcfile, "count-bold: on");
35059         fclose(tmp_rcfile);
35060 
35061         clear_errno();
35062         assert(test_parse_rc(out,0));
35063 
35064 #ifdef PRINT_DEBUG
35065         print();
35066 #endif
35067         assert(d.start_time == 0);
35068         assert(d.total_time == 0);
35069         assert(d.current_time == 0);
35070         assert(d.elapsed_time == 0);
35071         assert(d.percent_complete == 0);
35072         assert(d.display_interval == 1);
35073         assert(d.overtime_flag == 0);
35074         assert(d.k == 1024);
35075         assert(d.twiddle == '-');
35076         assert(d.manual_width == 0);
35077         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
35078         assert(d.display_datacount == 1);
35079         assert(d.display_throughput == 1);
35080         assert(d.display_time == 1);
35081         assert(d.display_percent == 1);
35082         assert(d.display_bar == 1);
35083         assert(d.display_summary == 1);
35084         assert(d.display_ansi == 0);
35085         assert(d.twiddle_fg_color == 0);
35086         assert(d.twiddle_bg_color == 0);
35087         assert(d.twiddle_fg_bold == 0);
35088         assert(d.datacount_fg_color == 0);
35089         assert(d.datacount_bg_color == 0);
35090         assert(d.datacount_fg_bold == 1);
35091         assert(d.throughput_label_fg_color == 0);
35092         assert(d.throughput_label_bg_color == 0);
35093         assert(d.throughput_label_fg_bold == 0);
35094         assert(d.throughput_fg_color == 0);
35095         assert(d.throughput_bg_color == 0);
35096         assert(d.throughput_fg_bold == 0);
35097         assert(d.time_label_fg_color == 0);
35098         assert(d.time_label_bg_color == 0);
35099         assert(d.time_label_fg_bold == 0);
35100         assert(d.percent_fg_color == 0);
35101         assert(d.percent_bg_color == 0);
35102         assert(d.percent_fg_bold == 0);
35103         assert(d.barbrace_fg_color == 0);
35104         assert(d.barbrace_bg_color == 0);
35105         assert(d.barbrace_fg_bold == 0);
35106         assert(d.bar_fg_color == 0);
35107         assert(d.bar_bg_color == 0);
35108         assert(d.bar_fg_bold == 0);
35109         assert(io.in == 0);
35110         assert(io.out == 1);
35111         assert(io.in_ready == 0);
35112         assert(io.out_ready == 0);
35113         assert(io.eof_in == 0);
35114         assert(io.eof_out == 0);
35115         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
35116         /* assert(io.cbuf == 0x0); */
35117         assert(io.last_read == 0);
35118         assert(io.last_write == 0);
35119         assert(io.total_read == 0);
35120         assert(io.total_write == 0);
35121         assert(io.total_size == 0);
35122         assert(io.total_size_known == 0);
35123         assert(io.timeout == 250000);
35124 
35125         assert(unlink("./test-rcfile.txt") == 0);
35126 }
35127 
35128 void test142(FILE *out)
35129 {
35130         FILE *tmp_rcfile = 0;
35131 
35132         unlink("./test-rcfile.txt");
35133 
35134         clear_errno();
35135         displayInit();
35136         ioInit();
35137 
35138 #ifdef PRINT_DEBUG
35139         print();
35140 #endif
35141         assert(d.start_time == 0);
35142         assert(d.total_time == 0);
35143         assert(d.current_time == 0);
35144         assert(d.elapsed_time == 0);
35145         assert(d.percent_complete == 0);
35146         assert(d.display_interval == 1);
35147         assert(d.overtime_flag == 0);
35148         assert(d.k == 1024);
35149         assert(d.twiddle == '-');
35150         assert(d.manual_width == 0);
35151         assert(d.display_twiddle == DEFAULT_DISPLAY_TWIDDLE);
35152         assert(d.display_datacount == 1);
35153         assert(d.display_throughput == 1);
35154         assert(d.display_time == 1);
35155         assert(d.display_percent == 1);
35156         assert(d.display_bar == 1);
35157         assert(d.display_summary == 1);
35158         assert(d.display_ansi == 0);
35159         assert(d.twiddle_fg_color == 0);
35160         assert(d.twiddle_bg_color == 0);
35161         assert(d.twiddle_fg_bold == 0);
35162         assert(d.datacount_fg_color == 0);
35163         assert(d.datacount_bg_color == 0);
35164         assert(d.datacount_fg_bold == 0);
35165         assert(d.throughput_label_fg_color == 0);
35166         assert(d.throughput_label_bg_color == 0);
35167         assert(d.throughput_label_fg_bold == 0);
35168         assert(d.throughput_fg_color == 0);
35169         assert(d.throughput_bg_color == 0);
35170         assert(d.throughput_fg_bold == 0);
35171         assert(d.time_label_fg_color == 0);
35172         assert(d.time_label_bg_color == 0);
35173         assert(d.time_label_fg_bold == 0);
35174         assert(d.percent_fg_color == 0);
35175         assert(d.percent_bg_color == 0);
35176         assert(d.percent_fg_bold == 0);
35177         assert(d.barbrace_fg_color == 0);
35178         assert(d.barbrace_bg_color == 0);
35179         assert(d.barbrace_fg_bold == 0);
35180         assert(d.bar_fg_color == 0);
35181         assert(d.bar_bg_color == 0);
35182         assert(d.bar_fg_bold == 0);
35183         assert(io.in == 0);
35184         assert(io.out == 1);
35185         assert(io.in_ready == 0);
35186         assert(io.out_ready == 0);
35187         assert(io.eof_in == 0);
35188         assert(io.eof_out == 0);
35189         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
35190         /* assert(io.cbuf == 0x0); */
35191         assert(io.last_read == 0);
35192         assert(io.last_write == 0);
35193         assert(io.total_read == 0);
35194         assert(io.total_write == 0);
35195         assert(io.total_size == 0);
35196         assert(io.total_size_known == 0);
35197         assert(io.timeout == 250000);
35198 
35199         tmp_rcfile = fopen("test-rcfile.txt", "w");
35200         assert(tmp_rcfile != 0);
35201         fprintf(tmp_rcfile, "# This is a comment\n");
35202         fprintf(tmp_rcfile, "display-twiddle: no\n");
35203         fprintf(tmp_rcfile, "display-ansi: yes\n");
35204         fprintf(tmp_rcfile, "space-background: black\n");
35205         fprintf(tmp_rcfile, "twiddle-foreground: green\n");
35206         fprintf(tmp_rcfile, "twiddle-background: red\n");
35207         fprintf(tmp_rcfile, "twiddle-bold: no\n");
35208         fprintf(tmp_rcfile, "count-foreground: yellow\n");
35209         fprintf(tmp_rcfile, "count-background: black\n");
35210         fprintf(tmp_rcfile, "count-bold: yes\n");
35211         fprintf(tmp_rcfile, "throughput-label-foreground: green\n");
35212         fprintf(tmp_rcfile, "throughput-label-background: red\n");
35213         fprintf(tmp_rcfile, "throughput-label-bold: no\n");
35214         fprintf(tmp_rcfile, "throughput-foreground: yellow\n");
35215         fprintf(tmp_rcfile, "throughput-background: black\n");
35216         fprintf(tmp_rcfile, "throughput-bold: yes\n");
35217         fprintf(tmp_rcfile, "time-label-foreground: green\n");
35218         fprintf(tmp_rcfile, "time-label-background: red\n");
35219         fprintf(tmp_rcfile, "time-label-bold: no\n");
35220         fprintf(tmp_rcfile, "time-foreground: yellow\n");
35221         fprintf(tmp_rcfile, "time-background: black\n");
35222         fprintf(tmp_rcfile, "time-bold: yes\n");
35223         fprintf(tmp_rcfile, "percent-foreground: yellow\n");
35224         fprintf(tmp_rcfile, "percent-background: green\n");
35225         fprintf(tmp_rcfile, "percent-bold: yes\n");
35226         fprintf(tmp_rcfile, "bar-brace-foreground: green\n");
35227         fprintf(tmp_rcfile, "bar-brace-background: blue\n");
35228         fprintf(tmp_rcfile, "bar-brace-bold: no\n");
35229         fprintf(tmp_rcfile, "bar-foreground: yellow\n");
35230         fprintf(tmp_rcfile, "bar-background: blue\n");
35231         fprintf(tmp_rcfile, "bar-bold: yes\n");
35232         fclose(tmp_rcfile);
35233 
35234         clear_errno();
35235         assert(test_parse_rc(out,0));
35236 
35237 #ifdef PRINT_DEBUG
35238         print();
35239 #endif
35240         assert(d.start_time == 0);
35241         assert(d.total_time == 0);
35242         assert(d.current_time == 0);
35243         assert(d.elapsed_time == 0);
35244         assert(d.percent_complete == 0);
35245         assert(d.display_interval == 1);
35246         assert(d.overtime_flag == 0);
35247         assert(d.k == 1024);
35248         assert(d.twiddle == '-');
35249         assert(d.manual_width == 0);
35250         assert(d.display_twiddle == 0);
35251         assert(d.display_datacount == 1);
35252         assert(d.display_throughput == 1);
35253         assert(d.display_time == 1);
35254         assert(d.display_percent == 1);
35255         assert(d.display_bar == 1);
35256         assert(d.display_summary == 1);
35257         assert(d.display_ansi == 1);
35258         assert((d.twiddle_fg_color != 0) && (strcmp(d.twiddle_fg_color, "") == 0));
35259         assert((d.twiddle_bg_color != 0) && (strcmp(d.twiddle_bg_color, "") == 0));
35260         assert(d.twiddle_fg_bold == 0);
35261         assert((d.datacount_fg_color != 0) && (strcmp(d.datacount_fg_color, "") == 0));
35262         assert((d.datacount_bg_color != 0) && (strcmp(d.datacount_bg_color, "") == 0));
35263         assert(d.datacount_fg_bold == 1);
35264         assert(d.throughput_label_fg_color != 0);
35265         assert(d.throughput_label_bg_color != 0);
35266         assert(d.throughput_label_fg_bold == 0);
35267         assert(d.throughput_fg_color != 0);
35268         assert(d.throughput_bg_color != 0);
35269         assert(d.throughput_fg_bold == 1);
35270         assert(d.time_label_fg_color != 0);
35271         assert(d.time_label_bg_color != 0);
35272         assert(d.time_label_fg_bold == 0);
35273         assert(d.percent_fg_color != 0);
35274         assert(d.percent_bg_color != 0);
35275         assert(d.percent_fg_bold == 1);
35276         assert(d.barbrace_fg_color != 0);
35277         assert(d.barbrace_bg_color != 0);
35278         assert(d.barbrace_fg_bold == 0);
35279         assert(d.bar_fg_color != 0);
35280         assert(d.bar_bg_color != 0);
35281         assert(d.bar_fg_bold == 1);
35282         assert(io.in == 0);
35283         assert(io.out == 1);
35284         assert(io.in_ready == 0);
35285         assert(io.out_ready == 0);
35286         assert(io.eof_in == 0);
35287         assert(io.eof_out == 0);
35288         assert(io.buffer_size == DEFAULT_BUFFER_SIZE);
35289         /* assert(io.cbuf == 0x0); */
35290         assert(io.last_read == 0);
35291         assert(io.last_write == 0);
35292         assert(io.total_read == 0);
35293         assert(io.total_write == 0);
35294         assert(io.total_size == 0);
35295         assert(io.total_size_known == 0);
35296         assert(io.timeout == 250000);
35297 
35298         assert(unlink("./test-rcfile.txt") == 0);
35299 }
35300 
35301 int main(int argc, char *argv[])
35302 {
35303         FILE *out = stderr;
35304 
35305 #ifndef PRINT_ERRORS
35306         out = fopen("/dev/null", "w");
35307         assert(out != 0);
35308 #endif
35309 
35310         test1(out);
35311         test2(out);
35312         test3(out);
35313         test4(out);
35314         test5(out);
35315         test6(out);
35316         test7(out);
35317         test8(out);
35318         test9(out);
35319         test10(out);
35320         test11(out);
35321         test12(out);
35322         test13(out);
35323         test14(out);
35324         test15(out);
35325         test16(out);
35326         test17(out);
35327         test18(out);
35328         test19(out);
35329         test20(out);
35330         test21(out);
35331         test22(out);
35332         test23(out);
35333         test24(out);
35334         test25(out);
35335         test26(out);
35336         test27(out);
35337         test28(out);
35338         test29(out);
35339         test30(out);
35340         test31(out);
35341         test32(out);
35342         test33(out);
35343         test34(out);
35344         test35(out);
35345         test36(out);
35346         test37(out);
35347         test38(out);
35348         test39(out);
35349         test40(out);
35350         test41(out);
35351         test42(out);
35352         test43(out);
35353         test44(out);
35354         test45(out);
35355         test46(out);
35356         test47(out);
35357         test48(out);
35358         test49(out);
35359         test50(out);
35360         test51(out);
35361         test52(out);
35362         test53(out);
35363         test54(out);
35364         test55(out);
35365         test56(out);
35366         test57(out);
35367         test58(out);
35368         test59(out);
35369         test60(out);
35370         test61(out);
35371         test62(out);
35372         test63(out);
35373         test64(out);
35374         test65(out);
35375         test66(out);
35376         test67(out);
35377         test68(out);
35378         test69(out);
35379         test70(out);
35380         test71(out);
35381         test72(out);
35382         test73(out);
35383         test74(out);
35384         test75(out);
35385         test76(out);
35386         test77(out);
35387         test78(out);
35388         test79(out);
35389         test80(out);
35390         test81(out);
35391         test82(out);
35392         test83(out);
35393         test84(out);
35394         test85(out);
35395         test86(out);
35396         test87(out);
35397         test88(out);
35398         test89(out);
35399         test90(out);
35400         test91(out);
35401         test92(out);
35402         test93(out);
35403         test94(out);
35404         test95(out);
35405         test96(out);
35406         test97(out);
35407         test98(out);
35408         test99(out);
35409         test100(out);
35410         test101(out);
35411         test102(out);
35412         test103(out);
35413         test104(out);
35414         test105(out);
35415         test106(out);
35416         test107(out);
35417         test108(out);
35418         test109(out);
35419         test110(out);
35420         test111(out);
35421         test112(out);
35422         test113(out);
35423         test114(out);
35424         test115(out);
35425         test116(out);
35426         test117(out);
35427         test118(out);
35428         test119(out);
35429         test120(out);
35430         test121(out);
35431         test122(out);
35432         test123(out);
35433         test124(out);
35434         test125(out);
35435         test126(out);
35436         test127(out);
35437         test128(out);
35438         test129(out);
35439         test130(out);
35440         test131(out);
35441         test132(out);
35442         test133(out);
35443         test134(out);
35444         test135(out);
35445         test136(out);
35446         test137(out);
35447         test138(out);
35448         test139(out);
35449         test140(out);
35450         test141(out);
35451         test142(out);
35452 
35453 #ifdef PRINT_ERRORS
35454         fclose(out);
35455 #endif
35456         return(0);
35457 }
35458 

Generated on Thu Jun 28 09:13:06 2007 for bar by  doxygen 1.5.1