Author: dmacvicar Date: Tue Sep 11 11:49:39 2007 New Revision: 7176 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7176&view=rev Log: - test case fot isExist() Modified: trunk/libzypp/tests/zypp/PathInfo.cc Modified: trunk/libzypp/tests/zypp/PathInfo.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/PathInfo.cc?rev=7176&r1=7175&r2=7176&view=diff ============================================================================== --- trunk/libzypp/tests/zypp/PathInfo.cc (original) +++ trunk/libzypp/tests/zypp/PathInfo.cc Tue Sep 11 11:49:39 2007 @@ -52,9 +52,28 @@ BOOST_REQUIRE( is_checksum( file.path(), file_md5 ) ); } +void pathinfo_is_exist_test() +{ + TmpDir dir; + Pathname subdir("text with spaces"); + // create a fake file + BOOST_CHECK_EQUAL( filesystem::mkdir(dir.path() + subdir), 0 ); + + Pathname filepath = (dir.path() + subdir+ "filename"); + ofstream str(filepath.asString().c_str(),ofstream::out); + str << "foo bar" << endl; + str.flush(); + str.close(); + + BOOST_CHECK( PathInfo(filepath).isExist() ); +} + void pathinfo_misc_test() { TmpDir dir; + + + PathInfo info(dir.path()); BOOST_CHECK(info.isDir()); } @@ -65,6 +84,7 @@ test_suite* test= BOOST_TEST_SUITE( "PathInfoTest" ); test->add( BOOST_TEST_CASE( &pathinfo_checksum_test ), 0 /* expected zero error */ ); test->add( BOOST_TEST_CASE( &pathinfo_misc_test ), 0 /* expected zero error */ ); + test->add( BOOST_TEST_CASE( &pathinfo_is_exist_test ), 0 /* expected zero error */ ); return test; } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org