From b37950fecfb3afb53942fba28e4e36d0b8753351 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Wed, 15 Oct 2014 15:50:00 +0200 Subject: added file iteration also on Windows --- tests/utils/test6.MUST.WIN32 | 5 +++++ tests/utils/test6.cpp | 24 +++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 tests/utils/test6.MUST.WIN32 (limited to 'tests') 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 #include +#include using namespace std; int main( void ) { - vector entries = directory_entries( "test6.DATA", true, true ); - - sort( entries.begin( ), entries.end( ) ); - - vector::const_iterator it, end = entries.end( ); - for( it = entries.begin( ); it != end; it++ ) { - cout << (*it) << endl; + try { + vector entries = directory_entries( "test6.DATA", true, true ); + + sort( entries.begin( ), entries.end( ) ); + + vector::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; } -- cgit v1.2.3-54-g00ecf