Author: dmacvicar
Date: Mon Jun 18 15:44:29 2007
New Revision: 5768
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5768&view=rev
Log:
-add test for reponfo
- fix missing binds
Added:
trunk/libzypp/tests/zypp/RepoInfo_test.cc
Modified:
trunk/libzypp/tests/zypp/RepoManager_test.cc
trunk/libzypp/zypp/cache/CacheStore.cc
Added: trunk/libzypp/tests/zypp/RepoInfo_test.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/RepoInfo_test.cc?rev=5768&view=auto
==============================================================================
--- trunk/libzypp/tests/zypp/RepoInfo_test.cc (added)
+++ trunk/libzypp/tests/zypp/RepoInfo_test.cc Mon Jun 18 15:44:29 2007
@@ -0,0 +1,56 @@
+
+#include <iostream>
+#include <fstream>
+#include <list>
+#include <string>
+
+#include "zypp/base/Logger.h"
+#include "zypp/base/Exception.h"
+
+#include "zypp/RepoInfo.h"
+
+#include
+#include
+#include
+
+#include "KeyRingTestReceiver.h"
+
+using boost::unit_test::test_suite;
+using boost::unit_test::test_case;
+using namespace boost::unit_test::log;
+
+using namespace std;
+using namespace zypp;
+using namespace zypp::filesystem;
+using namespace zypp::repo;
+
+void repoinfo_test( const string &dir )
+{
+
+}
+
+test_suite*
+init_unit_test_suite( int argc, char* argv[] )
+{
+ string datadir;
+ if (argc < 2)
+ {
+ datadir = TESTS_SRC_DIR;
+ datadir = (Pathname(datadir) + "/zypp/data/RepoInfo").asString();
+ cout << "repoinfo_test:"
+ " path to directory with test data required as parameter. Using " << datadir << endl;
+ //return (test_suite *)0;
+ }
+ else
+ {
+ datadir = argv[1];
+ }
+
+ std::string const params[] = { datadir };
+ //set_log_stream( std::cout );
+ test_suite* test= BOOST_TEST_SUITE( "RepoInfoTest" );
+ test->add(BOOST_PARAM_TEST_CASE( &repoinfo_test,
+ (std::string const*)params, params+1));
+ return test;
+}
+
Modified: trunk/libzypp/tests/zypp/RepoManager_test.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/RepoManager_test.cc?rev=5768&r1=5767&r2=5768&view=diff
==============================================================================
--- trunk/libzypp/tests/zypp/RepoManager_test.cc (original)
+++ trunk/libzypp/tests/zypp/RepoManager_test.cc Mon Jun 18 15:44:29 2007
@@ -62,6 +62,16 @@
ResStore store = repository.resolvables();
MIL << store.size() << " resolvables" << endl;
+
+ manager.refreshMetadata(repo);
+
+ if ( manager.isCached(repo ) )
+ {
+ MIL << "Repo already in cache, clean cache"<< endl;
+ manager.cleanCache(repo);
+ }
+ MIL << "Parsing repository metadata..." << endl;
+ manager.buildCache(repo);
}
test_suite*
Modified: trunk/libzypp/zypp/cache/CacheStore.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/CacheStore.cc?rev=5768&r1=5767&r2=5768&view=diff
==============================================================================
--- trunk/libzypp/zypp/cache/CacheStore.cc (original)
+++ trunk/libzypp/zypp/cache/CacheStore.cc Mon Jun 18 15:44:29 2007
@@ -886,6 +886,7 @@
long long id = 0;
try
{
+ _pimpl->select_name_cmd->bind(":name", name);
sqlite3_reader reader= _pimpl->select_name_cmd->executereader();
if (!reader.read())
{
@@ -910,6 +911,7 @@
long long id = 0;
try
{
+ _pimpl->select_dirname_cmd->bind(":name", name);
sqlite3_reader reader= _pimpl->select_dirname_cmd->executereader();
if (!reader.read())
{
@@ -933,6 +935,7 @@
long long id = 0;
try
{
+ _pimpl->select_filename_cmd->bind(":name", name);
sqlite3_reader reader= _pimpl->select_filename_cmd->executereader();
if (!reader.read())
{
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org