Ignore:
Timestamp:
Mar 6, 2008, 12:56:42 AM (14 years ago)
Author:
Peter
Message:

fixes #282

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/fileutil_test.cc

    r1001 r1207  
    6060      *error << "\trx permissions on " << file.path() << std::endl;
    6161    ok&=!testval;
     62    if (!(testval=file.permissions("d")))
     63      *error << "\td permissions on " << file.path() << std::endl;
     64    ok&=!testval;
    6265  }
    6366  catch (utility::IO_error e) {
     
    8588      *error << "\tw permission on " << file.path() << std::endl;
    8689    ok&=!testval; // 'w' on non-existent file ok if directory writeable
     90    if (!(testval=file.permissions("d")))
     91      *error << "\td permission on " << file.path() << std::endl;
     92    ok&=!testval;
    8793  }
    8894  catch (utility::IO_error e) {
     
    109115      *error << "\tw permission on " << file.path() << std::endl;
    110116    ok&=!testval; // 'w' on non-existent file ok if directory writeable
     117    if (!(testval=file.permissions("d")))
     118      *error << "\td permission on " << file.path() << std::endl;
     119    ok&=!testval;
    111120  }
    112121  catch (utility::IO_error e) {
     
    134143      *error << "\tw permission failed on " << file.path() << std::endl;
    135144    ok&=testval;
     145    if (testval=file.permissions("d"))
     146      *error << "\td permission failed on " << file.path() << std::endl;
     147    ok&=testval;
    136148  }
    137149  catch (utility::IO_error e) {
     
    160172  }
    161173
     174  try {
     175    *error << "FileUtil Test 6" << std::endl;
     176    utility::FileUtil file("fileutil_test.cc");
     177    file.permissions("rxwa"); // should throw
     178    ok = false;
     179  }
     180  catch (std::invalid_argument& e) {
     181    *error << "Expected exception thrown with what: " << e.what() << std::endl;
     182  }
     183
     184 
    162185 
    163186
Note: See TracChangeset for help on using the changeset viewer.