Changeset 1001 for trunk/test


Ignore:
Timestamp:
Jan 1, 2008, 11:19:57 PM (14 years ago)
Author:
Peter
Message:

reset errno to zero when it is an expected error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/fileutil_test.cc

    r1000 r1001  
    140140  }
    141141
     142  // checking permissions on existent file after non-existence file
     143  // has been checked
     144  try {
     145    *error << "FileUtil Test 5" << std::endl;
     146    bool testval=true;
     147     // intermediate dir must be unique!
     148    utility::FileUtil file("./fileio_test.sdf34DSF/file");
     149    if (!(testval=file.exists()))
     150      *error << "\tfile does not exist: " << file.path() << std::endl;
     151    ok&=!testval;
     152    utility::FileUtil file2("fileutil_test.cc");
     153    if (!(testval=!file2.exists()))
     154      *error << "\tfile does exist: " << file2.path() << std::endl;
     155    ok&=!testval;
     156  }
     157  catch (utility::IO_error e) {
     158    ok=false;
     159    *error << e.what() << std::endl;
     160  }
     161
     162 
     163
    142164  *error << (ok ? "OK" : "Failed") << std::endl;
    143165  if (error!=&std::cerr)
Note: See TracChangeset for help on using the changeset viewer.