Changeset 979 for trunk/test


Ignore:
Timestamp:
Oct 21, 2007, 9:46:14 PM (15 years ago)
Author:
Peter
Message:

fixing bug in OptionFile?. Dont try to create FileUtil? for option not present in commandline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/commandline_test.cc

    r975 r979  
    3434bool test_switch(std::ostream& error);
    3535bool test_arg(std::ostream& error);
     36bool test_file(std::ostream& error);
    3637bool test_failures(std::ostream& error);
    3738
     
    5657    ok &= test_switch(*error);
    5758    ok &= test_arg(*error);
     59    ok &= test_file(*error);
    5860    ok &= test_failures(*error);
    5961  }
     
    342344
    343345
    344 
    345 
    346 
    347 
     346bool test_file(std::ostream& error)
     347{
     348  bool ok=true;
     349  CommandLine cmd;
     350  OptionFile inclones(cmd, "clones", "file containing clones");
     351  OptionFile indata(cmd, "data", "data to merge");
     352  OptionSwitch help(cmd, "h,help", "display this help and exit");
     353
     354  error << "Testing OptionFile... ";
     355  {
     356    int ac = 2;
     357    char* av[] = { "test_prog", "-h" };
     358    cmd.parse(ac,av);
     359    error << "ok\n";
     360  }
     361  return ok;
     362}
     363
     364
     365
     366
     367
Note: See TracChangeset for help on using the changeset viewer.