diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2014-10-15 15:50:00 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2014-10-15 15:50:00 +0200 |
commit | b37950fecfb3afb53942fba28e4e36d0b8753351 (patch) | |
tree | 52a51bd7b6a808ee43d4422d79d9d0aee5dde4fd /tests | |
parent | 1127e07a2a6d6b3c0cbd342396e6c8af7ee54040 (diff) | |
download | crawler-b37950fecfb3afb53942fba28e4e36d0b8753351.tar.gz crawler-b37950fecfb3afb53942fba28e4e36d0b8753351.tar.bz2 |
added file iteration also on Windows
Diffstat (limited to 'tests')
-rw-r--r-- | tests/utils/test6.MUST.WIN32 | 5 | ||||
-rwxr-xr-x | tests/utils/test6.cpp | 24 |
2 files changed, 20 insertions, 9 deletions
diff --git a/tests/utils/test6.MUST.WIN32 b/tests/utils/test6.MUST.WIN32 new file mode 100644 index 0000000..df3933e --- /dev/null +++ b/tests/utils/test6.MUST.WIN32 @@ -0,0 +1,5 @@ +test6.DATA\adir2\adir3\afile4 +test6.DATA\adir2\adir3\afile5 +test6.DATA\adir\afile2 +test6.DATA\adir\afile3 +test6.DATA\afile diff --git a/tests/utils/test6.cpp b/tests/utils/test6.cpp index 839f69b..6ad9e10 100755 --- a/tests/utils/test6.cpp +++ b/tests/utils/test6.cpp @@ -2,19 +2,25 @@ #include <iostream> #include <algorithm> +#include <stdexcept> using namespace std; int main( void ) { - vector<string> entries = directory_entries( "test6.DATA", true, true ); - - sort( entries.begin( ), entries.end( ) ); - - vector<string>::const_iterator it, end = entries.end( ); - for( it = entries.begin( ); it != end; it++ ) { - cout << (*it) << endl; + try { + vector<string> entries = directory_entries( "test6.DATA", true, true ); + + sort( entries.begin( ), entries.end( ) ); + + vector<string>::const_iterator it, end = entries.end( ); + for( it = entries.begin( ); it != end; it++ ) { + cout << (*it) << endl; + } + + return 0; + } catch( exception &e ) { + cerr << "ERROR: " << e.what( ) << endl; + return 1; } - - return 0; } |