BOOST_AUTO_TEST_CASE(StatTest1)
{
- I2n::Stat stat("Makefile");
+ I2n::Stat stat(__FILE__);
BOOST_CHECK_EQUAL( true, (bool)stat );
BOOST_CHECK_EQUAL( true, stat.is_regular_file() );
typedef std::vector< std::string > StringVector;
StringVector names;
- bool res= I2n::get_dir(".",names);
+ string test_dir = dirname(__FILE__);
+ bool res= I2n::get_dir(test_dir,names);
BOOST_CHECK_EQUAL( true, res );
BOOST_CHECK( ! names.empty() );
- StringVector::iterator it = std::find( names.begin(), names.end(), "Makefile");
+ BOOST_MESSAGE("Looking for " << basename(__FILE__) << " in " << test_dir);
+ StringVector::iterator it = std::find( names.begin(), names.end(), basename(__FILE__));
BOOST_CHECK( it != names.end() );
it = std::find( names.begin(), names.end(), "." );
BOOST_CHECK( it == names.end() );
- names= get_dir(".",true);
+ names= get_dir(test_dir,true);
BOOST_CHECK( ! names.empty() );
for (it= names.begin(); it!=names.end(); ++it)