Skip to content

Commit

Permalink
next attempt to get erase() to work alike on all OS-es
Browse files Browse the repository at this point in the history
  • Loading branch information
kosloot committed Sep 12, 2024
1 parent 68becb4 commit 2f362d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/FileUtils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ namespace TiCC {
}
}
else {
throw runtime_error( "could not erase file/path '" + name + "'" );
// just ignore
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/runtest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ void test_fileutils( const string& path ){
assertTrue( res[0] == path+"small.txt" );
erase( "/tmp/test/silly/files/file" );
assertTrue( createPath( "/tmp/test/silly/files/file" ) );
assertThrow( erase( "/tmp/test/silly/" ), runtime_error );
erase( "/tmp/test/silly/" );
assertTrue( createPath( "/tmp/test/silly/files/path/" ) );
assertTrue( createPath( "/tmp/test/silly/files/path/raar" ) );
assertFalse( createPath( "/tmp/test/silly/files/path/raar/sub" ) );
Expand Down Expand Up @@ -773,7 +773,7 @@ void test_fileutils( const string& path ){
assertNoThrow( erase( fn ) );
assertFalse( isFile( fn ) );
assertFalse( isFile( "/root/.config/ucto/tokconfig.nld" ) );
assertThrow( erase( "/root/.config/ucto/tokconfig.nld" ), runtime_error );
erase( "/root/.config/ucto/tokconfig.nld" );
assertTrue( isDir( "/" ) );
assertFalse( isWritableDir( "/boot" ) );
}
Expand Down

0 comments on commit 2f362d6

Please sign in to comment.