Author: dmacvicar Date: Sat Oct 11 13:01:34 2008 New Revision: 11297 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11297&view=rev Log: port testcase to Test Setup Modified: trunk/libzypp/tests/repo/OutdatedMetadata_test.cc Modified: trunk/libzypp/tests/repo/OutdatedMetadata_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/OutdatedMetadata_test.cc?rev=11297&r1=11296&r2=11297&view=diff ============================================================================== --- trunk/libzypp/tests/repo/OutdatedMetadata_test.cc (original) +++ trunk/libzypp/tests/repo/OutdatedMetadata_test.cc Sat Oct 11 13:01:34 2008 @@ -14,6 +14,8 @@ #include "zypp/sat/Pool.h" #include "KeyRingTestReceiver.h" +#include "TestSetup.h" + using boost::unit_test::test_case; using namespace std; @@ -33,29 +35,13 @@ // rec.answerImportKey(true); Pathname repodir(TEST_DIR ); - TmpDir tmpCachePath; - RepoManagerOptions opts( RepoManagerOptions::makeTestSetup( tmpCachePath ) ) ; - RepoManager rm(opts); - - RepoInfo updates; - updates.setAlias("updates"); - updates.addBaseUrl(Url(string("dir:") + repodir.absolutename().asString() )); - - try - { - rm.buildCache(updates); - rm.loadFromCache(updates); - } - catch (const Exception & e) - { - BOOST_FAIL( string("Problem getting the data: ")+ e.msg()) ; - } sat::Pool pool(sat::Pool::instance()); + TestSetup test( Arch_x86_64 ); + test.loadRepo(Url(string("dir:") + repodir.absolutename().asString()), "updates"); + Repository repo = pool.reposFind("updates"); BOOST_CHECK_EQUAL( repo.generatedTimestamp(), Date(1222083131) ); BOOST_CHECK_EQUAL( repo.suggestedExpirationTimestamp(), Date(1222083131 + 3600) ); - - rm.cleanCache(updates); } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org